public void initializePopup() { if (popupMenu == null) { if (popupMenu == null) { popupMenu = new WorkspacePopupMenu(); WorkspacePopupMenuBuilder.addActions( popupMenu, new String[] { WorkspacePopupMenuBuilder.createSubMenu( TextUtils.getRawText("workspace.action.new.label")), "workspace.action.node.new.folder", "workspace.action.file.new.mindmap", WorkspacePopupMenuBuilder.endSubMenu(), WorkspacePopupMenuBuilder.SEPARATOR, "workspace.action.node.open.location", WorkspacePopupMenuBuilder.SEPARATOR, "workspace.action.node.cut", "workspace.action.node.copy", "workspace.action.node.paste", WorkspacePopupMenuBuilder.SEPARATOR, "workspace.action.node.rename", "workspace.action.node.remove", "workspace.action.file.delete", WorkspacePopupMenuBuilder.SEPARATOR, "workspace.action.node.physical.sort", WorkspacePopupMenuBuilder.SEPARATOR, "workspace.action.node.refresh" }); } } }
public void initializePopup() { if (popupMenu == null) { Controller controller = Controller.getCurrentController(); controller.addAction(new DocearProjectEnableMonitoringAction()); popupMenu = new WorkspacePopupMenu(); WorkspacePopupMenuBuilder.addActions( popupMenu, new String[] { WorkspacePopupMenuBuilder.createSubMenu( TextUtils.getRawText("workspace.action.new.label")), "workspace.action.node.new.folder", "workspace.action.file.new.mindmap", // WorkspacePopupMenuBuilder.SEPARATOR, // "workspace.action.file.new.file", WorkspacePopupMenuBuilder.endSubMenu(), WorkspacePopupMenuBuilder.SEPARATOR, "workspace.action.docear.uri.change", "workspace.action.node.open.location", WorkspacePopupMenuBuilder.SEPARATOR, "workspace.action.node.cut", "workspace.action.node.copy", "workspace.action.node.paste", WorkspacePopupMenuBuilder.SEPARATOR, "workspace.action.node.rename", "workspace.action.node.remove", "workspace.action.file.delete", WorkspacePopupMenuBuilder.SEPARATOR, "workspace.action.node.physical.sort", WorkspacePopupMenuBuilder.SEPARATOR, // "workspace.action.docear.project.enable.monitoring", "workspace.action.node.refresh" }); } }
public void buildPanel(final DefaultMutableTreeNode controlsTree) { final FormLayout leftLayout = new FormLayout("max(80dlu;p):grow", ""); final DefaultFormBuilder leftBuilder = new DefaultFormBuilder(leftLayout); final CardLayout cardLayout = new VariableSizeCardLayout(); final JPanel rightStack = new JPanel(cardLayout); FormLayout rightLayout = null; DefaultFormBuilder rightBuilder = null; String lastTabName = null; initControls(controlsTree); final Iterator<IPropertyControl> iterator = controls.iterator(); // MaG: Controller.getCurrentController() .getOptionPanelController() .setCurrentPropertyControls(controls); while (iterator.hasNext()) { final IPropertyControl control = iterator.next(); if (control instanceof TabProperty) { final TabProperty newTab = (TabProperty) control; if (rightBuilder != null) { rightStack.add(rightBuilder.getPanel(), lastTabName); } rightLayout = new FormLayout(newTab.getDescription(), ""); rightBuilder = new DefaultFormBuilder(rightLayout); rightBuilder.setDefaultDialogBorder(); lastTabName = newTab.getLabel(); final JButton tabButton = new JButton(TextUtils.getOptionalText(lastTabName)); final ChangeTabAction changeTabAction = new ChangeTabAction(cardLayout, rightStack, lastTabName); tabButton.addActionListener(changeTabAction); registerTabButton(tabButton, lastTabName, changeTabAction); leftBuilder.append(tabButton); } else { control.layout(rightBuilder); } } rightStack.add(rightBuilder.getPanel(), lastTabName); if (selectedPanel != null && tabActionMap.containsKey(selectedPanel)) { (tabActionMap.get(selectedPanel)).actionPerformed(null); } final JScrollPane rightComponent = new JScrollPane(rightStack); UITools.setScrollbarIncrement(rightComponent); final JSplitPane centralPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftBuilder.getPanel(), rightComponent); topDialog.getContentPane().add(centralPanel, BorderLayout.CENTER); final JButton cancelButton = new JButton(); MenuBuilder.setLabelAndMnemonic(cancelButton, TextUtils.getRawText("cancel")); cancelButton.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent arg0) { closeWindow(); } }); final JButton okButton = new JButton(); MenuBuilder.setLabelAndMnemonic(okButton, TextUtils.getRawText("ok")); okButton.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent arg0) { if (validate()) { closeWindow(); feedback.writeProperties(getOptionProperties()); } } }); topDialog.getRootPane().setDefaultButton(okButton); topDialog .getContentPane() .add(ButtonBarFactory.buildOKCancelBar(cancelButton, okButton), BorderLayout.SOUTH); }
private static String getText(String key, Object... parameters) { if (parameters.length == 0) return TextUtils.getRawText(getResourceKey(key)); else return TextUtils.format(getResourceKey(key), parameters); }