@Nullable @Override public JComponent createComponent() { FormBuilder builder = FormBuilder.createFormBuilder(); myCbShowImportPopup = new JCheckBox(ApplicationBundle.message("checkbox.show.import.popup")); myCbAddUnambiguousImports = new JCheckBox(ApplicationBundle.message("checkbox.add.unambiguous.imports.on.the.fly")); builder.addComponent(myCbShowImportPopup); builder.addComponent(myCbAddUnambiguousImports); myExcludePackagesList = new JBList(); JComponent excludedPanel = new JPanel(new BorderLayout()); excludedPanel.add(ToolbarDecorator.createDecorator(myExcludePackagesList) .setAddAction(new AddImportExclusionAction()).disableUpDownActions().createPanel(), BorderLayout.CENTER); excludedPanel.setBorder(IdeBorderFactory.createTitledBorder(ApplicationBundle.message("exclude.from.completion.group"), true)); if (!myIsDefaultProject) { builder.addComponent(excludedPanel); } JPanel result = new JPanel(new BorderLayout()); result.add(builder.getPanel(), BorderLayout.NORTH); if (myIsDialog) result.setPreferredSize(new Dimension(300, -1)); return result; }
.setAddAction(button -> { FileChooserDialog fileChooser = FileChooserFactory.getInstance() .createFileChooser(createMultipleFoldersDescriptor(), null, filesList);
ToolbarDecorator.createDecorator(filesList).setAddAction(button -> { FileChooserDialog fileChooser = FileChooserFactory.getInstance() .createFileChooser(createMultipleFoldersDescriptor(), null, filesList);
private JPanel buildClassPathPanel() { final ToolbarDecorator pathListDecorator = ToolbarDecorator.createDecorator(pathList); pathListDecorator.setAddAction(new AddPathAction()); pathListDecorator.setEditAction(new EditPathAction()); pathListDecorator.setRemoveAction(new RemovePathAction()); pathListDecorator.setMoveUpAction(new MoveUpPathAction()); pathListDecorator.setMoveDownAction(new MoveDownPathAction()); pathListDecorator.setPreferredSize(DECORATOR_DIMENSIONS); final JPanel container = new JPanel(new BorderLayout()); container.add(new TitledSeparator(CheckStyleBundle.message("config.path.tab")), BorderLayout.NORTH); container.add(pathListDecorator.createPanel(), BorderLayout.CENTER); return container; }
@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; }
private JPanel buildRuleFilePanel() { setColumnWith(locationTable, 0, ACTIVE_COL_MIN_WIDTH, ACTIVE_COL_MAX_WIDTH, ACTIVE_COL_MAX_WIDTH); setColumnWith(locationTable, 1, DESC_COL_MIN_WIDTH, DESC_COL_MAX_WIDTH, DESC_COL_MAX_WIDTH); locationTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); locationTable.setStriped(true); locationTable.getTableHeader().setReorderingAllowed(false); final ToolbarDecorator tableDecorator = ToolbarDecorator.createDecorator(locationTable); tableDecorator.setAddAction(new AddLocationAction()); tableDecorator.setEditAction(new EditPropertiesAction()); tableDecorator.setRemoveAction(new RemoveLocationAction()); tableDecorator.setEditActionUpdater(new DisableForDefaultUpdater()); tableDecorator.setRemoveActionUpdater(new DisableForDefaultUpdater()); tableDecorator.setPreferredSize(DECORATOR_DIMENSIONS); final JPanel container = new JPanel(new BorderLayout()); container.add(new TitledSeparator(CheckStyleBundle.message("config.file.tab")), BorderLayout.NORTH); container.add(tableDecorator.createPanel(), BorderLayout.CENTER); final JLabel infoLabel = new JLabel(CheckStyleBundle.message("config.file.description"), Icons.icon("/general/information.png"), SwingConstants.LEFT); infoLabel.setBorder(JBUI.Borders.empty(8, 0, 4, 0)); container.add(infoLabel, BorderLayout.SOUTH); return container; }
tablePanel.setAddAction(anActionButton -> { String uri = UiSettingsUtil.getPathDialog(project, StdFileTypes.XML); if(uri != null) {
}); tablePanel.setAddAction(anActionButton -> { String uri = UiSettingsUtil.getPathDialog(project, PhpFileType.INSTANCE); if(uri == null) {
tablePanel.setAddAction(anActionButton -> TwigSettingsForm.this.openTwigPathDialog(null));
private JComponent createJComponent() { JPanel panelForTable = ToolbarDecorator.createDecorator(mySonarResourcesTable, null). setAddAction( addAction() ). setRemoveAction( anActionButton -> TableUtil.removeSelectedItems(mySonarResourcesTable) ) .disableUpDownActions() .createPanel(); panelForTable.setPreferredSize(new Dimension(-1, 100)); return panelForTable; }
public EditableList(String emptyLabel, Supplier<T> onAdd, Function<T, T> onEdit) { this.onAdd = onAdd; this.onEdit = onEdit; list = new JBList(); list.getEmptyText().setText(emptyLabel); list.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent evt) { if (evt.getClickCount() == 2) { editEntry(); } } }); model = new CollectionListModel<>(new ArrayList<>()); list.setModel(model); ToolbarDecorator toolbarDecorator = ToolbarDecorator.createDecorator(list) .setEditActionName("Edit") .setEditAction(e -> editEntry()) .setAddAction(new AddEntryAction()) .setRemoveAction(new RemoveEntryAction()) .disableUpDownActions(); listPanel = new JPanel(new BorderLayout()); listPanel.add(toolbarDecorator.createPanel(), BorderLayout.CENTER); }
private void initAddAction() { decorator.setAddAction(anActionButton -> { ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup( "New Data Source", new NewDataSourceActionGroup(project, dataSourcesView), anActionButton.getDataContext(), JBPopupFactory.ActionSelectionAid.NUMBERING, true ); popup.show(anActionButton.getPreferredPopupPoint()); }); }
.setAddAction(anActionButton -> { myTableView.stopEditing(); parameters.add(new MethodConfig.Parameter("*", false));
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; }
protected void createAutobaseNamesComponent(FormBuilder builder) { autobaseModel = new CollectionListModel<>(); autobaseList = new JBList<>(autobaseModel); builder.addLabeledComponent( new JLabel("Autobase names (autobase_names option. Order is important, later components may be inherited from early):"), ToolbarDecorator .createDecorator(autobaseList) .setAddAction(anActionButton -> { String fileName = Messages.showInputDialog( myProject, "Type new Autobase filename:", "New Autobase Filename", Messages.getQuestionIcon(), "", null); if (StringUtil.isNotEmpty(fileName) && !autobaseModel.getItems().contains(fileName)) { autobaseModel.add(fileName); } }) .setPreferredSize(JBUI.size(0, PerlConfigurationUtil.WIDGET_HEIGHT)) .createPanel()); } }
FileMaskPanel(Set<String> patterns, String textEmpty, String textTitle, String textAddMessage, String textAddTitle, String textEditMessage, String textEditTitle) { this.textAddMessage = textAddMessage; this.textAddTitle = textAddTitle; this.textEditMessage = textEditMessage; this.textEditTitle = textEditTitle; patternList = new JBList<>(patternModels); patternList.setEmptyText(textEmpty); patternPanel = ToolbarDecorator.createDecorator(patternList) .setAddAction(getAddActionButtonRunnable(patterns)) .setRemoveAction(getRemoveActionButtonRunnable(patterns)) .setEditAction(getEditActionButtonRunnable(patterns)) .disableUpDownActions() .createPanel(); patternPanel.setBorder(IdeBorderFactory.createTitledBorder(textTitle)); }
.addComponent(textPane) .addComponent( ToolbarDecorator.createDecorator(this).setAddAction(action -> { final TableCellEditor cellEditor = getCellEditor(); if (cellEditor != null) {
private JComponent createCheckboxTreeView(ConfigCheckboxTree tree, List<MethodConfig> configs) { ToolbarDecorator decorator = ToolbarDecorator.createDecorator(tree); decorator.setToolbarPosition(ActionToolbarPosition.RIGHT); decorator.setAddAction(new AddNodeActionButton(tree, tempConfiguration, project)); decorator.setRemoveAction(new RemoveNodeActionButton(tree)); decorator.addExtraAction(AnActionButton.fromAction(new CopyAction(tree))); JPanel panel = decorator.createPanel(); tree.initTree(configs); initValidation(); return panel; }
.setAddAction(anActionButton -> { final TableCellEditor cellEditor = globalsTable.getCellEditor(); if (cellEditor != null) {