|
||||||||||
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.AbstractRenderableModel
public abstract class AbstractRenderableModel
base implementation for IRenderableModel
. Clients should extend this class
rather than attempting to implement IRenderableModel
.
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, nodeToTypeNameMap, runtimeContext, treeNodeWalker |
Constructor Summary | |
---|---|
AbstractRenderableModel(String modelType)
create an IRenderableModel implementation |
Method Summary | |
---|---|
Rectangle |
getBoundingRectangle(Object element)
gets the rectangle bounding the given element default implementation returns null |
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. default implementation returns null |
void |
highlight(Object element)
highlight or visually indicate the element that is being examined. |
protected void |
initEventIdMap()
used to initialize the eventId map, which is keyed by eventId that corresponds to a ModelEventType
instance. |
protected void |
initEventIdMap(Class sourceType,
Class eventFieldProviderType,
String fieldPrefix)
|
boolean |
isValid(Object comp)
returns whether or not the specified component is valid for access. 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. equivalent to calling registerModelEventListener(listener, eventTypes, null) |
void |
registerModelEventListener(IModelEventListener listener,
ModelEventType[] eventTypes,
Object[] params)
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, getNodeWalker, getOrder, getTypeName, 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.IRenderableModel |
---|
asyncInvokeOnUIThread, invokeOnUIThread, isUIThread |
Methods inherited from interface org.eclipse.actf.model.IModel |
---|
addModelChangeListener, getBaseType, getDefaultAliasPrefix, getName, getNodeId, getNodeLocator, getNodeName, getNodeWalker, getOrder, getPackageNames, getTypeName, removeModelChangeListener, setNodeID |
Field Detail |
---|
protected Map eventIdMap
ModelEventType
Constructor Detail |
---|
public AbstractRenderableModel(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 IRenderableModel
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 IRenderableModel
comp
- - component to be tested
public boolean isValid(Object comp)
null
.
isValid
in interface IRenderableModel
comp
- - component to be tested
true
if this component is valid, false
otherwiseInvalidComponentException
public boolean requestFocusFor(Object comp)
requestFocusFor
in interface IRenderableModel
comp
- - component for which focus is desired
true
if focus is successful, false
otherwisepublic void highlight(Object element)
highlight
in interface IRenderableModel
element
- - the element to be highlitedpublic Rectangle getBoundingRectangle(Object element)
null
getBoundingRectangle
in interface IRenderableModel
element
- - element for which bounds are desired
public ModelEventType[] getModelEventTypes(Class c)
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.
default implementation returns null
getModelEventTypes
in interface IRenderableModel
c
- type to be queried for events
ModelEventType
public void registerModelEventListener(IModelEventListener listener, ModelEventType[] eventTypes)
getModelEventTypes
methods.
equivalent to calling registerModelEventListener(listener, eventTypes, null)
registerModelEventListener
in interface IRenderableModel
listener
- listener to be notified when specified events occureventTypes
- event types for which listener is being registeredIRenderableModel.getModelEventType(Object)
,
IRenderableModel.getModelEventTypes(Class)
public void registerModelEventListener(IModelEventListener listener, ModelEventType[] eventTypes, Object[] params)
getModelEventTypes
methods.
Optional parameters can also be passed to facilitate additional side effects or for additional information about the context
in which events are being fired.
registerModelEventListener
in interface IRenderableModel
listener
- listener to be notified when specified events occureventTypes
- event types for which listener is being registeredparams
- - additional parameters (may be null
)IRenderableModel.getModelEventType(Object)
,
IRenderableModel.getModelEventTypes(Class)
public void unregisterModelEventListener(IModelEventListener listener, ModelEventType[] eventTypes)
IRenderableModel
getModelEventTypes
methods.
unregisterModelEventListener
in interface IRenderableModel
listener
- listener to be unregisteredeventTypes
- event types for which listener is to be unregisteredIRenderableModel.registerModelEventListener(IModelEventListener, ModelEventType[])
,
ModelEventType
protected void initEventIdMap()
ModelEventType
instance. Event ids are model-specific and typically defined as part of that model's definition.
ModelEventType
,
registerModelEventListener(IModelEventListener, ModelEventType[])
protected void initEventIdMap(Class sourceType, Class eventFieldProviderType, String fieldPrefix)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |