public AbstractTypeSelectionTable(Collection<M> memberInfos, @Nullable TypeInfoModel<T, M> memberInfoModel) { myTableModel = new MyTableModel<T, M>(this); myTypesInfos = new ArrayList<M>(memberInfos); if (memberInfoModel != null) { myTypeInfoModel = memberInfoModel; } else { myTypeInfoModel = new DefaultTypeInfoModel<T, M>(); } setModel(myTableModel); TableColumnModel model = getColumnModel(); model.getColumn(DISPLAY_NAME_COLUMN).setCellRenderer(new MyTableRenderer<T, M>(this)); TableColumn checkBoxColumn = model.getColumn(CHECKED_COLUMN); TableUtil.setupCheckboxColumn(checkBoxColumn); checkBoxColumn.setCellRenderer(new MyBooleanRenderer<T, M>(this)); setPreferredScrollableViewportSize(new Dimension(400, getRowHeight() * 12)); getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); setShowGrid(false); setIntercellSpacing(new Dimension(0, 0)); new MyEnableDisableAction().register(); new TableSpeedSearch(this); }
private void createUIComponents() { myModulesTable = new ModuleTable(); new TableSpeedSearch(myModulesTable, new PairFunction<Object, Cell, String>() { @Override public String fun(Object o, Cell v) { if (o instanceof ModuleRow) { ModuleRow row = (ModuleRow)o; return getNameOf(row.module); } return o == null || o instanceof Boolean ? "" : o.toString(); } }); }
public static void setSpeedSearch(TreeTable treeTable) { new TableSpeedSearch(treeTable) { @Override protected boolean isMatchingElement(Object element, String pattern) { String text = super.getElementText(element); // match search as long as some portion of the text matches the pattern return text != null && text.contains(pattern); } }; }
public AttributesPanel() { myBackButton.setIcon(AllIcons.Actions.Back); myBackButton.setBorder(BORDER); myPaletteScrollPane.setVisible(false); myAdvancedFilterCheckBox.setVisible(false); myAttrGroupCombo.setVisible(false); new ComboboxSpeedSearch(myThemeCombo); myBackButton.setToolTipText("Back to the theme"); myAttributesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); myAttributesTable.setTableHeader(null); // TODO: TableSpeedSearch does not really support filtered tables since it incorrectly uses the model to calculate the number // of available cells. Fix this. new TableSpeedSearch(myAttributesTable) { @Override protected int getElementCount() { return myComponent.getRowCount() * myComponent.getColumnCount(); } }; mySubStyleLabel.setVisible(false); mySubStyleLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); myPalette.setShowCheckeredBackground(true); // Stop the combo box long items from blocking the right panel from being able to be made small. myThemeCombo.setMinimumSize(new Dimension(10, myThemeCombo.getMinimumSize().height)); myThemeCombo.setPreferredSize(new Dimension(10, myThemeCombo.getPreferredSize().height)); }
public HgMqUnAppliedPatchesPanel(@NotNull HgRepository repository) { super(new BorderLayout()); myRepository = repository; myProject = myRepository.getProject(); myMqPatchDir = myRepository.getHgDir().findChild("patches"); mySeriesFile = myMqPatchDir != null ? new File(myMqPatchDir.getPath(), "series") : null; myPatchTable = new MyPatchTable(new MyPatchModel(myRepository.getUnappliedPatchNames())); myPatchTable.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { updatePatchSeriesInBackground(null); super.focusLost(e); } }); myPatchTable.setShowColumns(true); myPatchTable.setFillsViewportHeight(true); myPatchTable.getEmptyText().setText("Nothing to show"); myPatchTable.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), START_EDITING); myPatchTable.setDragEnabled(true); new TableSpeedSearch(myPatchTable); myPatchTable.setDropMode(DropMode.INSERT_ROWS); myPatchTable.setTransferHandler(new TableRowsTransferHandler(myPatchTable)); add(createToolbar(), BorderLayout.WEST); JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myPatchTable); add(scrollPane, BorderLayout.CENTER); myProject.getMessageBus().connect(myProject).subscribe(HgVcs.STATUS_TOPIC, this); }
@VisibleForTesting void installTableSpeedSearch(JTable projectListTable) { // IDEA implementation of instant type-search within a table. new TableSpeedSearch(projectListTable) { // reflect this text in the filter text field. @Override protected void selectElement(Object element, String selectedText) { filterTextField.setText(selectedText); super.selectElement(element, selectedText); } }; }
public TelemetryDisplay(InspectionGadgetsTelemetry telemetry) { tableModel = new ListTableModel<InspectionRunTime>(createColumns(), telemetry.buildList(), 0); final JTable table = new JBTable(tableModel); new TableSpeedSearch(table); scrollPane = ScrollPaneFactory.createScrollPane(table); }
private void createUIComponents() { myVariantsTable = new BuildVariantTable(); new TableSpeedSearch(myVariantsTable); myNotificationPanel = new NotificationPanel(); myNotificationPanel.setVisible(false); }