Groovy Documentation

groovy.swing
[Groovy] Class SwingBuilder

java.lang.Object
  groovy.lang.GroovyObjectSupport
      groovy.lang.Binding
          groovy.util.FactoryBuilderSupport
              groovy.swing.SwingBuilder

class SwingBuilder
extends FactoryBuilderSupport

A helper class for creating Swing widgets using GroovyMarkup

Authors:
James Strachan
Version:
\$Revision\$


Field Summary
static java.lang.String DEFAULT_DELEGATE_PROPERTY_OBJECT_ID

static java.lang.String DELEGATE_PROPERTY_OBJECT_ID

 
Fields inherited from class FactoryBuilderSupport
CURRENT_FACTORY, PARENT_FACTORY, PARENT_NODE, CURRENT_NODE, PARENT_CONTEXT, PARENT_NAME, CURRENT_NAME, OWNER, PARENT_BUILDER, CURRENT_BUILDER, CHILD_BUILDER, SCRIPT_CLASS_NAME
 
Constructor Summary
SwingBuilder(boolean init = true)

 
Method Summary
static SwingBuilder $static_methodMissing(java.lang.String method, java.lang.Object args)

Old factory method static SwingBuilder.build(Closure).

java.lang.Object build(Closure c)

Compatibility API.

static java.lang.Object clientPropertyAttributeDelegate(java.lang.Object builder, java.lang.Object node, java.lang.Object attributes)

void createKeyStrokeAction(java.util.Map attributes, javax.swing.JComponent component = null )

SwingBuilder doLater(Closure c)

Utility method to run a closure in EDT, using SwingUtilities.invokeLater.

SwingBuilder doOutside(Closure c)

Utility method to run a closure outside of the EDT.

SwingBuilder edt(Closure c)

Utility method to run a closure in EDT, using SwingUtilities.invokeAndWait.

static SwingBuilder edtBuilder(Closure c)

Factory method to create a SwingBuilder, and run the the closure in it on the EDT

static javax.swing.LookAndFeel lookAndFeel(java.lang.Object laf, Closure initCode)

static javax.swing.LookAndFeel lookAndFeel(java.util.Map attributes = [:], java.lang.Object laf = null, Closure initCode = null)

static javax.swing.LookAndFeel lookAndFeel(java.lang.Object... lafs)

static java.lang.Object objectIDAttributeDelegate(java.lang.Object builder, java.lang.Object node, java.lang.Object attributes)

java.lang.Object registerActionButtonWidgets()

java.lang.Object registerBasicLayouts()

java.lang.Object registerBasicWidgets()

void registerBeanFactory(java.lang.String nodeName, java.lang.String groupName, java.lang.Class klass)

Do some overrides for standard component handlers, else use super

java.lang.Object registerBinding()

java.lang.Object registerBorders()

java.lang.Object registerBoxLayout()

java.lang.Object registerContainers()

java.lang.Object registerDataModels()

java.lang.Object registerEditors()

java.lang.Object registerMDIWidgets()

java.lang.Object registerMenuWidgets()

java.lang.Object registerPassThruNodes()

java.lang.Object registerRenderers()

java.lang.Object registerSupportNodes()

java.lang.Object registerTableComponents()

java.lang.Object registerTableLayout()

java.lang.Object registerTextWidgets()

java.lang.Object registerThreading()

java.lang.Object registerWindows()

javax.swing.KeyStroke shortcut(java.lang.Object key, java.lang.Object modifier = 0)

javax.swing.KeyStroke shortcut(java.lang.String key, java.lang.Object modifier = 0)

 
Methods inherited from class FactoryBuilderSupport
invokeMethod, invokeMethod, getVariables, getVariable, setVariable, getCurrent, getParentNode, withBuilder, withBuilder, withBuilder, addDisposalClosure, getExplicitMethods, getExplicitProperties, getLocalFactories, getLocalExplicitMethods, getLocalExplicitProperties, getRegistrationGroups, getRegistrationGroupItems, getAttributeDelegates, getPreInstantiateDelegates, getPostInstantiateDelegates, getContextAttribute, getNameMappingClosure, setNameMappingClosure, getPostNodeCompletionDelegates, getCurrentFactory, getCurrentName, getCurrentBuilder, getParentFactory, getParentContext, getParentName, getChildBuilder, addAttributeDelegate, removeAttributeDelegate, addPreInstantiateDelegate, removePreInstantiateDelegate, checkValueIsNull, checkValueIsType, checkValueIsTypeNotString, autoRegisterNodes, getFactories, registerFactory, registerFactory, registerBeanFactory, registerBeanFactory, addPostInstantiateDelegate, removePostInstantiateDelegate, addPostNodeCompletionDelegate, removePostNodeCompletionDelegate, registerExplicitProperty, registerExplicitProperty, registerExplicitMethod, registerExplicitMethod, getPropertyMissingDelegate, setPropertyMissingDelegate, getMethodMissingDelegate, setMethodMissingDelegate, setProperty, getProperty, getName, getContext, build, build, build, dispose, hasVariable, setMetaClass, getMetaClass, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 
Methods inherited from class Binding
getVariables, hasVariable, getVariable, setVariable, setProperty, getProperty, setMetaClass, getMetaClass, invokeMethod, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

DEFAULT_DELEGATE_PROPERTY_OBJECT_ID

public static final java.lang.String DEFAULT_DELEGATE_PROPERTY_OBJECT_ID


DELEGATE_PROPERTY_OBJECT_ID

public static final java.lang.String DELEGATE_PROPERTY_OBJECT_ID


 
Constructor Detail

SwingBuilder

SwingBuilder(boolean init = true)


 
Method Detail

$static_methodMissing

@Deprecated
static SwingBuilder $static_methodMissing(java.lang.String method, java.lang.Object args)
Old factory method static SwingBuilder.build(Closure).
Parameters:
c - run this closure in the builder using the edt method


build

java.lang.Object build(Closure c)
Compatibility API.
Parameters:
c - run this closure in the builder


clientPropertyAttributeDelegate

static java.lang.Object clientPropertyAttributeDelegate(java.lang.Object builder, java.lang.Object node, java.lang.Object attributes)


createKeyStrokeAction

void createKeyStrokeAction(java.util.Map attributes, javax.swing.JComponent component = null )


doLater

SwingBuilder doLater(Closure c)
Utility method to run a closure in EDT, using SwingUtilities.invokeLater.
Parameters:
c - this closure is run in the EDT


doOutside

SwingBuilder doOutside(Closure c)
Utility method to run a closure outside of the EDT.

The closure is wrapped in a thread, and the thread is started immediately, only if the current thread is the EDT, otherwise the closure will be called immediately.

Parameters:
c - this closure is started outside of the EDT


edt

SwingBuilder edt(Closure c)
Utility method to run a closure in EDT, using SwingUtilities.invokeAndWait.
Parameters:
c - this closure is run in the EDT


edtBuilder

static SwingBuilder edtBuilder(Closure c)
Factory method to create a SwingBuilder, and run the the closure in it on the EDT
Parameters:
c - run this closure in the new builder using the edt method


lookAndFeel

static javax.swing.LookAndFeel lookAndFeel(java.lang.Object laf, Closure initCode)


lookAndFeel

static javax.swing.LookAndFeel lookAndFeel(java.util.Map attributes = [:], java.lang.Object laf = null, Closure initCode = null)


lookAndFeel

static javax.swing.LookAndFeel lookAndFeel(java.lang.Object... lafs)


objectIDAttributeDelegate

static java.lang.Object objectIDAttributeDelegate(java.lang.Object builder, java.lang.Object node, java.lang.Object attributes)


registerActionButtonWidgets

java.lang.Object registerActionButtonWidgets()


registerBasicLayouts

java.lang.Object registerBasicLayouts()


registerBasicWidgets

java.lang.Object registerBasicWidgets()


registerBeanFactory

void registerBeanFactory(java.lang.String nodeName, java.lang.String groupName, java.lang.Class klass)
Do some overrides for standard component handlers, else use super


registerBinding

java.lang.Object registerBinding()


registerBorders

java.lang.Object registerBorders()


registerBoxLayout

java.lang.Object registerBoxLayout()


registerContainers

java.lang.Object registerContainers()


registerDataModels

java.lang.Object registerDataModels()


registerEditors

java.lang.Object registerEditors()


registerMDIWidgets

java.lang.Object registerMDIWidgets()


registerMenuWidgets

java.lang.Object registerMenuWidgets()


registerPassThruNodes

java.lang.Object registerPassThruNodes()


registerRenderers

java.lang.Object registerRenderers()


registerSupportNodes

java.lang.Object registerSupportNodes()


registerTableComponents

java.lang.Object registerTableComponents()


registerTableLayout

java.lang.Object registerTableLayout()


registerTextWidgets

java.lang.Object registerTextWidgets()


registerThreading

java.lang.Object registerThreading()


registerWindows

java.lang.Object registerWindows()


shortcut

javax.swing.KeyStroke shortcut(java.lang.Object key, java.lang.Object modifier = 0)


shortcut

javax.swing.KeyStroke shortcut(java.lang.String key, java.lang.Object modifier = 0)


 

Groovy Documentation