@Nullable @Override public JComponent createComponent() { ToolbarDecorator tablePanel = ToolbarDecorator.createDecorator(this.tableView, new ElementProducer<MethodParameterSetting>() { @Override public MethodParameterSetting createElement() { //IdeFocusManager.getInstance(TwigSettingsForm.this.project).requestFocus(TwigNamespaceDialog.getWindows(), true); return null; } @Override public boolean canCreateElement() { return true; } }); tablePanel.setEditAction(anActionButton -> MethodParameterReferenceSettingsForm.this.openTwigPathDialog(MethodParameterReferenceSettingsForm.this.tableView.getSelectedObject()) ); tablePanel.setAddAction(anActionButton -> MethodParameterReferenceSettingsForm.this.openTwigPathDialog(null) ); tablePanel.disableUpAction(); tablePanel.disableDownAction(); this.panelConfigTableView.add(tablePanel.createPanel()); return this.panel1; }
@Nullable @Override public JComponent createComponent() { ToolbarDecorator tablePanel = ToolbarDecorator.createDecorator(this.tableView, new ElementProducer<MethodSignatureSetting>() { @Override public MethodSignatureSetting createElement() { //IdeFocusManager.getInstance(TwigSettingsForm.this.project).requestFocus(TwigNamespaceDialog.getWindows(), true); return null; } @Override public boolean canCreateElement() { return true; } }); tablePanel.setEditAction(anActionButton -> MethodSignatureTypeSettingsForm.this.openTwigPathDialog(MethodSignatureTypeSettingsForm.this.tableView.getSelectedObject()) ); tablePanel.setAddAction(anActionButton -> MethodSignatureTypeSettingsForm.this.openTwigPathDialog(null) ); tablePanel.disableUpAction(); tablePanel.disableDownAction(); this.panelConfigTableView.add(tablePanel.createPanel()); return this.panel1; }
}); tablePanel.disableUpAction(); tablePanel.disableDownAction();
.disableUpAction() .setPreferredSize(JBUI.size(0, PerlConfigurationUtil.WIDGET_HEIGHT)) .createPanel();
public JPanel create() { tableModel = new PropertiesTableModel(); // Unfortunately TableModel's listener does not work properly, it doesn't receive events related to changed cells. final JBTable table = new JBTable(tableModel); table.getEmptyText().setText("No SonarLint properties configured for this project"); JPanel tablePanel = ToolbarDecorator.createDecorator(table) .disableUpAction() .disableDownAction() .setAddAction(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(); tablePanel.setBorder(BorderFactory.createTitledBorder("Analysis parameters")); return tablePanel; }
}) .disableDownAction() .disableUpAction() .createPanel() ).getPanel();
}) .disableDownAction() .disableUpAction() .setPreferredSize(JBUI.size(0, PerlConfigurationUtil.WIDGET_HEIGHT)) .createPanel()
}) .disableDownAction() .disableUpAction() .setPreferredSize(JBUI.size(0, PerlConfigurationUtil.WIDGET_HEIGHT)) .createPanel()