public class DefaultComponentHandler extends DefaultObjectHandler
DefaultObjectHandler.ProxyEventInfo| Modifier and Type | Field and Description |
|---|---|
static String |
ACTION_ICON_ATTRIBUTE |
static String |
BORDER_ATTRIBUTE |
static String |
BORDER_FACTORY_PREFIX |
static String |
CONTAINER_DELEGATE_ATTRIBUTE |
static String |
FONT_FACE_ATTRIBUTE |
static String |
FONT_SIZE_ATTRIBUTE |
static String |
FONT_STYLE_ATTRIBUTE |
static String |
FONT_WEIGHT_ATTRIBUTE |
static String |
HEIGHT_ATTRIBUTE |
static String |
I18N_MNEMONIC_ATTRIBUTE |
static String |
ICON_ATTRIBUTE |
static String |
ICON_IMAGE_ATTRIBUTE |
protected static org.apache.commons.logging.Log |
log
Logger
|
static String |
NAME_ATTRIBUTE |
static String |
TITLED_BORDER_PREFIX |
static String |
WIDTH_ATTRIBUTE |
static String |
X_ATTRIBUTE |
static String |
Y_ATTRIBUTE |
ABSTRACT_ATTRIBUTE, BORDER_LAYOUT_PREFIX, COMPUTE_I18N_ATTRIBUTE, CONSTRAINTS_ATTRIBUTE, CONSTRUCTOR_PARAMS_ATTRIBUTE, DECORATOR_ATTRIBUTE, DISPLAYED_MNEMONIC_ATTRIBUTE, DISPLAYED_MNEMONIC_INDEX_ATTRIBUTE, GENERIC_TYPE_ATTRIBUTE, GRID_LAYOUT_PREFIX, HANDLER_ATTRIBUTE, I18N_FORMAT_ATTRIBUTE, ID_ATTRIBUTE, IMPLEMENTS_ATTRIBUTE, INITIALIZER_ATTRIBUTE, JAVA_BEAN_ATTRIBUTE, jaxxBeanInfo, LAYOUT_ATTRIBUTE, MNEMONIC_ATTRIBUTE, objectMap, STYLE_CLASS_ATTRIBUTE, SUPER_GENERIC_TYPE_ATTRIBUTEXMLNS_ATTRIBUTE| Constructor and Description |
|---|
DefaultComponentHandler(ClassDescriptor beanClass) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeComponent(CompiledObject object,
Element tag,
JAXXCompiler compiler) |
void |
compileFirstPass(Element tag,
JAXXCompiler compiler)
Performs the first pass of compilation on an XML tag from a JAXX source file.
|
void |
compileSecondPass(Element tag,
JAXXCompiler compiler)
Performs the second pass of compilation on an XML tag from a JAXX source file.
|
protected void |
configureProxyEventInfo()
Configures the event handling for members which do not fire
PropertyChangeEvent when
modified. |
protected int |
constantValue(String key,
String value)
Maps string values onto integers, so that int-valued enumeration properties can be specified by strings.
|
String |
getContainerDelegate() |
String |
getGetPropertyCode(String id,
String name,
JAXXCompiler compiler)
Returns a snippet of Java code which will retrieve an object property at runtime.
|
ClassDescriptor |
getPropertyType(CompiledObject object,
String propertyName,
JAXXCompiler compiler)
Returns the type of the named property.
|
String |
getSetPropertyCode(String id,
String name,
String valueCode,
JAXXCompiler compiler)
Returns a snippet of Java code which will set an object property at runtime.
|
protected void |
init()
Performs introspection on the beanClass and stores the results.
|
boolean |
isContainer()
Returns
true if this component can contain other components. |
boolean |
isPropertyInherited(String property) |
protected void |
openComponent(CompiledObject object,
Element tag,
JAXXCompiler compiler) |
protected void |
scanAttributesForDependencies(Element tag,
JAXXCompiler compiler)
Scans all attributes for any dependency classes and adds them to the current compilation
set.
|
void |
setAttribute(CompiledObject object,
String propertyName,
String stringValue,
boolean inline,
JAXXCompiler compiler)
Set a single property on an object.
|
protected void |
setDefaults(CompiledObject object,
Element tag,
JAXXCompiler compiler)
Initializes the default settings of the object, prior to setting its
attribute values.
|
addEventHandler, addProxyEventInfo, addProxyEventInfo, addProxyEventInfo, addProxyEventInfo, applyStylesheets, compileChildrenFirstPass, compileChildrenSecondPass, compileChildTagFirstPass, compileChildTagSecondPass, convertFromString, createCompiledObject, getAttributeComparator, getAttributeOrdering, getBeanClass, getEventClass, getEventInfo, getJAXXBeanInfo, getJAXXBeanInfo, isEventHandlerName, isMemberBound, registerCompiledObject, safeInit, setAttributeFromCss, setAttributes, setProperty, toStringpublic static final String BORDER_ATTRIBUTE
public static final String ACTION_ICON_ATTRIBUTE
public static final String I18N_MNEMONIC_ATTRIBUTE
public static final String CONTAINER_DELEGATE_ATTRIBUTE
public static final String FONT_FACE_ATTRIBUTE
public static final String FONT_SIZE_ATTRIBUTE
public static final String FONT_STYLE_ATTRIBUTE
public static final String FONT_WEIGHT_ATTRIBUTE
public static final String HEIGHT_ATTRIBUTE
public static final String ICON_ATTRIBUTE
public static final String ICON_IMAGE_ATTRIBUTE
public static final String NAME_ATTRIBUTE
public static final String WIDTH_ATTRIBUTE
public static final String X_ATTRIBUTE
public static final String Y_ATTRIBUTE
protected static final org.apache.commons.logging.Log log
public static final String BORDER_FACTORY_PREFIX
public static final String TITLED_BORDER_PREFIX
public DefaultComponentHandler(ClassDescriptor beanClass)
protected void init()
throws IntrospectionException
DefaultObjectHandlerinit in class DefaultObjectHandlerIntrospectionException - if any pbprotected void configureProxyEventInfo()
DefaultObjectHandlerPropertyChangeEvent when
modified. The default implementation does nothing. Subclasses should override this method to call
addProxyEventInfo for each member which requires special handling.configureProxyEventInfo in class DefaultObjectHandlerprotected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException
DefaultObjectHandlersetDefaults in class DefaultObjectHandlerobject - the object to initializetag - the tag being compiledcompiler - the current JAXXCompilerCompilerExceptionpublic void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException
TagHandlerTagHandler implementations affect the generated .java
file by calling methods in the JAXXCompiler.compileFirstPass in interface TagHandlercompileFirstPass in class DefaultObjectHandlertag - the XML tag to compilecompiler - the active JAXXCompilerCompilerException - if a compilation error occursIOException - if an I/O error occurspublic void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException
TagHandlerTagHandler implementations affect the generated .java
file by calling methods in the JAXXCompiler.compileSecondPass in interface TagHandlercompileSecondPass in class DefaultObjectHandlertag - the XML tag to compilecompiler - the active JAXXCompilerCompilerException - if a compilation error occursIOException - if an I/O error occursprotected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException
CompilerExceptionprotected void closeComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException
CompilerExceptionpublic boolean isPropertyInherited(String property) throws UnsupportedAttributeException
isPropertyInherited in class DefaultObjectHandlerproperty - property name to testtrue if the specified property should be inherited by child components when specified
via CSS.UnsupportedAttributeException - if attribute is not supportedpublic ClassDescriptor getPropertyType(CompiledObject object, String propertyName, JAXXCompiler compiler) throws CompilerException
DefaultObjectHandlerget method;
for instance JLabel's text property is a String.getPropertyType in class DefaultObjectHandlerobject - the object being compiledpropertyName - the simple JavaBeans-style name of the propertycompiler - the current JAXXCompilerCompilerException - if the type cannot be determinedpublic String getGetPropertyCode(String id, String name, JAXXCompiler compiler) throws CompilerException
DefaultObjectHandlerget method, but it can be arbitrarily complex.getGetPropertyCode in class DefaultObjectHandlerid - Java code for the object whose property is being retrievedname - the name of the property to retrievecompiler - the current JAXXCompilerCompilerException - if a compilation error occurspublic String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException
DefaultObjectHandlerset method, but it can be arbitrarily complex.getSetPropertyCode in class DefaultObjectHandlerid - Java code for the object whose property is being setname - the name of the property to setvalueCode - Java expression representing the value to set the property tocompiler - the current JAXXCompilerCompilerException - if a compilation error occurspublic void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler)
DefaultObjectHandlerDefaultObjectHandler.convertFromString(String, String, Class).setAttribute in class DefaultObjectHandlerobject - the object on which to set the propertypropertyName - the name of the property to setstringValue - the raw string value of the property from the XMLinline - true if the value was directly specified as an inline class tag attribute, false otherwise (a default value, specified in CSS, etc.)compiler - the current JAXXCompilerprotected void scanAttributesForDependencies(Element tag, JAXXCompiler compiler)
DefaultObjectHandlercompileFirstPass() (it is an error to add dependencies after
pass 1 is complete).scanAttributesForDependencies in class DefaultObjectHandlertag - tag to scancompiler - compiler to useprotected int constantValue(String key, String value)
DefaultObjectHandler.convertFromString(java.lang.String, java.lang.String, java.lang.Class<?>) when an
int-valued property has a value which is not a valid number. By default, this method looks at the
enumerationValues value of the JAXXPropertyDescriptor.constantValue in class DefaultObjectHandlerkey - the name of the int-typed propertyvalue - the non-numeric value that was specified for the propertyIllegalArgumentException - if the property is an enumeration, but the value is not validNumberFormatException - if the property is not an enumerationpublic boolean isContainer()
true if this component can contain other components. For children to be
allowed, the component must be a subclass of Container and its JAXXBeanInfo
must not have the value false for its isContainer value.true if children are allowedpublic String getContainerDelegate()
Copyright © 2008–2017 Ultreia.io. All rights reserved.