org.eclipse.actf.model.javapp
Class SwingGuiModel

java.lang.Object
  extended by org.eclipse.actf.model.AbstractModel
      extended by org.eclipse.actf.model.AbstractGuiModel
          extended by org.eclipse.actf.model.javapp.AwtGuiModel
              extended by org.eclipse.actf.model.javapp.SwingGuiModel
All Implemented Interfaces:
IGuiModel, IModel

public class SwingGuiModel
extends AwtGuiModel

implementation for the Java Swing GUI model

Author:
Mike Squillace

Field Summary
static String SWING_ADAPTOR_CLASS
           
static String SWING_MODEL
           
 
Fields inherited from class org.eclipse.actf.model.javapp.AwtGuiModel
AWT_MODEL
 
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
SwingGuiModel()
          create a new SwingGuiModel
 
Method Summary
 void asyncInvokeOnUIThread(Runnable runnable)
          asyncronously executes the given Runnable from within the UI thread. That is, the Runnable is placed in a queue and control is returned immediately to the calling thread.
 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
 INodeLocator getNodeLocator()
          retrieves a locator for finding and identifying nodes in the model.
 String[] getPackageNames()
          

Includes packages:

  • java.lang
  • java.awt
  • java.awt.event
Includes packages: java.lang java.awt java.awt.event javax.swing
 ITreeNodeWalker getTreeWalker()
          retrieve the NodeWalker for traversing elements in this model
 void invokeOnUIThread(Runnable runnable)
          executes the given Runnable from within the UI thread.
 boolean isUIThread()
          returns whether or not the currently executing thread is the UI thread.
 boolean isVisible(Object component)
          returns whether or not the specified component is currently visible
 
Methods inherited from class org.eclipse.actf.model.javapp.AwtGuiModel
getAlternateMethodNames, isTopDown, requestFocusFor, setNodeID
 
Methods inherited from class org.eclipse.actf.model.AbstractGuiModel
getBoundingRectangle, getModelEventType, getModelEventTypes, highlight, initEventIdMap, isValid, registerModelEventListener, unregisterModelEventListener
 
Methods inherited from class org.eclipse.actf.model.AbstractModel
addModelChangeListener, fireModelChangeEvent, getBaseType, getName, getNodeId, getNodeName, getOrder, removeModelChangeListener, setFilters, setModelType
 
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
 

Field Detail

SWING_MODEL

public static final String SWING_MODEL
See Also:
Constant Field Values

SWING_ADAPTOR_CLASS

public static final String SWING_ADAPTOR_CLASS
See Also:
Constant Field Values
Constructor Detail

SwingGuiModel

public SwingGuiModel()
create a new SwingGuiModel

Method Detail

getDefaultAliasPrefix

public 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

Specified by:
getDefaultAliasPrefix in interface IModel
Overrides:
getDefaultAliasPrefix in class AwtGuiModel
Returns:
"java.awt"

getPackageNames

public String[] getPackageNames()

Includes packages:

Includes packages:

Specified by:
getPackageNames in interface IModel
Overrides:
getPackageNames in class AwtGuiModel
Returns:
list of packages that any code processor should import
See Also:
org.eclipse.actf.core.processor.CodeProcessor

isUIThread

public boolean isUIThread()
returns whether or not the currently executing thread is the UI thread. For Swing, the UI thread is the thread is the event dispatch thread.

Specified by:
isUIThread in interface IGuiModel
Overrides:
isUIThread in class AwtGuiModel
Returns:
true if the current thread is the event dispatch thread, false otherwise
See Also:
IGuiModel.isUIThread()

isVisible

public boolean isVisible(Object component)
returns whether or not the specified component is currently visible

Specified by:
isVisible in interface IGuiModel
Overrides:
isVisible in class AwtGuiModel
Parameters:
component - - component to be tested
Returns:
whether or not the component is currently visible or showing on the screen

invokeOnUIThread

public void invokeOnUIThread(Runnable runnable)
executes the given Runnable from within the UI thread. This method will typically be called if isUIThread returns false.

Specified by:
invokeOnUIThread in interface IGuiModel
Overrides:
invokeOnUIThread in class AwtGuiModel
Parameters:
runnable - - Runnable to be invoked in UI thread
See Also:
IGuiModel.invokeOnUIThread(Runnable)

asyncInvokeOnUIThread

public void asyncInvokeOnUIThread(Runnable runnable)
asyncronously executes the given Runnable from within the UI thread. That is, the Runnable is placed in a queue and control is returned immediately to the calling thread.

Specified by:
asyncInvokeOnUIThread in interface IGuiModel
Overrides:
asyncInvokeOnUIThread in class AwtGuiModel
Parameters:
runnable - - Runnable to be invoked in UI thread
See Also:
IGuiModel.invokeOnUIThread(Runnable)

getTreeWalker

public ITreeNodeWalker getTreeWalker()
retrieve the NodeWalker for traversing elements in this model

Specified by:
getTreeWalker in interface IModel
Overrides:
getTreeWalker in class AbstractModel
Returns:
walker for traversing nodes in this model or null if no walker is available

getNodeLocator

public INodeLocator getNodeLocator()
Description copied from class: AbstractModel
retrieves a locator for finding and identifying nodes in the model. The locator can provide an XPath expression that describes a node in the model or, given a valid XPath expression, find an object in the model.

Specified by:
getNodeLocator in interface IModel
Overrides:
getNodeLocator in class AbstractModel
Returns:
node locator