Package docking
Class DefaultActionContext
java.lang.Object
docking.DefaultActionContext
- All Implemented Interfaces:
ActionContext
- Direct Known Subclasses:
CheckoutsActionContext,CodeComparisonActionContext,DialogActionContext,FSBActionContext,GraphActionContext,ProgramActionContext,ProjectDataContext,ThemeTableContext,VgActionContext
The default implementation of ActionContext
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor with no provider, context object, or source componentDefaultActionContext(ComponentProvider provider) Constructor with no source component and no context objectDefaultActionContext(ComponentProvider provider, Component sourceComponent) Constructor for ActionContext with context object and sourceComponent being the sameDefaultActionContext(ComponentProvider provider, Object contextObject, Component sourceComponent) Constructor -
Method Summary
Modifier and TypeMethodDescriptionReturns the object that was included by the ComponentProvider when this context was created.intReturns the click modifiers for this event.Returns the context's mouse event.Returns the component that is the target of this context.Returns the sourceObject from the actionEvent that triggered this context to be generated.booleanhasAnyEventClickModifiers(int modifiersMask) Tests the click modifiers for this event to see if they contain any bit from the specified modifiersMask parameter.setContextObject(Object contextObject) Sets the context object for this context.voidsetEventClickModifiers(int modifiers) Sets the modifiers for this event that were present when the item was clicked on.Updates the context's mouse event.setSourceComponent(Component sourceComponent) Sets the source component for this ActionContext.setSourceObject(Object sourceObject) Sets the sourceObject for this ActionContext.toString()
-
Constructor Details
-
DefaultActionContext
public DefaultActionContext()Default constructor with no provider, context object, or source component -
DefaultActionContext
Constructor with no source component and no context object- Parameters:
provider- the ComponentProvider that generated this context.
-
DefaultActionContext
Constructor for ActionContext with context object and sourceComponent being the same- Parameters:
provider- the ComponentProvider that generated this context.sourceComponent- an optional source object; this is intended to be the component that is the source of the context, usually the focused component
-
DefaultActionContext
public DefaultActionContext(ComponentProvider provider, Object contextObject, Component sourceComponent) Constructor- Parameters:
provider- the ComponentProvider that generated this context.contextObject- an optional contextObject that the ComponentProvider can provide; this can be anything that actions wish to later retrievesourceComponent- an optional source object; this is intended to be the component that is the source of the context, usually the focused component
-
-
Method Details
-
getComponentProvider
- Specified by:
getComponentProviderin interfaceActionContext
-
getContextObject
Description copied from interface:ActionContextReturns the object that was included by the ComponentProvider when this context was created.- Specified by:
getContextObjectin interfaceActionContext- Returns:
- the object that was included by the ComponentProvider when this context was created.
-
setContextObject
Description copied from interface:ActionContextSets the context object for this context. This can be any object of the creator's choosing that can be provided for later retrieval.- Specified by:
setContextObjectin interfaceActionContext- Parameters:
contextObject- Sets the context object for this context.- Returns:
- this context
-
getSourceObject
Description copied from interface:ActionContextReturns the sourceObject from the actionEvent that triggered this context to be generated.- Specified by:
getSourceObjectin interfaceActionContext- Returns:
- the sourceObject from the actionEvent that triggered this context to be generated.
-
setEventClickModifiers
public void setEventClickModifiers(int modifiers) Description copied from interface:ActionContextSets the modifiers for this event that were present when the item was clicked on.- Specified by:
setEventClickModifiersin interfaceActionContext- Parameters:
modifiers- bit-masked int, seeActionEvent.getModifiers()orMouseEvent.getModifiersEx()
-
getEventClickModifiers
public int getEventClickModifiers()Description copied from interface:ActionContextReturns the click modifiers for this event.Only present for some mouse assisted events, e.g. clicking on a toolbar button or choosing a menu item in a popup menu.
- Specified by:
getEventClickModifiersin interfaceActionContext- Returns:
- bit-masked int, see
InputEvent.SHIFT_MASK, etc
-
hasAnyEventClickModifiers
public boolean hasAnyEventClickModifiers(int modifiersMask) Description copied from interface:ActionContextTests the click modifiers for this event to see if they contain any bit from the specified modifiersMask parameter.- Specified by:
hasAnyEventClickModifiersin interfaceActionContext- Parameters:
modifiersMask- bitmask to test- Returns:
- boolean true if any bit in the eventClickModifiers matches the mask
-
setSourceObject
Description copied from interface:ActionContextSets the sourceObject for this ActionContext. This method is used internally by the DockingWindowManager. ComponentProvider and action developers should only use this method for testing.- Specified by:
setSourceObjectin interfaceActionContext- Parameters:
sourceObject- the source object- Returns:
- this context
-
setMouseEvent
Description copied from interface:ActionContextUpdates the context's mouse event. Contexts that are based upon key events will have no mouse event. This method is really for the framework to use. Client calls to this method will be overridden by the framework when menu items are clicked.- Specified by:
setMouseEventin interfaceActionContext- Parameters:
e- the event that triggered this context.- Returns:
- this context
-
getMouseEvent
Description copied from interface:ActionContextReturns the context's mouse event. Contexts that are based upon key events will have no mouse event.- Specified by:
getMouseEventin interfaceActionContext- Returns:
- the mouse event that triggered this context; null implies a key event-based context
-
getSourceComponent
Description copied from interface:ActionContextReturns the component that is the target of this context. This value should not change whether the context is triggered by a key binding or mouse event.- Specified by:
getSourceComponentin interfaceActionContext- Returns:
- the component; may be null
-
setSourceComponent
Description copied from interface:ActionContextSets the source component for this ActionContext.- Specified by:
setSourceComponentin interfaceActionContext- Parameters:
sourceComponent- the source component- Returns:
- this context
-
toString
-