|
||||||||||
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
org.eclipse.actf.model.javapp.SwtGuiModel
public class SwtGuiModel
implementation for the Eclipse SWT GUI model
Field Summary | |
---|---|
protected ClassLoaderCache |
clCache
|
static List |
FOCUSABLE_COMPOSITE_LIST
|
static String[] |
FOCUSABLE_COMPOSITE_NAMES
|
static String |
SWT_ADAPTOR_CLASS
|
static String |
SWT_MODEL
|
static String |
SWT_RUNTIME_HOME_KEY
|
Fields inherited from class org.eclipse.actf.model.AbstractGuiModel |
---|
eventIdMap |
Fields inherited from class org.eclipse.actf.model.AbstractModel |
---|
baseType, configuration, locator, runtimeContext, treeNodeWalker |
Constructor Summary | |
---|---|
SwtGuiModel()
create a new SwtGuiModel |
Method Summary | |
---|---|
void |
asyncInvokeOnUIThread(Runnable runnable)
asyncronously executes the given Runnable from within the UI thread. |
String[] |
getAlternateMethodNames(String rootName)
Alternate method names returned include: 'set' + rootName 'add' + rootName First char of rootName is converted to upper case |
String |
getDefaultAliasPrefix()
returns the default alias prefix. The default alias prefix (usually a package name) is used when a fully-qualified name is not used in the 'value' attribute of an <alias> tag |
Object |
getDefaultGuiRoot()
|
INodeLocator |
getNodeLocator()
retrieves a locator for finding and identifying nodes in the model. |
String[] |
getPackageNames()
returns empty array Includes packages: java.lang org.eclipse.swt org.eclipse.swt.events org.eclipse.swt.widgets org.eclipse.swt.layout org.eclipse.swt.custom |
ITreeNodeWalker |
getTreeWalker()
retrieve the NodeWalker for traversing elements in this model |
protected boolean |
internalIsVisible(Object comp)
returns whether or not the component is visible. |
Object |
invokeGetter(Object obj,
String name)
invoke the getter method on the specified object. |
Object |
invokeGetter(Object obj,
String name,
Object arg)
invoke the specified getter method on the given object, passing it the single parameter. |
Object |
invokeGetter(String clsName,
String methName)
invoke the getter method of the specified class. |
void |
invokeOnUIThread(Runnable runnable)
executes the given Runnable from within the UI thread. |
boolean |
isDisposed(Object comp)
returns whether or not the component is disposed. |
boolean |
isGuiRoot(Object o)
An object must be an instance of a class that inherets from org.eclipse.swt.widgets.Shell in order to serve as a
top-level component in a SWT GUI |
boolean |
isGuiRootType(Class c)
An object must be an instance of a class that inherets from org.eclipse.swt.widgets.Shell in order to serve as a
top-level component in a SWT GUI |
boolean |
isTopDown()
|
boolean |
isUIThread()
returns whether or not the currently executing thread is the UI thread. |
boolean |
isValid(Object comp)
returns whether or not the specified component is valid for access. Components may be invalid because their underlying resources have been disposed, because the device that displays or renders them is destroyed, or for many other reasons. This default implementation merely checks that the component is not null . |
boolean |
isVisible(Object component)
returns whether or not the specified component is currently visible |
boolean |
performsLinkOnCreation()
return true since SWT components must be created and added
to GUIs upon their creation |
boolean |
requestFocusFor(Object comp)
request the focus for the specified component. This method should be invoked, for example, just prior to validation for a report that reflects the state of the component while visible. |
Methods inherited from class org.eclipse.actf.model.AbstractGuiModel |
---|
getBoundingRectangle, getModelEventType, getModelEventTypes, highlight, initEventIdMap, registerModelEventListener, unregisterModelEventListener |
Methods inherited from class org.eclipse.actf.model.AbstractModel |
---|
addModelChangeListener, fireModelChangeEvent, getBaseType, getName, getNodeId, getNodeName, getOrder, 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.IModel |
---|
addModelChangeListener, getBaseType, getName, getNodeId, getNodeName, getOrder, removeModelChangeListener, setNodeID |
Field Detail |
---|
public static final String[] FOCUSABLE_COMPOSITE_NAMES
public static final List FOCUSABLE_COMPOSITE_LIST
public static final String SWT_MODEL
public static final String SWT_RUNTIME_HOME_KEY
public static final String SWT_ADAPTOR_CLASS
protected ClassLoaderCache clCache
Constructor Detail |
---|
public SwtGuiModel()
Method Detail |
---|
public String[] getAlternateMethodNames(String rootName)
First char of rootName is converted to upper case
rootName
-
public String getDefaultAliasPrefix()
getDefaultAliasPrefix
in interface IModel
getDefaultAliasPrefix
in class AbstractModel
public String[] getPackageNames()
Includes packages:
getPackageNames
in interface IModel
getPackageNames
in class AbstractModel
org.eclipse.actf.core.processor.CodeProcessor
public boolean performsLinkOnCreation()
true
since SWT components must be created and added
to GUIs upon their creation
true
public boolean isTopDown()
true
public boolean isGuiRootType(Class c)
org.eclipse.swt.widgets.Shell
in order to serve as a
top-level component in a SWT GUI
c
- --
class to be tested
true
if the given class inherits from
org.eclipse.swt.widgets.Shell
public boolean isGuiRoot(Object o)
org.eclipse.swt.widgets.Shell
in order to serve as a
top-level component in a SWT GUI
o
- --
object to be tested
true
if object is an instance of a class that
inherets from org.eclipse.swt.widgets.Shell
public boolean isUIThread()
org.eclipse.swt.widgets.Display
instance.
true
if the current thread is the UI thread,
false
otherwiseIGuiModel.isUIThread()
public boolean isVisible(Object component)
isVisible
in interface IGuiModel
isVisible
in class AbstractGuiModel
component
- - component to be tested
public void invokeOnUIThread(Runnable runnable)
isUIThread
returns
false
.
runnable
- -
Runnable to be invoked in UI threadisUIThread()
public void asyncInvokeOnUIThread(Runnable runnable)
Runnable
is placed in a queue and control is returned immediately to the calling thread.
runnable
- - Runnable to be invoked in UI threadIGuiModel.invokeOnUIThread(Runnable)
public boolean requestFocusFor(Object comp)
requestFocusFor
in interface IGuiModel
requestFocusFor
in class AbstractGuiModel
comp
- - component for which focus is desired
true
if focus is successful, false
otherwisepublic Object invokeGetter(Object obj, String name) throws Exception
Note: If the specified method is found and returns a boolean
, then
an unsuccessful invocation will result in a return value of false
.
obj
- - receivername
- - method name
Exception
public Object invokeGetter(Object obj, String name, Object arg) throws Exception
Note: If the specified method is found and returns a boolean
, then
an unsuccessful invocation will result in a return value of false
.
*
obj
- - the receivername
- - the method namearg
- - single argument to method
Exception
protected boolean internalIsVisible(Object comp)
true
is returned.
comp
- SWT control
false
if and only if no exceptions occur and component
is not, in fact, visiblepublic boolean isDisposed(Object comp)
true
is returned.
comp
- SWT control
false
if and only if no exceptions occur and component
is not, in fact, disposedpublic boolean isValid(Object comp)
null
.
isValid
in interface IGuiModel
isValid
in class AbstractGuiModel
comp
- - component to be tested
true
if this component is valid, false
otherwiseorg.eclipse.actf.core.model.InvalidComponentException
public Object invokeGetter(String clsName, String methName)
Note: If the specified method is found and returns a boolean
, then
an unsuccessful invocation will result in a return value of false
.
clsName
- - class namemethName
- - method name
public Object getDefaultGuiRoot()
public ITreeNodeWalker getTreeWalker()
NodeWalker
for traversing elements in this model
getTreeWalker
in interface IModel
getTreeWalker
in class AbstractModel
null
if
no walker is availablepublic INodeLocator getNodeLocator()
AbstractModel
getNodeLocator
in interface IModel
getNodeLocator
in class AbstractModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |