Like what you see? Have a play with our trial version.

To include user specific settings or configurations to your converter plug-in, you will need to provide a configuration UI. This is achieved through the UserInputParameters API. The converter abstract class also extends UserInputParameters, so you can use this API as an instance of UserInputParameters. Click here for detailed documentation and examples of this API.


Below is a short example of how you might create a UI for a converter and use the configuration values:


 

@Override
protected void setupParameters() {
   Parameter p = new Parameter();
   p.setUniqueKey("DENOMINATOR");
   p.setDisplayName("Denominator");
   p.setDataType(TYPE_NUMERIC);
   p.setDisplayType(DISPLAY_TEXT_MEDLONG);
   addParameter(p);
}

@Override
public Object convertObject(Object data) throws Exception {
   if (data == null) return null;
      
   Number d = (Number)getParameterValue("DENOMINATOR");
   if (d == null) return data;
      
   ...
}

 

 

 

  • No labels