Documentation of 'org.jhotdraw.app.MenuBuilder' Java class
MenuBuilder
org.jhotdraw.app

Interface MenuBuilder

  • All Known Implementing Classes:
    DefaultMenuBuilder, EmptyMenuBuilder


    public interface MenuBuilder
    MenuBuilder is used by Application to build to build its menu bar(s) and popup menu(s).

    Each method adds a logical group of menu items to a menu provided by the Application.

    Implementors of this interface typically use actions retrieved from the application to build the menu items. See DefaultMenuBuilder for a typical implementation.

    Menus may be associated to a specific view or to all views (global) of the application. In the former case the corresponding view is provided, in the latter case null is passed. Note that some applications, specifically OSXApplication, need to create both kinds of menus.

    During the lifetime of an application many menus may be created and destroyed. Implementors must take care that menu items can be garbage collected.


    Design Patterns

    Abstract Factory
    MenuBuilder is used by Application for creating menu items. The MenuBuilder is provided by ApplicationModel. Abstract Factory: MenuBuilder
    Client: Application.


    • Method Detail

      • addPreferencesItems

        void addPreferencesItems(javax.swing.JMenu m,
                                 Application app,
                                 @Nullable
                                 View v)
        Optionally adds one or more "Preferences" items to a menu.

        Most applications use this method for adding items to the last section of the "Edit" menu.

        Note that OSXApplication does not invoke this method and instead retrieves an action with ID AbstractPreferencesAction.ID from the action map of the ApplicationModel and adds it to the "Application" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addExitItems

        void addExitItems(javax.swing.JMenu m,
                          Application app,
                          @Nullable
                          View v)
        Optionally adds one or more "Exit" items to a menu.

        Most applications use this method for adding items to the last section of the "File" menu.

        Note that OSXApplication does not invoke this method and instead retrieves an action with ID ExitAction.ID from the action map of the ApplicationModel and adds it to the "Application" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addClearFileItems

        void addClearFileItems(javax.swing.JMenu m,
                               Application app,
                               @Nullable
                               View v)
        Optionally adds one or more "Clear File" items to a menu.

        Most applications use this method for adding items to the first section of the "File" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addNewWindowItems

        void addNewWindowItems(javax.swing.JMenu m,
                               Application app,
                               @Nullable
                               View v)
        Optionally adds one or more "New Window" items to a menu.

        Most applications use this method for adding items to the first section of the "File" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addNewFileItems

        void addNewFileItems(javax.swing.JMenu m,
                             Application app,
                             @Nullable
                             View v)
        Optionally adds one or more "New File" items to a menu.

        Most applications use this method for adding items to the first section of the "File" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addLoadFileItems

        void addLoadFileItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
        Optionally adds one or more "Load file" items to a menu.

        Most applications use this method for adding items to the first section of the "File" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addOpenFileItems

        void addOpenFileItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
        Optionally adds one or more "Open File" items to a menu.

        Most applications use this method for adding items to the first section of the "File" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addCloseFileItems

        void addCloseFileItems(javax.swing.JMenu m,
                               Application app,
                               @Nullable
                               View v)
        Optionally adds one or more "Close File" items to a menu.

        Most applications use this method for adding items to the second section of the "File" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addSaveFileItems

        void addSaveFileItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
        Optionally adds one or more "Save File" items to a menu.

        Most applications use this method for adding items to the second section of the "File" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addExportFileItems

        void addExportFileItems(javax.swing.JMenu m,
                                Application app,
                                @Nullable
                                View v)
        Optionally adds one or more "Export File" items to a menu.

        Most applications use this method for adding items to the second section of the "File" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addPrintFileItems

        void addPrintFileItems(javax.swing.JMenu m,
                               Application app,
                               @Nullable
                               View v)
        Optionally adds one or more "Print File" items to a menu.

        Most applications use this method for adding items to the third section of the "File" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addOtherFileItems

        void addOtherFileItems(javax.swing.JMenu m,
                               Application app,
                               @Nullable
                               View v)
        Optionally adds one or more file related items to a menu.

        Most applications use this method for adding items to the third section of the "File" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addUndoItems

        void addUndoItems(javax.swing.JMenu m,
                          Application app,
                          @Nullable
                          View v)
        Optionally adds one or more "Undo" items to a menu.

        Most applications use this method for adding items to the first section of the "Edit" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addClipboardItems

        void addClipboardItems(javax.swing.JMenu m,
                               Application app,
                               @Nullable
                               View v)
        Optionally adds one or more "Clipboard" items to a menu.

        Most applications use this method for adding items to the second section of the "Edit" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addSelectionItems

        void addSelectionItems(javax.swing.JMenu m,
                               Application app,
                               @Nullable
                               View v)
        Optionally adds one or more "Selection" items to a menu.

        Most applications use this method for adding items to the third section of the "Edit" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addFindItems

        void addFindItems(javax.swing.JMenu m,
                          Application app,
                          @Nullable
                          View v)
        Optionally adds one or more "Find" items to a menu.

        Most applications use this method for adding items to the fourth section of the "Edit" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addOtherEditItems

        void addOtherEditItems(javax.swing.JMenu m,
                               Application app,
                               @Nullable
                               View v)
        Optionally adds one or more editing related items to a menu.

        Most applications use this method for adding items to the fifth section of the "Edit" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addOtherViewItems

        void addOtherViewItems(javax.swing.JMenu m,
                               Application app,
                               @Nullable
                               View v)
        Optionally adds one or more view related items to a menu.

        Most applications use this method for adding items to the first section of the "View" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addOtherMenus

        void addOtherMenus(java.util.List<javax.swing.JMenu> m,
                           Application app,
                           @Nullable
                           View v)
        Optionally adds one or more additional menus to a menu bar or a pop up menu.

        Most applications add additional menus between the "View" menu and the "Window" menu to the menu bar.

        Parameters:
        m - A (potentially non-empty) list of menus.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addOtherWindowItems

        void addOtherWindowItems(javax.swing.JMenu m,
                                 Application app,
                                 @Nullable
                                 View v)
        Optionally adds one or more window related items to a menu.

        Most applications use this method for adding items to the second section of the "Window" menu. (The first section usually contains application specific items). Some applications, such as SDIApplication add these items to the "View" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addHelpItems

        void addHelpItems(javax.swing.JMenu m,
                          Application app,
                          @Nullable
                          View v)
        Optionally adds one or more "Help" items to a menu.

        Most applications use this method for adding items to the first section of the "Help" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.
      • addAboutItems

        void addAboutItems(javax.swing.JMenu m,
                           Application app,
                           @Nullable
                           View v)
        Optionally adds one or more "About" items to a menu.

        Most applications use this method for adding items to the last section of the "Help" menu.

        Note that OSXApplication does not invoke this method and instead retrieves an action with ID AboutAction.ID from the action map of the ApplicationModel and adds it to the "Application" menu.

        Parameters:
        m - A (potentially non-empty) menu.
        app - The Application for which the menu is built.
        v - A view the menu is used exclusively for a specific view, null if the menu is shared by all views.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.