/** * Adds a root editor. * * @param rootPanel the root panel. */ public void addRootEditor(final RootEditor rootPanel) { this.rootEditors.add(rootPanel); this.tabbedPane.add(rootPanel.getEditorName(), rootPanel.getMainPanel()); rootPanel.addPropertyChangeListener("enabled", new TabEnableChangeListener()); updateRootEditorEnabled(rootPanel); if (getRootEditorCount () == 1) { setSelectedEditor(0); } else if (isGlobalMenu()) { setJMenuBar(updateGlobalMenubar()); } }
final RootEditor container = (RootEditor) this.rootEditors.get(i); if (container.isActive() && (shouldBeActive == false)) { container.setActive(false); final RootEditor container = (RootEditor) this.rootEditors.get(i); if ((container.isActive() == false) && (shouldBeActive == true)) { container.setActive(true); setJMenuBar(createEditorMenubar(container)); this.currentToolbar = container.getToolbar(); if (this.currentToolbar != null) { this.toolbarContainer.add
/** * Update handler for the enable state of the root editor. * * @param editor the editor. */ protected void updateRootEditorEnabled(final RootEditor editor) { final boolean enabled = editor.isEnabled(); for (int i = 0; i < this.tabbedPane.getTabCount(); i++) { final Component tab = this.tabbedPane.getComponentAt(i); if (tab == editor.getMainPanel()) { this.tabbedPane.setEnabledAt(i, enabled); return; } } } }
/** * Updates the global menu bar. * @return the fully initialized menu bar. */ private JMenuBar updateGlobalMenubar () { JMenuBar menuBar = getJMenuBar(); if (menuBar == null) { menuBar = new JMenuBar(); } else { menuBar.removeAll(); } addMenus(menuBar, getPrefixMenus()); for (int i = 0; i < this.rootEditors.size(); i++) { final RootEditor editor = (RootEditor) this.rootEditors.get(i); addMenus(menuBar, editor.getMenus()); } addMenus(menuBar, getPostfixMenus()); return menuBar; }
/** * Updates the global menu bar. * @return the fully initialized menu bar. */ private JMenuBar updateGlobalMenubar () { JMenuBar menuBar = getJMenuBar(); if (menuBar == null) { menuBar = new JMenuBar(); } else { menuBar.removeAll(); } addMenus(menuBar, getPrefixMenus()); for (int i = 0; i < this.rootEditors.size(); i++) { final RootEditor editor = (RootEditor) this.rootEditors.get(i); addMenus(menuBar, editor.getMenus()); } addMenus(menuBar, getPostfixMenus()); return menuBar; }
/** * Adds a root editor. * * @param rootPanel the root panel. */ public void addRootEditor(final RootEditor rootPanel) { this.rootEditors.add(rootPanel); this.tabbedPane.add(rootPanel.getEditorName(), rootPanel.getMainPanel()); rootPanel.addPropertyChangeListener("enabled", new TabEnableChangeListener()); updateRootEditorEnabled(rootPanel); if (getRootEditorCount () == 1) { setSelectedEditor(0); } else if (isGlobalMenu()) { setJMenuBar(updateGlobalMenubar()); } }
final RootEditor container = (RootEditor) this.rootEditors.get(i); if (container.isActive() && (shouldBeActive == false)) { container.setActive(false); final RootEditor container = (RootEditor) this.rootEditors.get(i); if ((container.isActive() == false) && (shouldBeActive == true)) { container.setActive(true); setJMenuBar(createEditorMenubar(container)); this.currentToolbar = container.getToolbar(); if (this.currentToolbar != null) { this.toolbarContainer.add
/** * Update handler for the enable state of the root editor. * * @param editor the editor. */ protected void updateRootEditorEnabled(final RootEditor editor) { final boolean enabled = editor.isEnabled(); for (int i = 0; i < this.tabbedPane.getTabCount(); i++) { final Component tab = this.tabbedPane.getComponentAt(i); if (tab == editor.getMainPanel()) { this.tabbedPane.setEnabledAt(i, enabled); return; } } } }
/** * Creates a menu bar. * * @param root * @return A menu bar. */ private JMenuBar createEditorMenubar(final RootEditor root) { JMenuBar menuBar = getJMenuBar(); if (menuBar == null) { menuBar = new JMenuBar(); } else { menuBar.removeAll(); } addMenus(menuBar, getPrefixMenus()); if (isGlobalMenu()) { for (int i = 0; i < this.rootEditors.size(); i++) { final RootEditor editor = (RootEditor) this.rootEditors.get(i); addMenus(menuBar, editor.getMenus()); } } else { addMenus(menuBar, root.getMenus()); } addMenus(menuBar, getPostfixMenus()); return menuBar; }
/** * Adds a root editor. * * @param rootPanel the root panel. */ public void addRootEditor(final RootEditor rootPanel) { this.rootEditors.add(rootPanel); this.tabbedPane.add(rootPanel.getEditorName(), rootPanel.getMainPanel()); rootPanel.addPropertyChangeListener("enabled", new TabEnableChangeListener()); updateRootEditorEnabled(rootPanel); if (getRootEditorCount () == 1) { setSelectedEditor(0); } else if (isGlobalMenu()) { setJMenuBar(updateGlobalMenubar()); } }
final RootEditor container = (RootEditor) this.rootEditors.get(i); if (container.isActive() && (shouldBeActive == false)) { container.setActive(false); final RootEditor container = (RootEditor) this.rootEditors.get(i); if ((container.isActive() == false) && (shouldBeActive == true)) { container.setActive(true); setJMenuBar(createEditorMenubar(container)); this.currentToolbar = container.getToolbar(); if (this.currentToolbar != null) { this.toolbarContainer.add
/** * Update handler for the enable state of the root editor. * * @param editor the editor. */ protected void updateRootEditorEnabled(final RootEditor editor) { final boolean enabled = editor.isEnabled(); for (int i = 0; i < this.tabbedPane.getTabCount(); i++) { final Component tab = this.tabbedPane.getComponentAt(i); if (tab == editor.getMainPanel()) { this.tabbedPane.setEnabledAt(i, enabled); return; } } } }
/** * Creates a menu bar. * * @param root * @return A menu bar. */ private JMenuBar createEditorMenubar(final RootEditor root) { JMenuBar menuBar = getJMenuBar(); if (menuBar == null) { menuBar = new JMenuBar(); } else { menuBar.removeAll(); } addMenus(menuBar, getPrefixMenus()); if (isGlobalMenu()) { for (int i = 0; i < this.rootEditors.size(); i++) { final RootEditor editor = (RootEditor) this.rootEditors.get(i); addMenus(menuBar, editor.getMenus()); } } else { addMenus(menuBar, root.getMenus()); } addMenus(menuBar, getPostfixMenus()); return menuBar; }
/** * Updates the global menu bar. * @return the fully initialized menu bar. */ private JMenuBar updateGlobalMenubar () { JMenuBar menuBar = getJMenuBar(); if (menuBar == null) { menuBar = new JMenuBar(); } else { menuBar.removeAll(); } addMenus(menuBar, getPrefixMenus()); for (int i = 0; i < this.rootEditors.size(); i++) { final RootEditor editor = (RootEditor) this.rootEditors.get(i); addMenus(menuBar, editor.getMenus()); } addMenus(menuBar, getPostfixMenus()); return menuBar; }
/** * Creates a menu bar. * * @param root * @return A menu bar. */ private JMenuBar createEditorMenubar(final RootEditor root) { JMenuBar menuBar = getJMenuBar(); if (menuBar == null) { menuBar = new JMenuBar(); } else { menuBar.removeAll(); } addMenus(menuBar, getPrefixMenus()); if (isGlobalMenu()) { for (int i = 0; i < this.rootEditors.size(); i++) { final RootEditor editor = (RootEditor) this.rootEditors.get(i); addMenus(menuBar, editor.getMenus()); } } else { addMenus(menuBar, root.getMenus()); } addMenus(menuBar, getPostfixMenus()); return menuBar; }