JHotDraw 7rev733

org.jhotdraw.app
Class DefaultMenuBuilder

java.lang.Object
  extended by org.jhotdraw.app.DefaultMenuBuilder
All Implemented Interfaces:
MenuBuilder

public class DefaultMenuBuilder
extends java.lang.Object
implements MenuBuilder

DefaultMenuBuilder.

Version:
1.0 2010-11-14 Created.
Author:
Werner Randelshofer

Field Summary
 boolean suppressIcons
          Whether icons in menu items shall be removed.
 
Constructor Summary
DefaultMenuBuilder()
           
 
Method Summary
protected  javax.swing.JMenuItem add(javax.swing.JMenu m, javax.swing.Action a)
          Adds an action to a menu.
 void addAboutItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: AboutAction
 void addClearFileItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: ClearFileAction
 void addClipboardItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: CutAction CopyAction PasteAction DuplicateAction DeleteAction
 void addCloseFileItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: CloseFileAction
 void addExitItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: ExitAction
 void addExportFileItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: ExportFileAction
 void addFindItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: AbstractFindAction
 void addHelpItems(javax.swing.JMenu m, Application app, View v)
          Does nothing.
 void addLoadFileItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: LoadFileAction LoadDirectoryAction
 void addNewFileItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: NewFileAction
 void addNewWindowItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: NewWindowAction
 void addOpenFileItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: OpenFileAction OpenDirectoryAction
 void addOtherEditItems(javax.swing.JMenu m, Application app, View v)
          Does nothing.
 void addOtherFileItems(javax.swing.JMenu m, Application app, View v)
          Does nothing.
 void addOtherMenus(java.util.List<javax.swing.JMenu> m, Application app, View v)
          Does nothing.
 void addOtherViewItems(javax.swing.JMenu m, Application app, View v)
          Does nothing.
 void addOtherWindowItems(javax.swing.JMenu m, Application app, View v)
          Does nothing.
 void addPreferencesItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: AbstractPreferencesAction
 void addPrintFileItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: PrintFileAction
 void addSaveFileItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: SaveFileAction SaveFileAsAction
 void addSelectionItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: SelectAllAction ClearSelectionAction
 void addUndoItems(javax.swing.JMenu m, Application app, View v)
          Adds items for the following actions to the menu: UndoAction RedoAction
 boolean isSuppressIcons()
           
 void setSuppressIcons(boolean suppressIcons)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

suppressIcons

public boolean suppressIcons
Whether icons in menu items shall be removed.

Constructor Detail

DefaultMenuBuilder

public DefaultMenuBuilder()
Method Detail

addPreferencesItems

public void addPreferencesItems(javax.swing.JMenu m,
                                Application app,
                                @Nullable
                                View v)
Adds items for the following actions to the menu:

Specified by:
addPreferencesItems in interface MenuBuilder
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

public void addExitItems(javax.swing.JMenu m,
                         Application app,
                         @Nullable
                         View v)
Adds items for the following actions to the menu:

Specified by:
addExitItems in interface MenuBuilder
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

public void addClearFileItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
Adds items for the following actions to the menu:

Specified by:
addClearFileItems in interface MenuBuilder
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

public void addNewWindowItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
Adds items for the following actions to the menu:

Specified by:
addNewWindowItems in interface MenuBuilder
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

public void addNewFileItems(javax.swing.JMenu m,
                            Application app,
                            @Nullable
                            View v)
Adds items for the following actions to the menu:

Specified by:
addNewFileItems in interface MenuBuilder
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

public void addLoadFileItems(javax.swing.JMenu m,
                             Application app,
                             @Nullable
                             View v)
Adds items for the following actions to the menu:

Specified by:
addLoadFileItems in interface MenuBuilder
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

public void addOpenFileItems(javax.swing.JMenu m,
                             Application app,
                             @Nullable
                             View v)
Adds items for the following actions to the menu:

Specified by:
addOpenFileItems in interface MenuBuilder
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

public void addCloseFileItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
Adds items for the following actions to the menu:

Specified by:
addCloseFileItems in interface MenuBuilder
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

public void addSaveFileItems(javax.swing.JMenu m,
                             Application app,
                             @Nullable
                             View v)
Adds items for the following actions to the menu:

Specified by:
addSaveFileItems in interface MenuBuilder
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

public void addExportFileItems(javax.swing.JMenu m,
                               Application app,
                               @Nullable
                               View v)
Adds items for the following actions to the menu:

Specified by:
addExportFileItems in interface MenuBuilder
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

public void addPrintFileItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
Adds items for the following actions to the menu:

Specified by:
addPrintFileItems in interface MenuBuilder
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

public void addOtherFileItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
Does nothing.

Specified by:
addOtherFileItems in interface MenuBuilder
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

public void addUndoItems(javax.swing.JMenu m,
                         Application app,
                         @Nullable
                         View v)
Adds items for the following actions to the menu:

Specified by:
addUndoItems in interface MenuBuilder
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

public void addClipboardItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
Adds items for the following actions to the menu:

Specified by:
addClipboardItems in interface MenuBuilder
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

public void addSelectionItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
Adds items for the following actions to the menu:

Specified by:
addSelectionItems in interface MenuBuilder
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

public void addFindItems(javax.swing.JMenu m,
                         Application app,
                         @Nullable
                         View v)
Adds items for the following actions to the menu:

Specified by:
addFindItems in interface MenuBuilder
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

public void addOtherEditItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
Does nothing.

Specified by:
addOtherEditItems in interface MenuBuilder
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

public void addOtherViewItems(javax.swing.JMenu m,
                              Application app,
                              @Nullable
                              View v)
Does nothing.

Specified by:
addOtherViewItems in interface MenuBuilder
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

public void addOtherMenus(java.util.List<javax.swing.JMenu> m,
                          Application app,
                          @Nullable
                          View v)
Does nothing.

Specified by:
addOtherMenus in interface MenuBuilder
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

public void addOtherWindowItems(javax.swing.JMenu m,
                                Application app,
                                @Nullable
                                View v)
Does nothing.

Specified by:
addOtherWindowItems in interface MenuBuilder
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

public void addHelpItems(javax.swing.JMenu m,
                         Application app,
                         @Nullable
                         View v)
Does nothing.

Specified by:
addHelpItems in interface MenuBuilder
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

public void addAboutItems(javax.swing.JMenu m,
                          Application app,
                          @Nullable
                          View v)
Adds items for the following actions to the menu:

Specified by:
addAboutItems in interface MenuBuilder
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.

isSuppressIcons

public boolean isSuppressIcons()

setSuppressIcons

public void setSuppressIcons(boolean suppressIcons)

add

protected javax.swing.JMenuItem add(javax.swing.JMenu m,
                                    javax.swing.Action a)
Adds an action to a menu. Returns the menu item that was added. This method is invoked for each action that is added to a menu. Override this method to customize the menu item that is being created.


Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.