Java 类com.intellij.util.ui.EditableModel 实例源码

项目:intellij-ce-playground    文件:ProcessorProfilePanel.java   
private static JPanel createTablePanel(final JBTable table) {
  return ToolbarDecorator.createDecorator(table)
    .disableUpAction()
    .disableDownAction()
    .setAddAction(new AnActionButtonRunnable() {
      @Override
      public void run(AnActionButton anActionButton) {
        final TableCellEditor cellEditor = table.getCellEditor();
        if (cellEditor != null) {
          cellEditor.stopCellEditing();
        }
        final TableModel model = table.getModel();
        ((EditableModel)model).addRow();
        TableUtil.editCellAt(table, model.getRowCount() - 1, 0);
      }
    })
    .createPanel();
}
项目:intellij-ce-playground    文件:ListToolbarDecorator.java   
ListToolbarDecorator(JList list, @Nullable EditableModel editableModel) {
  myList = list;
  myEditableModel = editableModel;
  myAddActionEnabled = myRemoveActionEnabled = myUpActionEnabled = myDownActionEnabled = true;
  createActions();
  myList.addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent e) {
      updateButtons();
    }
  });
  myList.addPropertyChangeListener("enabled", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      updateButtons();
    }
  });
}
项目:tools-idea    文件:ProcessorProfilePanel.java   
private static JPanel createTablePanel(final JBTable table) {
  return ToolbarDecorator.createDecorator(table)
    .disableUpAction()
    .disableDownAction()
    .setAddAction(new AnActionButtonRunnable() {
      @Override
      public void run(AnActionButton anActionButton) {
        final TableCellEditor cellEditor = table.getCellEditor();
        if (cellEditor != null) {
          cellEditor.stopCellEditing();
        }
        final TableModel model = table.getModel();
        ((EditableModel)model).addRow();
        TableUtil.editCellAt(table, model.getRowCount() - 1, 0);
      }
    })
    .createPanel();
}
项目:tools-idea    文件:ListToolbarDecorator.java   
ListToolbarDecorator(JList list, @Nullable EditableModel editableModel) {
  myList = list;
  myEditableModel = editableModel;
  myAddActionEnabled = myRemoveActionEnabled = myUpActionEnabled = myDownActionEnabled = true;
  createActions();
  myList.addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent e) {
      updateButtons();
    }
  });
  myList.addPropertyChangeListener("enabled", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      updateButtons();
    }
  });
}
项目:consulo    文件:ListToolbarDecorator.java   
ListToolbarDecorator(JList list, @Nullable EditableModel editableModel) {
  myList = list;
  myEditableModel = editableModel;
  myAddActionEnabled = myRemoveActionEnabled = myUpActionEnabled = myDownActionEnabled = true;
  createActions();
  myList.addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent e) {
      updateButtons();
    }
  });
  myList.addPropertyChangeListener("enabled", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      updateButtons();
    }
  });
}
项目:consulo-java    文件:ProcessorProfilePanel.java   
private static JPanel createTablePanel(final JBTable table) {
  return ToolbarDecorator.createDecorator(table)
    .disableUpAction()
    .disableDownAction()
    .setAddAction(new AnActionButtonRunnable() {
      @Override
      public void run(AnActionButton anActionButton) {
        final TableCellEditor cellEditor = table.getCellEditor();
        if (cellEditor != null) {
          cellEditor.stopCellEditing();
        }
        final TableModel model = table.getModel();
        ((EditableModel)model).addRow();
        TableUtil.editCellAt(table, model.getRowCount() - 1, 0);
      }
    })
    .createPanel();
}
项目:intellij-ce-playground    文件:JBListTableModel.java   
@Override
public void addRow() {
  final int count = myModel.getRowCount();
  if (myModel instanceof EditableModel) {
    ((EditableModel)myModel).addRow();
  }
  if (count < myModel.getRowCount()) {
    fireTableRowsInserted(count, myModel.getRowCount() - 1);
  }
}
项目:intellij-ce-playground    文件:JBListTableModel.java   
@Override
public void removeRow(int index) {
  if (myModel instanceof EditableModel) {
    ((EditableModel)myModel).removeRow(index);
  }
  fireTableRowsDeleted(index, index);
}
项目:intellij-ce-playground    文件:JBListTableModel.java   
@Override
public boolean canExchangeRows(int oldIndex, int newIndex) {
  if (myModel instanceof EditableModel) {
    return ((EditableModel)myModel).canExchangeRows(oldIndex, newIndex);
  }
  return false;
}
项目:intellij-ce-playground    文件:JBListTableModel.java   
@Override
public void exchangeRows(int oldIndex, int newIndex) {
  if (myModel instanceof EditableModel) {
    ((EditableModel)myModel).exchangeRows(oldIndex, newIndex);
  }
  fireTableRowsUpdated(Math.min(oldIndex, newIndex), Math.max(oldIndex, newIndex));
}
项目:tools-idea    文件:JBListTableModel.java   
@Override
public void addRow() {
  final int count = myModel.getRowCount();
  if (myModel instanceof EditableModel) {
    ((EditableModel)myModel).addRow();
  }
  if (count < myModel.getRowCount()) {
    fireTableRowsInserted(count, myModel.getRowCount() - 1);
  }
}
项目:tools-idea    文件:JBListTableModel.java   
@Override
public void removeRow(int index) {
  if (myModel instanceof EditableModel) {
    ((EditableModel)myModel).removeRow(index);
  }
  fireTableRowsDeleted(index, index);
}
项目:tools-idea    文件:JBListTableModel.java   
@Override
public boolean canExchangeRows(int oldIndex, int newIndex) {
  if (myModel instanceof EditableModel) {
    return ((EditableModel)myModel).canExchangeRows(oldIndex, newIndex);
  }
  return false;
}
项目:tools-idea    文件:JBListTableModel.java   
@Override
public void exchangeRows(int oldIndex, int newIndex) {
  if (myModel instanceof EditableModel) {
    ((EditableModel)myModel).exchangeRows(oldIndex, newIndex);
  }
  fireTableRowsUpdated(Math.min(oldIndex, newIndex), Math.max(oldIndex, newIndex));
}
项目:consulo    文件:JBListTableModel.java   
@Override
public void addRow() {
  final int count = myModel.getRowCount();
  if (myModel instanceof EditableModel) {
    ((EditableModel)myModel).addRow();
  }
  if (count < myModel.getRowCount()) {
    fireTableRowsInserted(count, myModel.getRowCount() - 1);
  }
}
项目:consulo    文件:JBListTableModel.java   
@Override
public void removeRow(int index) {
  if (myModel instanceof EditableModel) {
    ((EditableModel)myModel).removeRow(index);
  }
  fireTableRowsDeleted(index, index);
}
项目:consulo    文件:JBListTableModel.java   
@Override
public boolean canExchangeRows(int oldIndex, int newIndex) {
  if (myModel instanceof EditableModel) {
    return ((EditableModel)myModel).canExchangeRows(oldIndex, newIndex);
  }
  return false;
}
项目:consulo    文件:JBListTableModel.java   
@Override
public void exchangeRows(int oldIndex, int newIndex) {
  if (myModel instanceof EditableModel) {
    ((EditableModel)myModel).exchangeRows(oldIndex, newIndex);
  }
  fireTableRowsUpdated(Math.min(oldIndex, newIndex), Math.max(oldIndex, newIndex));
}
项目:intellij-ce-playground    文件:ListToolbarDecorator.java   
@Override
protected boolean isModelEditable() {
  return myEditableModel != null || myList.getModel() instanceof EditableModel;
}
项目:intellij-ce-playground    文件:ListToolbarDecorator.java   
@Override
protected void installDnDSupport() {
  RowsDnDSupport.install(myList, myEditableModel != null ? myEditableModel : (EditableModel)myList.getModel());
}
项目:intellij-ce-playground    文件:TableToolbarDecorator.java   
@Override
protected void installDnDSupport() {
  RowsDnDSupport.install(myTable, (EditableModel)myTable.getModel());
}
项目:intellij-ce-playground    文件:TableToolbarDecorator.java   
@Override
protected boolean isModelEditable() {
  return myTable.getModel() instanceof EditableModel;
}
项目:intellij-ce-playground    文件:RowsDnDSupport.java   
public static void install(@NotNull final JTable table, @NotNull final EditableModel model) {
  table.setDragEnabled(true);
  installImpl(table, model);
}
项目:intellij-ce-playground    文件:RowsDnDSupport.java   
public static void install(@NotNull final JList list, @NotNull final EditableModel model) {
  list.setDragEnabled(true);
  installImpl(list, model);
}
项目:intellij-ce-playground    文件:RowsDnDSupport.java   
public static void install(@NotNull final JTree tree, @NotNull final EditableModel model) {
  tree.setDragEnabled(true);
  installImpl(tree, model);
}
项目:intellij-ce-playground    文件:ToolbarDecorator.java   
public static ToolbarDecorator createDecorator(@NotNull JList list, EditableModel editableModel) {
  return new ListToolbarDecorator(list, editableModel).initPosition();
}
项目:intellij-ce-playground    文件:TreeToolbarDecorator.java   
@Override
protected boolean isModelEditable() {
  return myTree.getModel() instanceof EditableModel;
}
项目:intellij-ce-playground    文件:TreeToolbarDecorator.java   
@Override
protected void installDnDSupport() {
  RowsDnDSupport.install(myTree, (EditableModel)myTree.getModel());
}
项目:tools-idea    文件:ListToolbarDecorator.java   
@Override
protected boolean isModelEditable() {
  return myEditableModel != null || myList.getModel() instanceof EditableModel;
}
项目:tools-idea    文件:ListToolbarDecorator.java   
@Override
protected void installDnDSupport() {
  RowsDnDSupport.install(myList, myEditableModel != null ? myEditableModel : (EditableModel)myList.getModel());
}
项目:tools-idea    文件:TableToolbarDecorator.java   
@Override
protected void installDnDSupport() {
  RowsDnDSupport.install(myTable, (EditableModel)myTable.getModel());
}
项目:tools-idea    文件:TableToolbarDecorator.java   
protected boolean isModelEditable() {
  return myTable.getModel() instanceof EditableModel;
}
项目:tools-idea    文件:RowsDnDSupport.java   
public static void install(@NotNull final JTable table, @NotNull final EditableModel model) {
  table.setDragEnabled(true);
  installImpl(table, model);
}
项目:tools-idea    文件:RowsDnDSupport.java   
public static void install(@NotNull final JList list, @NotNull final EditableModel model) {
  list.setDragEnabled(true);
  installImpl(list, model);
}
项目:tools-idea    文件:RowsDnDSupport.java   
public static void install(@NotNull final JTree tree, @NotNull final EditableModel model) {
  tree.setDragEnabled(true);
  installImpl(tree, model);
}
项目:tools-idea    文件:ToolbarDecorator.java   
public static ToolbarDecorator createDecorator(@NotNull JList list, EditableModel editableModel) {
  return new ListToolbarDecorator(list, editableModel).initPosition();
}
项目:tools-idea    文件:TreeToolbarDecorator.java   
@Override
protected boolean isModelEditable() {
  return myTree.getModel() instanceof EditableModel;
}
项目:tools-idea    文件:TreeToolbarDecorator.java   
@Override
protected void installDnDSupport() {
  RowsDnDSupport.install(myTree, (EditableModel)myTree.getModel());
}
项目:consulo    文件:ListToolbarDecorator.java   
@Override
protected boolean isModelEditable() {
  return myEditableModel != null || myList.getModel() instanceof EditableModel;
}
项目:consulo    文件:ListToolbarDecorator.java   
@Override
protected void installDnDSupport() {
  RowsDnDSupport.install(myList, myEditableModel != null ? myEditableModel : (EditableModel)myList.getModel());
}