Child pages
  • Providing UI Converters from Plugins

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To do this, the plugin class implementing the IClientPlugin (see Implement the Plugin Interface) must also implement interface IUIConverterProvider to produce IUIConverter instances in the getUIConverters() method, see api docs.

An IUIConverter converter has 3 methodsA UI converter class implementing the IUIConverter interface has to implement the following three methods that will be displayed in the Edit text format property dialog:

  • convertFromObject()
    Convert from UI value to dataprovider value
  • convertToObject()
    Converts from dataprovider value to UI value
  • type getToObjectType (one of TEXT, INTEGER, NUMBER, DATETIME or MEDIA)
    The UI data type (so the resulting type of the convertToObject()).
    This type can be provided by using the IColumnTypes constants.

A UI converter class can also define properties in the getDefaultProperties() method, which will be displayed in the Edit text format property dialog as well.

The dataprovider types that the UI converter supports are to be specified in the getSupportedDataproviderTypes() method.

The implemented UI converters returned by the getUIConverters() method of the plugin class implementing the IUIConverterProvider interface , will be then checked by the plugin manager which will add them to the list of Servoy UI converters.

...