Class AbstractTabbedUI

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public abstract class AbstractTabbedUI extends JComponent
A tabbed GUI. All views on the data are contained in tabs.
See Also:
  • Field Details

    • JMENUBAR_PROPERTY

      public static final String JMENUBAR_PROPERTY
      The menu bar property key.
      See Also:
    • rootEditors

      private ArrayList rootEditors
      The list of root editors. One for each tab.
    • tabbedPane

      private JTabbedPane tabbedPane
      The tabbed pane filling the content area.
    • selectedRootEditor

      private int selectedRootEditor
      The index of the currently selected root editor.
    • currentToolbar

      private JComponent currentToolbar
      The current toolbar.
    • toolbarContainer

      private JPanel toolbarContainer
      The container component for the toolbar.
    • closeAction

      private Action closeAction
      The close action assigned to this UI.
    • jMenuBar

      private JMenuBar jMenuBar
      The current menu bar.
  • Constructor Details

    • AbstractTabbedUI

      public AbstractTabbedUI()
      Default constructor.
  • Method Details

    • getTabbedPane

      protected JTabbedPane getTabbedPane()
      Returns the tabbed pane.
      Returns:
      The tabbed pane.
    • isGlobalMenu

      public boolean isGlobalMenu()
      Defines whether to use a global unified menu bar, which contains all menus from all tab-panes or whether to use local menubars.

      From an usability point of view, global menubars should be preferred, as this way users always see which menus are possibly available and do not wonder where the menus are disappearing.

      Returns:
      true, if global menus should be used, false otherwise.
    • setGlobalMenu

      public void setGlobalMenu(boolean globalMenu)
      Sets the global menu flag.
      Parameters:
      globalMenu - the flag.
    • getJMenuBar

      public JMenuBar getJMenuBar()
      Returns the menu bar.
      Returns:
      The menu bar.
    • setJMenuBar

      protected void setJMenuBar(JMenuBar menuBar)
      Sets the menu bar.
      Parameters:
      menuBar - the menu bar.
    • createCloseAction

      protected Action createCloseAction()
      Creates a close action.
      Returns:
      A close action.
    • getCloseAction

      public Action getCloseAction()
      Returns the close action.
      Returns:
      The close action.
    • getPrefixMenus

      protected abstract JMenu[] getPrefixMenus()
      Returns the prefix menus.
      Returns:
      The prefix menus.
    • getPostfixMenus

      protected abstract JMenu[] getPostfixMenus()
      The postfix menus.
      Returns:
      The postfix menus.
    • addMenus

      private void addMenus(JMenuBar menuBar, JMenu[] customMenus)
      Adds menus.
      Parameters:
      menuBar - the menu bar
      customMenus - the menus that should be added.
    • updateGlobalMenubar

      private JMenuBar updateGlobalMenubar()
      Updates the global menu bar.
      Returns:
      the fully initialized menu bar.
    • createEditorMenubar

      private JMenuBar createEditorMenubar(RootEditor root)
      Creates a menu bar.
      Parameters:
      root -
      Returns:
      A menu bar.
    • addRootEditor

      public void addRootEditor(RootEditor rootPanel)
      Adds a root editor.
      Parameters:
      rootPanel - the root panel.
    • getRootEditorCount

      public int getRootEditorCount()
      Returns the number of root editors.
      Returns:
      The count.
    • getRootEditor

      public RootEditor getRootEditor(int pos)
      Returns the specified editor.
      Parameters:
      pos - the position index.
      Returns:
      The editor at the given position.
    • getSelectedEditor

      public int getSelectedEditor()
      Returns the selected editor.
      Returns:
      The selected editor.
    • setSelectedEditor

      public void setSelectedEditor(int selectedEditor)
      Sets the selected editor.
      Parameters:
      selectedEditor - the selected editor.
    • closeToolbar

      private void closeToolbar()
      Closes the toolbar.
    • attempExit

      protected abstract void attempExit()
      Attempts to exit.
    • updateRootEditorEnabled

      protected void updateRootEditorEnabled(RootEditor editor)
      Update handler for the enable state of the root editor.
      Parameters:
      editor - the editor.