|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.actf.model.AbstractModel
org.eclipse.actf.model.AbstractGuiModel
public abstract class AbstractGuiModel
base implementation for IGuiModel
. Clients should extend this class
rather than attempting to implement IGuiModel
Field Summary | |
---|---|
protected Map |
eventIdMap
keyed by event ids with values that are instances of ModelEventType |
Fields inherited from class org.eclipse.actf.model.AbstractModel |
---|
baseType, configuration, locator, runtimeContext, treeNodeWalker |
Constructor Summary | |
---|---|
AbstractGuiModel(String modelType)
create a IGuiModel implementation |
Method Summary | |
---|---|
Rectangle |
getBoundingRectangle(Object element)
gets the rectangle bounding the given element |
ModelEventType |
getModelEventType(Object eventId)
get the ModelEventType instances associated with the given event id. |
ModelEventType[] |
getModelEventTypes(Class c)
get the model event types for the given source type. |
void |
highlight(Object element)
highlight or visually indicate the element that is being examined. |
protected void |
initEventIdMap()
|
boolean |
isValid(Object comp)
returns whether or not the specified component is valid for access. This default implementation merely checks that the component is not null . |
boolean |
isVisible(Object comp)
returns whether or not the specified component is currently visible |
void |
registerModelEventListener(IModelEventListener listener,
ModelEventType[] eventTypes)
register a listener to receive notification when events with the given eventTypes are fired within this model. |
boolean |
requestFocusFor(Object comp)
request the focus for the specified component. |
void |
unregisterModelEventListener(IModelEventListener listener,
ModelEventType[] eventTypes)
unregister a previously registered listener. |
Methods inherited from class org.eclipse.actf.model.AbstractModel |
---|
addModelChangeListener, fireModelChangeEvent, getBaseType, getDefaultAliasPrefix, getName, getNodeId, getNodeLocator, getNodeName, getOrder, getPackageNames, getTreeWalker, removeModelChangeListener, setFilters, setModelType, setNodeID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.actf.model.IGuiModel |
---|
asyncInvokeOnUIThread, invokeOnUIThread, isUIThread |
Methods inherited from interface org.eclipse.actf.model.IModel |
---|
addModelChangeListener, getBaseType, getDefaultAliasPrefix, getName, getNodeId, getNodeLocator, getNodeName, getOrder, getPackageNames, getTreeWalker, removeModelChangeListener, setNodeID |
Field Detail |
---|
protected Map eventIdMap
ModelEventType
Constructor Detail |
---|
public AbstractGuiModel(String modelType)
modelType
- --
name of modelMethod Detail |
---|
public ModelEventType getModelEventType(Object eventId)
ModelEventType
instances associated with the given event id. The event id is model-specific
and will usually be presented in the model's API. What constitutes an event id and how they are determined should be
specified in clients that implement this model.
getModelEventType
in interface IGuiModel
eventId
- model-specific event id
ModelEventType
instances associated with this event id or null
if no event types are associated with this idpublic boolean isVisible(Object comp)
isVisible
in interface IGuiModel
comp
- - component to be tested
public boolean isValid(Object comp)
null
.
isValid
in interface IGuiModel
comp
- - component to be tested
true
if this component is valid, false
otherwiseorg.eclipse.actf.core.model.InvalidComponentException
public boolean requestFocusFor(Object comp)
requestFocusFor
in interface IGuiModel
comp
- - component for which focus is desired
true
if focus is successful, false
otherwisepublic void highlight(Object element)
highlight
in interface IGuiModel
element
- - the element to be highlitedpublic Rectangle getBoundingRectangle(Object element)
getBoundingRectangle
in interface IGuiModel
element
- - element for which bounds are desired
protected void initEventIdMap()
public ModelEventType[] getModelEventTypes(Class c)
IGuiModel
ModelEventType
object
describes the types of events that can be fired within the context of this runtime model. If the sourceType is null
,
then all of the event types of which this model is aware will be returned else only events that can be fired by the given sourceType
will be returned.
getModelEventTypes
in interface IGuiModel
c
- type to be queried for events
org.eclipse.actf.core.model.event.ModelEventType
public void registerModelEventListener(IModelEventListener listener, ModelEventType[] eventTypes)
IGuiModel
getModelEventTypes
methods.
registerModelEventListener
in interface IGuiModel
listener
- listener to be notified when specified events occureventTypes
- event types for which listener is being registeredIGuiModel.getModelEventType(Object)
,
IGuiModel.getModelEventTypes(Class)
public void unregisterModelEventListener(IModelEventListener listener, ModelEventType[] eventTypes)
IGuiModel
getModelEventTypes
methods.
unregisterModelEventListener
in interface IGuiModel
listener
- listener to be unregisteredeventTypes
- event types for which listener is to be unregisteredIGuiModel.registerModelEventListener(IModelEventListener, ModelEventType[])
,
org.eclipse.actf.core.model.event.ModelEventType#getId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |