Package docking
Class ActionContext
- java.lang.Object
-
- docking.ActionContext
-
- Direct Known Subclasses:
CheckoutsActionContext
,DualDecompilerActionContext
,FSBActionContext
,ProgramActionContext
,ProjectDataActionContext
,VgActionContext
public class ActionContext extends java.lang.Object
ComponentProviders are required to return Objects of this type in their getActionContext() methods. Generally, ComponentProviders have two ways to use this class. They can either create an ActionContext instance and pass in a contextObject that will be useful to its actions or, subclass the ActionContext object to include specific methods to provide the information that actions will require.
-
-
Constructor Summary
Constructors Constructor Description ActionContext()
ActionContext(ComponentProvider provider, java.lang.Object contextObject)
Basic constructor for ActionContextActionContext(ComponentProvider provider, java.lang.Object contextObject, java.lang.Object sourceObject)
For Testing
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ComponentProvider
getComponentProvider()
Returns the#ComponentProvider
that generated this ActionContextjava.lang.Object
getContextObject()
Returns the object that was included by the ComponentProvider when this context was created.java.awt.event.MouseEvent
getMouseEvent()
Returns the context's mouse event.java.lang.Object
getSourceObject()
Returns the sourceObject from the actionEvent that triggered this context to be generated.void
setContextObject(java.lang.Object contextObject)
Sets the context object for this context.void
setMouseEvent(java.awt.event.MouseEvent e)
Updates the context's mouse event.void
setSource(java.lang.Object sourceObject)
Sets the sourceObject for this ActionContext.
-
-
-
Constructor Detail
-
ActionContext
public ActionContext()
-
ActionContext
public ActionContext(ComponentProvider provider, java.lang.Object contextObject)
Basic constructor for ActionContext- Parameters:
provider
- the ComponentProvider that generated this context.contextObject
- an optional contextObject that the ComponentProvider can provide to the action.
-
ActionContext
public ActionContext(ComponentProvider provider, java.lang.Object contextObject, java.lang.Object sourceObject)
For Testing
-
-
Method Detail
-
getComponentProvider
public ComponentProvider getComponentProvider()
Returns the#ComponentProvider
that generated this ActionContext- Returns:
-
getContextObject
public java.lang.Object getContextObject()
Returns the object that was included by the ComponentProvider when this context was created.- Returns:
- the object that was included by the ComponentProvider when this context was created.
-
setContextObject
public void setContextObject(java.lang.Object contextObject)
Sets the context object for this context. This can be any object of the creator's choosing that can be provided for later retrieval.- Parameters:
contextObject
- Sets the context object for this context.
-
getSourceObject
public java.lang.Object getSourceObject()
Returns the sourceObject from the actionEvent that triggered this context to be generated.- Returns:
- the sourceObject from the actionEvent that triggered this context to be generated.
-
setSource
public void setSource(java.lang.Object sourceObject)
Sets the sourceObject for this ActionContext. This method is used internally by the DockingWindowManager. ComponentProvider and action developers should only use this method for testing.- Parameters:
sourceObject
-
-
setMouseEvent
public void setMouseEvent(java.awt.event.MouseEvent e)
Updates the context's mouse event. Contexts that are based upon key events will have no mouse event.- Parameters:
e
- the event that triggered this context.
-
getMouseEvent
public java.awt.event.MouseEvent getMouseEvent()
Returns the context's mouse event. Contexts that are based upon key events will have no mouse event.- Returns:
- the mouse event that triggered this context; null implies a key event-based context
-
-