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; }
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; }
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); }
tablePanel.setEditAction(anActionButton -> TwigSettingsForm.this.openTwigPathDialog(TwigSettingsForm.this.tableView.getSelectedObject()));
@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; }
.setEditAction(e -> editServer()) .disableUpDownActions();
private void initEditAction() { decorator.setEditActionUpdater(e -> { DefaultMutableTreeNode[] selectedNodes = dataSourceTree.getSelectedNodes(DefaultMutableTreeNode.class, this::isDataSource); return selectedNodes.length == 1; }); decorator.setEditAction(anActionButton -> { PatchedDefaultMutableTreeNode[] selectedNodes = dataSourceTree.getSelectedNodes(PatchedDefaultMutableTreeNode.class, (node) -> node.getUserObject() instanceof TreeNodeModelApi); if (selectedNodes.length == 1) { PatchedDefaultMutableTreeNode treeNode = selectedNodes[0]; DataSourceApi dataSourceToEdit = getDataSourceApi(treeNode); DataSourceDialog dialog = null; if (dataSourceToEdit.getDataSourceType().equals(DataSourceType.NEO4J_BOLT)) { dialog = new Neo4jBoltDataSourceDialog(project, dataSourcesView, dataSourceToEdit); } if (dialog != null) { if (dialog.go()) { dataSourcesView.updateDataSource(treeNode, dataSourceToEdit, dialog.constructDataSource()); } } } }); }
@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; }
.setEditAction(e -> editEntry()) .setAddAction(new AddEntryAction()) .setRemoveAction(new RemoveEntryAction())
tablePanel.setEditAction(anActionButton -> { ContainerFile containerFile = ContainerSettingsForm.this.tableView.getSelectedObject(); if(containerFile != null) {
tablePanel.setEditAction(anActionButton -> { RoutingFile containerFile = RoutingSettingsForm.this.tableView.getSelectedObject(); if(containerFile == null) {
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)); }
.setEditAction(button -> doEdit()) .addExtraActions((AnActionButton) new ToolbarDecorator.ElementActionButton( ActionsBundle.message("action.EditorCopy.text"), AllIcons.Actions.Copy) {