com.guiseframework.prototype
Class PrototypeProvision<P extends Prototype>

java.lang.Object
  extended by com.globalmentor.model.AbstractHashObject
      extended by com.guiseframework.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
static int CONFIGURE_MENU_ORDER
           
static int EDIT_MENU_ORDER
           
static int HELP_MENU_ABOUT_ORDER
           
static int HELP_MENU_ORDER
           
static int INSERT_MENU_ORDER
           
static int MAX_ORDER
          The maximum allowed order.
static int MIN_ORDER
          The minimum allowed order.
static int NO_ORDER
          No order.
static int RESOURCE_MENU_ADD_ORDER
           
static int RESOURCE_MENU_ADVANCE_ORDER
           
static int RESOURCE_MENU_ANNOTATE_ORDER
           
static int RESOURCE_MENU_CLOSE_ORDER
           
static int RESOURCE_MENU_DELETE_ORDER
           
static int RESOURCE_MENU_EDIT_ORDER
           
static int RESOURCE_MENU_EXIT_ORDER
           
static int RESOURCE_MENU_MOVE_ORDER
           
static int RESOURCE_MENU_NEW_ORDER
           
static int RESOURCE_MENU_NEXT_ORDER
           
static int RESOURCE_MENU_OPEN_ORDER
           
static int RESOURCE_MENU_ORDER
           
static int RESOURCE_MENU_PAUSE_ORDER
           
static int RESOURCE_MENU_PLAY_ORDER
           
static int RESOURCE_MENU_PREVIOUS_ORDER
           
static int RESOURCE_MENU_PROPERTIES_ORDER
           
static int RESOURCE_MENU_RECEDE_ORDER
           
static int RESOURCE_MENU_RECORD_ORDER
           
static int RESOURCE_MENU_REFRESH_ORDER
           
static int RESOURCE_MENU_RENAME_ORDER
           
static int RESOURCE_MENU_RETRIEVE_ORDER
           
static int RESOURCE_MENU_REVERT_ORDER
           
static int RESOURCE_MENU_SAVE_ALL_ORDER
           
static int RESOURCE_MENU_SAVE_AS_ORDER
           
static int RESOURCE_MENU_SAVE_ORDER
           
static int RESOURCE_MENU_STOP_ORDER
           
static int TOOL_MENU_ORDER
           
static int VIEW_MENU_ORDER
           
static int WINDOW_MENU_ORDER
           
 
Constructor Summary
PrototypeProvision(P prototype, int order, boolean isMenu, boolean isTool)
          Prototype constructor with no prototype description parent.
PrototypeProvision(PrototypeProvision<?> parentPrototypeProvision, P prototype, int order, boolean isMenu, boolean isTool)
          Parent prototype description and prototype constructor.
 
Method Summary
 int compareTo(PrototypeProvision<P> prototypeDescription)
          Compares this object with the specified object for order.
 int getOrder()
           
 PrototypeProvision<?> getParentPrototypeProvision()
           
 P getPrototype()
           
 boolean isMenu()
           
 boolean isTool()
           
 
Methods inherited from class com.globalmentor.model.AbstractHashObject
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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_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 is null.
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, or null 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 is null.
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)
Compares this object with the specified object for order.

Specified by:
compareTo in interface java.lang.Comparable<PrototypeProvision<P extends Prototype>>
Parameters:
prototypeDescription - The object to be compared.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.