/** * Default constructor. */ public AbstractTabbedUI() { this.selectedRootEditor = -1; this.toolbarContainer = new JPanel(); this.toolbarContainer.setLayout(new BorderLayout()); this.tabbedPane = new JTabbedPane(SwingConstants.BOTTOM); this.tabbedPane.addChangeListener(new TabChangeHandler(this.tabbedPane)); this.rootEditors = new ArrayList(); setLayout(new BorderLayout()); add(this.toolbarContainer, BorderLayout.NORTH); add(this.tabbedPane, BorderLayout.CENTER); this.closeAction = createCloseAction(); }
/** * 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; }
/** * Invoked when an action occurs. * * @param e the event. */ public void actionPerformed(final ActionEvent e) { attempExit(); }
/** * Sets the global menu flag. * * @param globalMenu the flag. */ public void setGlobalMenu(final boolean globalMenu) { this.globalMenu = globalMenu; if (isGlobalMenu()) { setJMenuBar(updateGlobalMenubar()); } else { if (getRootEditorCount () > 0) { setJMenuBar(createEditorMenubar(getRootEditor(getSelectedEditor()))); } } }
closeToolbar(); this.toolbarContainer.removeAll(); this.currentToolbar = null; if ((container.isActive() == false) && (shouldBeActive == true)) { container.setActive(true); setJMenuBar(createEditorMenubar(container)); this.currentToolbar = container.getToolbar(); if (this.currentToolbar != null) { this.getJMenuBar().repaint();
/** * Initialises the applet. * * @param tabbedUI the UI that controls the applet. */ public void init(final AbstractTabbedUI tabbedUI) { this.tabbedUI = tabbedUI; this.tabbedUI.addPropertyChangeListener (AbstractTabbedUI.JMENUBAR_PROPERTY, new MenuBarChangeListener()); final JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(tabbedUI, BorderLayout.CENTER); setContentPane(panel); setJMenuBar(tabbedUI.getJMenuBar()); }
/** * This method gets called when a bound property is changed. * * @param evt A PropertyChangeEvent object describing the event source * and the property that has changed. */ public void propertyChange(final PropertyChangeEvent evt) { if (evt.getPropertyName().equals(AbstractTabbedUI.JMENUBAR_PROPERTY)) { setJMenuBar(getTabbedUI().getJMenuBar()); } } }
public void windowClosing(final WindowEvent e) { getTabbedUI().getCloseAction().actionPerformed (new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null, 0)); } });
/** * Sets the menu bar. * * @param menuBar the menu bar. */ protected void setJMenuBar(final JMenuBar menuBar) { final JMenuBar oldMenuBar = this.jMenuBar; this.jMenuBar = menuBar; firePropertyChange(JMENUBAR_PROPERTY, oldMenuBar, menuBar); }
/** * Sets the global menu flag. * * @param globalMenu the flag. */ public void setGlobalMenu(final boolean globalMenu) { this.globalMenu = globalMenu; if (isGlobalMenu()) { setJMenuBar(updateGlobalMenubar()); } else { if (getRootEditorCount () > 0) { setJMenuBar(createEditorMenubar(getRootEditor(getSelectedEditor()))); } } }
closeToolbar(); this.toolbarContainer.removeAll(); this.currentToolbar = null; if ((container.isActive() == false) && (shouldBeActive == true)) { container.setActive(true); setJMenuBar(createEditorMenubar(container)); this.currentToolbar = container.getToolbar(); if (this.currentToolbar != null) { this.getJMenuBar().repaint();
/** * Initialises the applet. * * @param tabbedUI the UI that controls the applet. */ public void init(final AbstractTabbedUI tabbedUI) { this.tabbedUI = tabbedUI; this.tabbedUI.addPropertyChangeListener (AbstractTabbedUI.JMENUBAR_PROPERTY, new MenuBarChangeListener()); final JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(tabbedUI, BorderLayout.CENTER); setContentPane(panel); setJMenuBar(tabbedUI.getJMenuBar()); }
/** * This method gets called when a bound property is changed. * * @param evt A PropertyChangeEvent object describing the event source * and the property that has changed. */ public void propertyChange(final PropertyChangeEvent evt) { if (evt.getPropertyName().equals(AbstractTabbedUI.JMENUBAR_PROPERTY)) { setJMenuBar(getTabbedUI().getJMenuBar()); } } }
public void windowClosing(final WindowEvent e) { getTabbedUI().getCloseAction().actionPerformed (new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null, 0)); } });
/** * Sets the menu bar. * * @param menuBar the menu bar. */ protected void setJMenuBar(final JMenuBar menuBar) { final JMenuBar oldMenuBar = this.jMenuBar; this.jMenuBar = menuBar; firePropertyChange(JMENUBAR_PROPERTY, oldMenuBar, 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; }
/** * Sets the global menu flag. * * @param globalMenu the flag. */ public void setGlobalMenu(final boolean globalMenu) { this.globalMenu = globalMenu; if (isGlobalMenu()) { setJMenuBar(updateGlobalMenubar()); } else { if (getRootEditorCount () > 0) { setJMenuBar(createEditorMenubar(getRootEditor(getSelectedEditor()))); } } }
closeToolbar(); this.toolbarContainer.removeAll(); this.currentToolbar = null; if ((container.isActive() == false) && (shouldBeActive == true)) { container.setActive(true); setJMenuBar(createEditorMenubar(container)); this.currentToolbar = container.getToolbar(); if (this.currentToolbar != null) { this.getJMenuBar().repaint();
/** * Initialises the applet. * * @param tabbedUI the UI that controls the applet. */ public void init(final AbstractTabbedUI tabbedUI) { this.tabbedUI = tabbedUI; this.tabbedUI.addPropertyChangeListener (AbstractTabbedUI.JMENUBAR_PROPERTY, new MenuBarChangeListener()); final JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(tabbedUI, BorderLayout.CENTER); setContentPane(panel); setJMenuBar(tabbedUI.getJMenuBar()); }
/** * Default constructor. */ public AbstractTabbedUI() { this.selectedRootEditor = -1; this.toolbarContainer = new JPanel(); this.toolbarContainer.setLayout(new BorderLayout()); this.tabbedPane = new JTabbedPane(SwingConstants.BOTTOM); this.tabbedPane.addChangeListener(new TabChangeHandler(this.tabbedPane)); this.rootEditors = new ArrayList(); setLayout(new BorderLayout()); add(this.toolbarContainer, BorderLayout.NORTH); add(this.tabbedPane, BorderLayout.CENTER); this.closeAction = createCloseAction(); }