Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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
CHILD_BUILDER, CURRENT_BUILDER, CURRENT_FACTORY, CURRENT_NAME, CURRENT_NODE, OWNER, PARENT_BUILDER, PARENT_CONTEXT, PARENT_FACTORY, PARENT_NAME, PARENT_NODE, SCRIPT_CLASS_NAME, attributeDelegates, autoRegistrationComplete, autoRegistrationRunning, explicitMethods, explicitProperties, methodMissingDelegate, postInstantiateDelegates, postNodeCompletionDelegates, preInstantiateDelegates, propertyMissingDelegate, registrationGroup, registrationGroupName

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
addAttributeDelegate, addDisposalClosure, addPostInstantiateDelegate, addPostNodeCompletionDelegate, addPreInstantiateDelegate, autoRegisterNodes, build, build, build, checkExplicitMethod, checkValueIsNull, checkValueIsType, checkValueIsTypeNotString, createNode, dispathNodeCall, dispose, getAttributeDelegates, getChildBuilder, getContext, getContextAttribute, getContexts, getContinuationData, getCurrent, getCurrentBuilder, getCurrentFactory, getCurrentName, getExplicitMethods, getExplicitProperties, getFactories, getLocalExplicitMethods, getLocalExplicitProperties, getLocalFactories, getMethodMissingDelegate, getName, getNameMappingClosure, getParentContext, getParentFactory, getParentName, getParentNode, getPostInstantiateDelegates, getPostNodeCompletionDelegates, getPreInstantiateDelegates, getProperty, getPropertyMissingDelegate, getProxyBuilder, getRegistrationGroupItems, getRegistrationGroups, getVariable, getVariables, handleNodeAttributes, invokeMethod, invokeMethod, newContext, nodeCompleted, popContext, postInstantiate, postNodeCompletion, preInstantiate, registerBeanFactory, registerBeanFactory, registerExplicitMethod, registerExplicitMethod, registerExplicitProperty, registerExplicitProperty, registerFactory, registerFactory, removeAttributeDelegate, removePostInstantiateDelegate, removePostNodeCompletionDelegate, removePreInstantiateDelegate, reset, resolveExplicitMethod, resolveExplicitProperty, resolveFactory, restoreFromContinuationData, setClosureDelegate, setMethodMissingDelegate, setNameMappingClosure, setNodeAttributes, setParent, setProperty, setPropertyMissingDelegate, setProxyBuilder, setVariable, withBuilder, withBuilder, withBuilder

Methods inherited from class Binding
getProperty, getVariable, getVariables, hasVariable, setProperty, setVariable

Methods inherited from class GroovyObjectSupport
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#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