Implement PropertyEditorUI

The class that actually displays the custom property editor must implement the com.escenic.studio.editors.PropertyEditorUI interface. The main body of this class will be standard Swing programming and is not discussed here. In addition to ensuring that the class implements PropertyEditorUI correctly, however, you also need to be aware of the following:

  • The PropertyEditorSpi class that creates instances of this class passes two parameters to the constructor: an AbstractPropertyBinding and a ResourceRecorder.

  • The AbstractPropertyBinding object has a getPropertyDescriptor() method that gives you access to the contents of the field definition in the content-type resource.

  • The PropertyDescriptor you obtain in this way has getModule() and getModules() methods that you can use to access any parameters specified in the field definition.

  • Your class should include a dispose() method that calls the ResourceRecorder's disposeAll() method for all the AbstractPropertyBinding's BindingListeners. For example:

      public void dispose() {
        List<BindingListener> listeners = new ArrayList<BindingListener>(mBinding.getBindingListeners());
        for (BindingListener listener : listeners) {
          mBinding.removeBindingListener(listener);
        }
        mResourceRecorder.disposeAll();
      }