Class TLcyDataPropertyValueCustomizerPanelFactories

java.lang.Object
com.luciad.lucy.gui.customizer.dataproperty.TLcyDataPropertyValueCustomizerPanelFactories

public class TLcyDataPropertyValueCustomizerPanelFactories extends Object
Utility class to create instances of ILcyCustomizerPanelFactory that can be used to create customizer panels for instances of TLcdDataPropertyValueContext. These customizer panels are used for instance, to edit the values of data properties in a Table view. There are some generally applicable methods that can handle a wide variety of common cases: A typical use case is:

   TLcyDataPropertyValueCustomizerPanelFactories factories = new TLcyDataPropertyValueCustomizerPanelFactories( aLucyEnv );
   if ( factories.canCreateCustomizerPanelFactory( STRING_PROPERTY ) ) {
     ILcdFilter<TLcdDataPropertyValueContext> filter =
         TLcyDataPropertyValueFilters.createFilter( DATA_TYPE, STRING_PROPERTY);
     ILcyCustomizerPanelFactory customizerPanelFactory =
         factories.createCustomizerPanelFactory(filter, STRING_PROPERTY);
     //do something with the factory, for instance:
     aLucyEnv.addService( customizerPanelFactory ):
   }
 
For more specific behaviour, some other methods are available:
Since:
2013.0
  • Constructor Details

    • TLcyDataPropertyValueCustomizerPanelFactories

      public TLcyDataPropertyValueCustomizerPanelFactories(ILcyLucyEnv aLucyEnv)
      Creates a new instance of TLcyDataPropertyValueCustomizerPanelFactories for the specified Lucy environment.
      Parameters:
      aLucyEnv - the lucy env.
  • Method Details

    • canCreateCustomizerPanelFactory

      public boolean canCreateCustomizerPanelFactory(TLcdDataProperty aDataProperty)
      Returns true if you can create a customizer factory for the passed data property using createCustomizerPanelFactory(com.luciad.datamodel.TLcdDataProperty, com.luciad.util.ILcdFilter<com.luciad.view.TLcdDataPropertyValueContext>). Currently the following cases are supported:

      The data property does not represent a collection and the type of the data property is

      • TLcdCoreDataTypes.STRING_TYPE.
      • TLcdCoreDataTypes.DOUBLE_TYPE.
      • TLcdCoreDataTypes.FLOAT_TYPE.
      • TLcdCoreDataTypes.INTEGER_TYPE.
      • TLcdCoreDataTypes.LONG_TYPE.
      • TLcdCoreDataTypes.SHORT_TYPE.
      • TLcdCoreDataTypes.BOOLEAN_TYPE.
      • an Enumeration

      Parameters:
      aDataProperty - the data property to check.
      Returns:
      true for the cases above, false otherwise.
    • createCustomizerPanelFactory

      public ILcyCustomizerPanelFactory createCustomizerPanelFactory(TLcdDataProperty aDataProperty, ILcdFilter<TLcdDataPropertyValueContext> aPropertyValueFilter)

      This method creates a customizer factory implementation for the passed TLcdDataProperty. Will only succeed if canCreateCustomizerPanelFactory(com.luciad.datamodel.TLcdDataProperty) evaluates to true for the passed data property.

      Note: if this method does not offer a customizer factory for a specific data property, you can probably create one using the other methods in this class.

      Parameters:
      aDataProperty - the data property whose values will be edited. This controls the specific type of customizer.
      aPropertyValueFilter - the filter that determines for which instances of TLcdDataPropertyValueContext the returned customizer panel factory applies.
      Returns:
      a customizer panel factory to edit values of the specified data property.
      Throws:
      IllegalArgumentException - if canCreateCustomizerPanelFactory(com.luciad.datamodel.TLcdDataProperty) evaluates to false for the passed property.
    • createGeneralCustomizerPanelFactory

      public ILcyCustomizerPanelFactory createGeneralCustomizerPanelFactory(ILcdFilter<TLcdDataPropertyValueContext> aPropertyValueFilter)
      Returns a factory that can create data property value customizers if the following conditions apply:
      Parameters:
      aPropertyValueFilter - a filter to control for which instances a customizer panel can be created.
      Returns:
      a customizer panel factory than can create data property value customizers under certain conditions.
    • createTextFieldCustomizerPanelFactory

      public ILcyCustomizerPanelFactory createTextFieldCustomizerPanelFactory(ILcdFilter<TLcdDataPropertyValueContext> aPropertyValueFilter, int aMinNbOfChars, int aMaxNbOfChars, boolean aEmptyStringForNull)
      Creates a ILcyCustomizerPanelFactory that creates a text field customizer with input validation for string values of the specified data property, making sure the length of the string is within the bounds.
      Parameters:
      aPropertyValueFilter - the filter that determines for which instances of TLcdDataPropertyValueContext the returned customizer panel factory applies.
      aMinNbOfChars - the minimum number of chars that should be in a valid string.
      aMaxNbOfChars - the maximum number of characters that are allowed in a valid string.
      Returns:
      a ILcyCustomizerPanelFactory that can create customizer panels that can edit instances of TLcdDataPropertyValueContext containing string values, and enforce conditions on the string length.
    • createTextFieldCustomizerPanelFactory

      public ILcyCustomizerPanelFactory createTextFieldCustomizerPanelFactory(ILcdFilter<TLcdDataPropertyValueContext> aPropertyValueFilter, Format aFormat)
      Creates a ILcyCustomizerPanelFactory that creates a text field customizer that can edit instances of TLcdDataPropertyValueContext if the passed format can convert strings to values and vice versa. The format can also provide input validation. If the format can't parse a input string the customizer panel will turn red and won't apply changes.
      Parameters:
      aPropertyValueFilter - the filter that determines for which instances of TLcdDataPropertyValueContext the returned customizer panel factory applies.
      aFormat - the format used to format and parse the values.
      Returns:
      a ILcyCustomizerPanelFactory that can create customizer panels that use a text field with the passed format to edit instances of TLcdDataPropertyValueContext.
    • createCheckBoxCustomizerPanelFactory

      public ILcyCustomizerPanelFactory createCheckBoxCustomizerPanelFactory(ILcdFilter<TLcdDataPropertyValueContext> aPropertyValueFilter)
      Creates a ILcyCustomizerPanelFactory that creates a check box customizer for instances of TLcdDataPropertyValueContext that contain boolean values.
      Parameters:
      aPropertyValueFilter - the filter that determines for which instances of TLcdDataPropertyValueContext the returned customizer panel factory applies.
      Returns:
      a ILcyCustomizerPanelFactory that can create customizer panels that use a check box to edit edit instances of TLcdDataPropertyValueContext containing boolean values.
    • createComboBoxCustomizerPanelFactory

      public ILcyCustomizerPanelFactory createComboBoxCustomizerPanelFactory(ILcdFilter<TLcdDataPropertyValueContext> aPropertyValueFilter, Set<?> aPossibleValues)
      Creates a ILcyCustomizerPanelFactory that creates a combobox customizer using the passed set of values. This is especially useful to edit values corresponding to enumeration data types.
      Parameters:
      aPropertyValueFilter - the filter that determines for which instances of TLcdDataPropertyValueContext the returned customizer panel factory applies.
      aPossibleValues - a set of possible values.
      Returns:
      a ILcyCustomizerPanelFactory that can create customizer panels that use a combo box to edit instances of TLcdDataPropertyValueContext.