public class XLayoutFactory extends Object
createXLayout()
. It's also possible to add user
defined control handlers either by using one of the register...
methods or by placing a control handler XML configuration file
handler-config.xml
into the classpath root and register all user
defined control handlers here. This file will automaticaly picked up at
instanciation time of the factory.Modifier and Type | Method and Description |
---|---|
boolean |
containsControlHandler(String name)
Returns whether a control handler with given name is already registered.
|
XLayout |
createXLayout()
Creates a new XLayout instance and initializes it with registered
handlers.
|
void |
destroy() |
ControlHandlerConfig |
getControlHandlerConfig(String name)
Returns the control handler configuration for the given control handler
or null if no such configuration for the given name exists.
|
static XLayoutFactory |
getFactory() |
static XLayoutFactory |
getFactory(ClassLoader resourceClassLoader) |
void |
registerControlHandler(ControlHandlerConfig handlerConfig,
boolean overwrite)
Registers an new handler using a given configuration.
|
void |
registerControlHandler(String name,
com.logabit.xlayout.handlers.IControlHandler handler,
boolean overwrite)
Registers a new control handler.
|
void |
registerControlHandlers(File file,
boolean overwrite)
Reads from an xml file and registers all handlers placed in this file.
|
void |
registerControlHandlers(InputStream is,
String hint,
boolean overwrite)
Reads from an xml input stream and registers all handlers placed in this
file.
|
void |
registerControlHandlers(List<ControlHandlerConfig> handlerConfigs,
boolean overwrite)
Registers new handlers using the given configuration objects.
|
void |
removeControlHandler(String name)
Removes the handler with the given name from the list of registered
handlers.
|
public static XLayoutFactory getFactory(ClassLoader resourceClassLoader)
public static XLayoutFactory getFactory()
public void destroy()
public XLayout createXLayout()
public void registerControlHandler(String name, com.logabit.xlayout.handlers.IControlHandler handler, boolean overwrite)
name
- The name of handler.handler
- The handler instance.overwrite
- If this flag is true, an already existing handler with that
name will be overwritten. If this flag is false and a handler
with that name already exists, nothing happens.public void removeControlHandler(String name)
name
- public void registerControlHandler(ControlHandlerConfig handlerConfig, boolean overwrite)
handlerConfig
- The handler configuration.overwrite
- If true, overwrites an already existing handler with that
name.public void registerControlHandlers(List<ControlHandlerConfig> handlerConfigs, boolean overwrite)
handlerConfigs
- The list of configurations.overwrite
- If true, overwrites an already existing handler with that
name.public void registerControlHandlers(File file, boolean overwrite)
file
- The xml configuration file.overwrite
- If true, overwrites an already existing handler with that
name.public void registerControlHandlers(InputStream is, String hint, boolean overwrite)
is
- The xml configuration input stream.hint
- A hint for the input stream which says where the stream comes
from.overwrite
- If true, overwrites an already existing handler with that
name.public ControlHandlerConfig getControlHandlerConfig(String name)
name
- - The name of the control handler.public boolean containsControlHandler(String name)
name
-