@Component(value="cuba_ComponentsFactory") public class DesktopComponentsFactory extends java.lang.Object implements ComponentsFactory
NAME
Constructor and Description |
---|
DesktopComponentsFactory() |
Modifier and Type | Method and Description |
---|---|
<T extends Component> |
createComponent(java.lang.Class<T> type)
Create a component instance by its type.
|
Component |
createComponent(ComponentGenerationContext context)
Creates a component according to the given
ComponentGenerationContext . |
Component |
createComponent(java.lang.String name)
Create a component instance by its name.
|
Timer |
createTimer()
Create a timer instance.
|
static void |
registerComponent(java.lang.String element,
java.lang.Class<? extends Component> componentClass) |
static void |
registerComponents(ComponentPalette... palettes) |
public static void registerComponent(java.lang.String element, java.lang.Class<? extends Component> componentClass)
public static void registerComponents(ComponentPalette... palettes)
public Component createComponent(java.lang.String name)
ComponentsFactory
createComponent
in interface ComponentsFactory
name
- component name. It is usually defined in NAME constant inside the component interface,
e.g. Label.NAME
.
It is also usually equal to component's XML name.public <T extends Component> T createComponent(java.lang.Class<T> type)
ComponentsFactory
createComponent
in interface ComponentsFactory
type
- component typepublic Component createComponent(ComponentGenerationContext context)
ComponentsFactory
ComponentGenerationContext
.
Trying to find ComponentGenerationStrategy
implementations. If at least one strategy exists, then:
Ordered
interface.null
component.createComponent
in interface ComponentsFactory
context
- the ComponentGenerationContext
instancepublic Timer createTimer()
ComponentsFactory
createTimer
in interface ComponentsFactory