Servoy 5.x Public API

com.servoy.j2db.dataui
Class PropertyEditorHint

java.lang.Object
  extended by com.servoy.j2db.dataui.PropertyEditorHint

public class PropertyEditorHint
extends Object

Class for providing a hint to Servoy Developer on which property editor to use for a bean property.

@see PropertyEditorClass for available editor classes.

@see PropertyEditorOption for available options.

Example:

  public class ExampleBeanBeanInfo extends SimpleBeanInfo
  {
        public PropertyDescriptor[] getPropertyDescriptors()
        {
                try
                {
                        PropertyDescriptor dp = new PropertyDescriptor("myDataprovider", ExampleBean.class);
                        PropertyEditorHint dpHint = new PropertyEditorHint(PropertyEditorClass.dataprovider);
                        dpHint.setOption(PropertyEditorOption.includeForm, Boolean.FALSE); // filter out form variables
                        dp.setValue(PropertyEditorHint.PROPERTY_EDITOR_HINT, dpHint);
  
                        ....
  
                        return new PropertyDescriptor[] { dp, .... };
                }
                catch (IntrospectionException e)
                {
                        Debug.error("MyBeanInfo: unexpected exception: " + e);
                        return null;
                }
        }
  }
  

Since:
5.0

Field Summary
static String PROPERTY_EDITOR_HINT
          Constant for configuring bean property editor hint.
 
Constructor Summary
PropertyEditorHint(PropertyEditorClass propertyEditorClass)
           
 
Method Summary
protected  Object getDefaultOption(PropertyEditorOption key)
           
 Object getOption(PropertyEditorOption key)
           
 PropertyEditorClass getPropertyEditorClass()
           
 void setOption(PropertyEditorOption key, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_EDITOR_HINT

public static final String PROPERTY_EDITOR_HINT
Constant for configuring bean property editor hint.

See Also:
PropertyDescriptor#setValue, Constant Field Values
Constructor Detail

PropertyEditorHint

public PropertyEditorHint(PropertyEditorClass propertyEditorClass)
Method Detail

getDefaultOption

protected Object getDefaultOption(PropertyEditorOption key)

getOption

public Object getOption(PropertyEditorOption key)

getPropertyEditorClass

public PropertyEditorClass getPropertyEditorClass()

setOption

public void setOption(PropertyEditorOption key,
                      Object value)

Copyright © 2010 Servoy B.V.