@Target(value=METHOD) @Retention(value=RUNTIME) public @interface PropertyDesc
PropertyDescriptor
.
JFormDesigner first uses Introspector.getBeanInfo(Class)
to construct PropertyDescriptor
s and then applies
changes specified in annotations to copies of the PropertyDescriptor
s.
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 { ... }
Modifier and Type | Optional Element and Description |
---|---|
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.
|
public abstract String name
BeanInfo.properties()
at class level.
If you specify this annotation at a property getter method, then this
attribute is ignored.public abstract String displayName
Used in the JFormDesigner Properties view to display the property name in the "Name" column.
public abstract String description
Used in the JFormDesigner Properties view to display a description of the property in a tooltip.
public abstract String category
Used in the JFormDesigner Properties view to display the property in that category.
public abstract boolean preferred
Used in the JFormDesigner Properties view to display the property name in bold.
public abstract boolean expert
Used in the JFormDesigner Properties view to display the property name in italic and display the property in the "Expert Properties" category.
public abstract boolean hidden
Used in the JFormDesigner Properties view to hide the property.
public abstract Class<? extends PropertyEditor> propertyEditor
Used in the JFormDesigner Properties view for property editing.
public abstract PropertyDesc.Enum[] enumValues
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.
public abstract Class<?>[] imports
PropertyDesc.Enum.code()
(see enumValues()
) or
PropertyEditor.getJavaInitializationString()
.public abstract String[] persistenceConstructorProperties
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.
public abstract Class<? extends PersistenceDelegate> persistenceDelegate
persistenceConstructorProperties()
is specified, then this attribute is ignored.
Used by JFormDesigner to encode/decode the property value to XML.
public abstract PropertyDesc.ExtraPersistenceDelegate[] extraPersistenceDelegates
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.
public abstract BeanInfo.Attribute[] attributes
PropertyDescriptor
.
Invokes FeatureDescriptor.setValue(String, Object)
.
See BeanInfo.Attribute
for details.Copyright (C) 2004-2019 FormDev Software GmbH. All rights reserved.