Child pages
  • Providing UI Converters from Plugins

Versions Compared

Key

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

...

A UI converter can be contributed by a Java Servoy client plugin.

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.

...

  • convertFromObject()
    Convert from UI value to dataprovider value
  • convertToObject()
    Converts from dataprovider value to UI value
  • type (one of TEXT, INTEGER, NUMBER, DATETIME or MEDIA)
    The UI data type (so the resulting type of the convertToObject()).

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.

Example

This is an example of a plugin that delivers a converter from joda time (which has support for time persiods) to java-util-date (which is supported by Servoy UI elements) time.

...