JFormDesigner 5.0.4 Annotations

com.jformdesigner.annotations
Annotation Type PropertyDesc


@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface PropertyDesc

This annotation can be used to specify additional information for constructing a PropertyDescriptor.

JFormDesigner first uses Introspector.getBeanInfo(Class) to construct PropertyDescriptors and then applies changes specified in annotations to copies of the PropertyDescriptors.

This annotation may be used in a BeanInfo annotation (see BeanInfo.properties()) or may be attached to property getter or setter methods. If the getter method of a property is annotated, then the setter method of the same property is not checked for this annotation.

Important: This annotation requires that the BeanInfo annotation is specified for the bean class. Otherwise this annotation is ignored when specified at methods.

Example for attaching this annotation to a property getter method:

 @PropertyDesc(displayName="magnitude (in %)", preferred=true)
 public int getMagnitude() {
     return magnitude;
 }
 
Example for specifying this annotation in a BeanInfo annotation:
 @BeanInfo(
     properties={
         @PropertyDesc(name="magnitude", displayName="magnitude (in %)", preferred=true)
     }
 )
 public class MyBean extends JCompoment { ... }
 

Since:
5.0

Optional Element Summary
 BeanInfo.Attribute[] attributes
          Specifies additional named attributes for the PropertyDescriptor.
 String category
          Name of the category in which the property should be displayed.
 String description
          Description of the property.
 String displayName
          Display name of the property.
 PropertyDesc.Enum[] enumValues
          Specifies a list of valid property values.
 boolean expert
          Specifies whether the property is intended for expert users.
 PropertyDesc.ExtraPersistenceDelegate[] extraPersistenceDelegates
          Specifies extra persistence delegates used to persist referenced classes.
 boolean hidden
          Specifies whether the property should be hidden.
 Class<?>[] imports
          Specifies one or more classes for which import statements should be generated by the Java code generator.
 String name
          The programmatic name of the property.
 String[] persistenceConstructorProperties
          Specifies the property names for a DefaultPersistenceDelegate(String[]) used to persist an instance of the property value.
 Class<? extends PersistenceDelegate> persistenceDelegate
          Specifies the persistence delegate used to persist an instance of the property value.
 boolean preferred
          Specifies whether the property is important.
 Class<? extends PropertyEditor> propertyEditor
          Custom property editor that should be used for editing the property.
 

name

public abstract String name
The programmatic name of the property. This attribute is only used/required when specifying properties with BeanInfo.properties() at class level. If you specify this annotation at a property getter method, then this attribute is ignored.

Default:
""

displayName

public abstract String displayName
Display name of the property. If not specified, the programmatic name will be used.

Used in the JFormDesigner Properties view to display the property name in the "Name" column.

Default:
""

description

public abstract String description
Description of the property. If not specified, the display name will be used.

Used in the JFormDesigner Properties view to display a description of the property in a tooltip.

Default:
""

category

public abstract String category
Name of the category in which the property should be displayed.

Used in the JFormDesigner Properties view to display the property in that category.

Default:
""

preferred

public abstract boolean preferred
Specifies whether the property is important.

Used in the JFormDesigner Properties view to display the property name in bold.

Default:
false

expert

public abstract boolean expert
Specifies whether the property is intended for expert users.

Used in the JFormDesigner Properties view to display the property name in italic and display the property in the "Expert Properties" category.

Default:
false

hidden

public abstract boolean hidden
Specifies whether the property should be hidden.

Used in the JFormDesigner Properties view to hide the property.

Default:
false

propertyEditor

public abstract Class<? extends PropertyEditor> propertyEditor
Custom property editor that should be used for editing the property.

Used in the JFormDesigner Properties view for property editing.

Default:
java.beans.PropertyEditor.class

enumValues

public abstract PropertyDesc.Enum[] enumValues
Specifies a list of valid property values. See PropertyDesc.Enum for details.

Used in the JFormDesigner Properties view to display a combobox for property editing.

Note: JFormDesigner supports Java 5 enumeration types, which do not need this kind of configuration.

See Also:
http://www.formdev.com/jformdesigner/doc/java-beans/#enumerationValues
Default:
{}

imports

public abstract Class<?>[] imports
Specifies one or more classes for which import statements should be generated by the Java code generator. This is useful if you don't use full qualified class names in PropertyDesc.Enum.code() (see enumValues()) or PropertyEditor.getJavaInitializationString().

See Also:
http://www.formdev.com/jformdesigner/doc/java-beans/#imports
Default:
{}

persistenceConstructorProperties

public abstract String[] persistenceConstructorProperties
Specifies the property names for a DefaultPersistenceDelegate(String[]) used to persist an instance of the property value. The property value class must have a constructor that accepts the given properties. Only necessary for bean value classes that are not JavaBeans.

Used by JFormDesigner to encode/decode the property value to XML.

See Also:
http://www.formdev.com/jformdesigner/doc/java-beans/#persistenceDelegate
Default:
{}

persistenceDelegate

public abstract Class<? extends PersistenceDelegate> persistenceDelegate
Specifies the persistence delegate used to persist an instance of the property value. Only necessary for bean value classes that are not JavaBeans. If persistenceConstructorProperties() is specified, then this attribute is ignored.

Used by JFormDesigner to encode/decode the property value to XML.

See Also:
http://www.formdev.com/jformdesigner/doc/java-beans/#persistenceDelegate
Default:
java.beans.PersistenceDelegate.class

extraPersistenceDelegates

public abstract PropertyDesc.ExtraPersistenceDelegate[] extraPersistenceDelegates
Specifies extra persistence delegates used to persist referenced classes. Use the attribute persistenceDelegate() to specify a persistence delegate for the property value. Use this attribute to specify persistence delegates for classes that are referenced by the property value.

Used by JFormDesigner to encode/decode the property value to XML.

See Also:
http://www.formdev.com/jformdesigner/doc/java-beans/#extraPersistenceDelegates
Default:
{}

attributes

public abstract BeanInfo.Attribute[] attributes
Specifies additional named attributes for the PropertyDescriptor. Invokes FeatureDescriptor.setValue(String, Object). See BeanInfo.Attribute for details.

See Also:
http://www.formdev.com/jformdesigner/doc/java-beans/#propdesc_attrs
Default:
{}

JFormDesigner 5.0.4 Annotations

Copyright (C) 2004-2012 FormDev Software GmbH. All rights reserved.