Package io.guise.framework.prototype
Class PrototypeProvision<P extends Prototype>
- java.lang.Object
-
- com.globalmentor.model.AbstractHashObject
-
- io.guise.framework.prototype.PrototypeProvision<P>
-
- Type Parameters:
P
- The type of prototype being provided.
- All Implemented Interfaces:
java.lang.Comparable<PrototypeProvision<P>>
public class PrototypeProvision<P extends Prototype> extends com.globalmentor.model.AbstractHashObject implements java.lang.Comparable<PrototypeProvision<P>>
Prototype provision information indicating order, hierarchy, and location for generated components. This description is usually used to generate components and place them in menus and/or toolbars.- Author:
- Garret Wilson
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PrototypeProvision(PrototypeProvision<?> parentPrototypeProvision, P prototype, int order, boolean isMenu, boolean isTool)
Parent prototype description and prototype constructor.PrototypeProvision(P prototype, int order, boolean isMenu, boolean isTool)
Prototype constructor with no prototype description parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(PrototypeProvision<P> prototypeDescription)
int
getOrder()
PrototypeProvision<?>
getParentPrototypeProvision()
P
getPrototype()
boolean
isMenu()
boolean
isTool()
-
-
-
Field Detail
-
NO_ORDER
public static final int NO_ORDER
No order.- See Also:
- Constant Field Values
-
MIN_ORDER
public static final int MIN_ORDER
The minimum allowed order.- See Also:
- Constant Field Values
-
MAX_ORDER
public static final int MAX_ORDER
The maximum allowed order.- See Also:
- Constant Field Values
-
RESOURCE_MENU_ORDER
public static final int RESOURCE_MENU_ORDER
- See Also:
- Constant Field Values
-
EDIT_MENU_ORDER
public static final int EDIT_MENU_ORDER
- See Also:
- Constant Field Values
-
INSERT_MENU_ORDER
public static final int INSERT_MENU_ORDER
- See Also:
- Constant Field Values
-
VIEW_MENU_ORDER
public static final int VIEW_MENU_ORDER
- See Also:
- Constant Field Values
-
TOOL_MENU_ORDER
public static final int TOOL_MENU_ORDER
- See Also:
- Constant Field Values
-
CONFIGURE_MENU_ORDER
public static final int CONFIGURE_MENU_ORDER
- See Also:
- Constant Field Values
-
WINDOW_MENU_ORDER
public static final int WINDOW_MENU_ORDER
- See Also:
- Constant Field Values
-
HELP_MENU_ORDER
public static final int HELP_MENU_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_NEW_ORDER
public static final int RESOURCE_MENU_NEW_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_ADD_ORDER
public static final int RESOURCE_MENU_ADD_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_OPEN_ORDER
public static final int RESOURCE_MENU_OPEN_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_CLOSE_ORDER
public static final int RESOURCE_MENU_CLOSE_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_EDIT_ORDER
public static final int RESOURCE_MENU_EDIT_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_EDIT_CANCEL
public static final int RESOURCE_MENU_EDIT_CANCEL
- See Also:
- Constant Field Values
-
RESOURCE_MENU_SAVE_ORDER
public static final int RESOURCE_MENU_SAVE_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_SAVE_AS_ORDER
public static final int RESOURCE_MENU_SAVE_AS_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_SAVE_ALL_ORDER
public static final int RESOURCE_MENU_SAVE_ALL_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_REVERT_ORDER
public static final int RESOURCE_MENU_REVERT_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_MOVE_ORDER
public static final int RESOURCE_MENU_MOVE_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_RENAME_ORDER
public static final int RESOURCE_MENU_RENAME_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_REFRESH_ORDER
public static final int RESOURCE_MENU_REFRESH_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_DELETE_ORDER
public static final int RESOURCE_MENU_DELETE_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_PREVIOUS_ORDER
public static final int RESOURCE_MENU_PREVIOUS_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_RECEDE_ORDER
public static final int RESOURCE_MENU_RECEDE_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_PLAY_ORDER
public static final int RESOURCE_MENU_PLAY_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_PAUSE_ORDER
public static final int RESOURCE_MENU_PAUSE_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_RECORD_ORDER
public static final int RESOURCE_MENU_RECORD_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_STOP_ORDER
public static final int RESOURCE_MENU_STOP_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_ADVANCE_ORDER
public static final int RESOURCE_MENU_ADVANCE_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_NEXT_ORDER
public static final int RESOURCE_MENU_NEXT_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_RETRIEVE_ORDER
public static final int RESOURCE_MENU_RETRIEVE_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_ANNOTATE_ORDER
public static final int RESOURCE_MENU_ANNOTATE_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_PROPERTIES_ORDER
public static final int RESOURCE_MENU_PROPERTIES_ORDER
- See Also:
- Constant Field Values
-
RESOURCE_MENU_EXIT_ORDER
public static final int RESOURCE_MENU_EXIT_ORDER
- See Also:
- Constant Field Values
-
HELP_MENU_ABOUT_ORDER
public static final int HELP_MENU_ABOUT_ORDER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PrototypeProvision
public PrototypeProvision(P prototype, int order, boolean isMenu, boolean isTool)
Prototype constructor with no prototype description parent.- Parameters:
prototype
- The prototype.order
- The order of the prototype.isMenu
- Whether this prototype should be used in a menu if available.isTool
- Whether this prototype should be used in a toolbar if available.- Throws:
java.lang.NullPointerException
- if the given prototype isnull
.java.lang.IllegalArgumentException
- if the given order is not -1 and does not come between 0 and 2147483647, inclusive.
-
PrototypeProvision
public PrototypeProvision(PrototypeProvision<?> parentPrototypeProvision, P prototype, int order, boolean isMenu, boolean isTool)
Parent prototype description and prototype constructor.- Parameters:
parentPrototypeProvision
- The prototype description's parent, ornull
if the prototype description has no parent.prototype
- The prototype.order
- The order of the prototype.isMenu
- Whether this prototype should be used in a menu if available.isTool
- Whether this prototype should be used in a toolbar if available.- Throws:
java.lang.NullPointerException
- if the given prototype isnull
.java.lang.IllegalArgumentException
- if the given order is not -1 and does not come between 0 and 2147483647, inclusive.
-
-
Method Detail
-
getParentPrototypeProvision
public PrototypeProvision<?> getParentPrototypeProvision()
- Returns:
- The prototype's parent, or
null
if the prototype description has no parent.
-
getPrototype
public P getPrototype()
- Returns:
- The prototype being described.
-
getOrder
public int getOrder()
- Returns:
- The order of the prototype.
-
isMenu
public boolean isMenu()
- Returns:
- Whether this prototype should be used in a menu if available.
-
isTool
public boolean isTool()
- Returns:
- Whether this prototype should be used in a toolbar if available.
-
compareTo
public int compareTo(PrototypeProvision<P> prototypeDescription)
-
-