コード例 #1
0
 @Override
 public void runClasspathPanelAction(Runnable action) {
   try {
     disableModelUpdate();
     action.run();
   } finally {
     enableModelUpdate();
     myEntryTable.requestFocus();
   }
 }
コード例 #2
0
 public void selectElements(Collection<? extends Module> elements) {
   if (elements.size() == 0) {
     myTable.clearSelection();
     return;
   }
   final int[] rows = getElementsRows(elements);
   TableUtil.selectRows(myTable, rows);
   TableUtil.scrollSelectionToVisible(myTable);
   myTable.requestFocus();
 }
コード例 #3
0
  public void removeModule(Module element) {
    final int elementRow = myTableModel.getElementRow(element);
    if (elementRow < 0) {
      return; // no such element
    }
    final boolean wasSelected = myTable.getSelectionModel().isSelectedIndex(elementRow);

    myTableModel.removeElement(element);

    if (wasSelected) {
      final int rowCount = myTableModel.getRowCount();
      if (rowCount > 0) {
        selectRow(elementRow % rowCount);
      } else {
        myTable.getSelectionModel().clearSelection();
      }
    }
    myTable.requestFocus();
  }
コード例 #4
0
 public void addModule(Module element, String dirName) {
   myTableModel.addElement(element, dirName);
   selectRow(myTableModel.getRowCount() - 1);
   myTable.requestFocus();
 }
コード例 #5
0
 public void addElement(T element, final boolean isMarked, ElementProperties elementProperties) {
   myTableModel.addElement(element, isMarked);
   myElementToPropertiesMap.put(element, elementProperties);
   selectRow(myTableModel.getRowCount() - 1);
   myTable.requestFocus();
 }