public void reset(CodeStyleSettings settings) { myCbUseFQClassNames.setSelected(settings.USE_FQ_CLASS_NAMES); myCbUseSingleClassImports.setSelected(settings.USE_SINGLE_CLASS_IMPORTS); myCbInsertInnerClassImports.setSelected(settings.INSERT_INNER_CLASS_IMPORTS); myClassCountField.setText(Integer.toString(settings.CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND)); myNamesCountField.setText(Integer.toString(settings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND)); myImportLayoutPanel.getImportLayoutList().copyFrom(settings.IMPORT_LAYOUT_TABLE); myPackageList.copyFrom(settings.PACKAGES_TO_USE_IMPORT_ON_DEMAND); myFqnInJavadocOption.reset(settings); myImportLayoutPanel .getCbLayoutStaticImportsSeparately() .setSelected(settings.LAYOUT_STATIC_IMPORTS_SEPARATELY); final JBTable importLayoutTable = myImportLayoutPanel.getImportLayoutTable(); AbstractTableModel model = (AbstractTableModel) importLayoutTable.getModel(); model.fireTableDataChanged(); model = (AbstractTableModel) myPackageTable.getModel(); model.fireTableDataChanged(); if (importLayoutTable.getRowCount() > 0) { importLayoutTable.getSelectionModel().setSelectionInterval(0, 0); } if (myPackageTable.getRowCount() > 0) { myPackageTable.getSelectionModel().setSelectionInterval(0, 0); } }
private void refreshTable(final JBTable table, final PackageEntryTable packageTable) { AbstractTableModel model = (AbstractTableModel) table.getModel(); table.createDefaultColumnsFromModel(); model.fireTableDataChanged(); ImportLayoutPanel.resizeColumns( packageTable, table, myImportLayoutPanel.areStaticImportsEnabled()); }
private void resetSelection(@NotNull String[] selectedSerials) { MyDeviceTableModel model = (MyDeviceTableModel) myDeviceTable.getModel(); Set<String> selectedSerialsSet = new HashSet<String>(); Collections.addAll(selectedSerialsSet, selectedSerials); IDevice[] myDevices = model.myDevices; ListSelectionModel selectionModel = myDeviceTable.getSelectionModel(); boolean cleared = false; for (int i = 0, n = myDevices.length; i < n; i++) { String serialNumber = myDevices[i].getSerialNumber(); if (selectedSerialsSet.contains(serialNumber)) { if (!cleared) { selectionModel.clearSelection(); cleared = true; } selectionModel.addSelectionInterval(i, i); } } }
private MyTableModel getTableModel() { return (MyTableModel) myTable.getModel(); }