public class SwingComponentFactory extends java.lang.Object
TICComponent
.
The following example shows how to create Swing-specific GUI components from a TIC component.
// Create an instance of a TIC component: TICComponent ticComponent = new SomeComponent(); // Use this factory to create a Swing-specific instance from it: JComponent swingComponent = SwingComponentFactory.getInstance().getSwingComponent(ticComponent); // swingComponent can now be used in any Swing GUI.See
#getSwingComponent(TICComponent)
for further details.Modifier and Type | Method and Description |
---|---|
static SwingComponentFactory |
getInstance() |
javax.swing.JComponent |
getSwingComponent(TICComponent ticComponent,
java.lang.Object... additionalParameters)
Creates the Swing component that will be associated with the specified TIC component if it was
not created before.
|
public static SwingComponentFactory getInstance()
public javax.swing.JComponent getSwingComponent(TICComponent ticComponent, java.lang.Object... additionalParameters)
#getToolkitComponent()
from now on.
Subsequent calls of this method will return the same instance again. The parameters specified in additional calls will therefore not be considered.
Note that this method can only be called if no SWT component has been created for the specified TIC component before.
ticComponent
- the TIC component for which an SWT component shall be createdadditionalParameters
- an optional list of parameters to be passed to
ticComponent.getSWTComponentClassName(Object...)
and
ticComponent.getSWTComponentConstructorParameters(Object...)
(Note that these parameters will not be passed to the component constructor. The parameters passed
there are determined by the return value of
TICComponent.getSWTComponentConstructorParameters(Object...)
.)java.lang.IllegalStateException
- if an SWT component has already been created for ticComponent
ToolkitSpecificInstantiationException
- if an error during the creation of the component occurs
(e.g. no constructor matching the necessary parameters was found)