com.javadocking.dockable.action
Class DefaultPopupMenuFactory

java.lang.Object
  extended by com.javadocking.dockable.action.DefaultPopupMenuFactory
All Implemented Interfaces:
PopupMenuFactory

public class DefaultPopupMenuFactory
extends java.lang.Object
implements PopupMenuFactory

This is the default popup menu factory.

If a selected dockable is given, a menu item is created for every action of the matrix that is retrieved by Dockable.getActions(). The actions of a row are separated from other rows.

If also a composite dockable is given, an action to close and to minimize all the dockables is added.

If the composite dockable has selected dockable, an action to close and to minimize all the other dockables is added.

Author:
Heidi Rakels.

Field Summary
static int CLOSE_ALL_ACTION
          The constant that defines that the close all action has to be added to the popup menu.
static int CLOSE_OTHERS_ACTION
          The constant that defines that the close others action has to be added to the popup menu.
static int DOCKABLE_ACTIONS
          The constant that defines that the actions of the dockable have to be added to the popup menu.
static int MINIMIZE_ALL_ACTION
          The constant that defines that the minimize all action has to be added to the popup menu.
static int MINIMIZE_OTHERS_ACTION
          The constant that defines that the minimize others action has to be added to the popup menu.
static int RESTORE_ALL_ACTION
          The constant that defines that the restore all action has to be added to the popup menu.
 
Constructor Summary
DefaultPopupMenuFactory()
           
 
Method Summary
 javax.swing.JPopupMenu createPopupMenu(Dockable selectedDockable, CompositeDockable compositeDockable)
          Creates a popup menu for the selected dockable and the other dockables in the dock of the selected dockable.
 int getPopupActions()
          Gets the integer that defines which actions will be added to te popup menu.
 void setPopupActions(int popupActions)
          Sets the integer that defines which actions will be added to te popup menu.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCKABLE_ACTIONS

public static final int DOCKABLE_ACTIONS
The constant that defines that the actions of the dockable have to be added to the popup menu. The actions of the dockable are retrieved by Dockable.getActions().

See Also:
Constant Field Values

CLOSE_ALL_ACTION

public static final int CLOSE_ALL_ACTION
The constant that defines that the close all action has to be added to the popup menu.

See Also:
Constant Field Values

CLOSE_OTHERS_ACTION

public static final int CLOSE_OTHERS_ACTION
The constant that defines that the close others action has to be added to the popup menu.

See Also:
Constant Field Values

MINIMIZE_ALL_ACTION

public static final int MINIMIZE_ALL_ACTION
The constant that defines that the minimize all action has to be added to the popup menu.

See Also:
Constant Field Values

MINIMIZE_OTHERS_ACTION

public static final int MINIMIZE_OTHERS_ACTION
The constant that defines that the minimize others action has to be added to the popup menu.

See Also:
Constant Field Values

RESTORE_ALL_ACTION

public static final int RESTORE_ALL_ACTION
The constant that defines that the restore all action has to be added to the popup menu.

See Also:
Constant Field Values
Constructor Detail

DefaultPopupMenuFactory

public DefaultPopupMenuFactory()
Method Detail

createPopupMenu

public javax.swing.JPopupMenu createPopupMenu(Dockable selectedDockable,
                                              CompositeDockable compositeDockable)
Description copied from interface: PopupMenuFactory
Creates a popup menu for the selected dockable and the other dockables in the dock of the selected dockable. If the selected dockable is null, a popup menu for the composite dockable is created.

Specified by:
createPopupMenu in interface PopupMenuFactory
Parameters:
selectedDockable - The selected dockable.
compositeDockable - The dockables in the selected dock.
Returns:
A popup menu for the selected dockable and the other dockables in the dock.

getPopupActions

public int getPopupActions()
Gets the integer that defines which actions will be added to te popup menu. This is a bitwise or of the constants DOCKABLE_ACTIONS, CLOSE_ALL_ACTION, CLOSE_OTHERS_ACTION, MINIMIZE_ALL_ACTION, and MINIMIZE_OTHERS_ACTION.

Returns:
The integer that defines which actions will be added to te popup menu.

setPopupActions

public void setPopupActions(int popupActions)
Sets the integer that defines which actions will be added to te popup menu.

Parameters:
popupActions - The integer that defines which actions will be added to te popup menu. The constants DOCKABLE_ACTIONS, CLOSE_ALL_ACTION, CLOSE_OTHERS_ACTION, MINIMIZE_ALL_ACTION, and MINIMIZE_OTHERS_ACTION can be combined with the bitwise or-operation.