Methods | Fields | This Package | All Packages

IValueEditor Interface

Defines the interface for a value editor.

package com.ms.wfc.core

public interface IValueEditor

Remarks

A value editor is used to edit property values in a property browser. A class typically defines a public static inner class named Editor, which in turn implements the IValueEditor interface. This type of implementation allows the value editor to be separated from the class itself in situations where the value editor is not required (such as when the class is deployed).

The following example shows a class named Color and its associated value editor:

public class Color
{
   ... // Members of class Color.

   public static class Editor implements IValueEditor
   {
      ... // Implementations of IValueEditor methods.
   }
}

When a class defines a value editor, the editor implementation is automatically inherited by subclasses that do not provide their own value editors.

A value editor is typically obtained through the ComponentManager class. The component manager looks for a constructor that takes a parameter of type java.lang.Class, which represents the type of value to be edited, or a constructor that takes no parameters. For either of these two constructors, the value editor is instantiated once and reused when needed.

Note   If the value editor requires special knowledge about the component whose property is being edited, it can define a constructor that takes an IEditorSite object. This constructor takes precedence over the other two constructors, and the value editor is instantiated for each use.

The component manager also provides the ability to register value editors for a particular type; this is useful for value editors that are not implemented as inner classes.

The ValueEditor class provides a default implementation of the IValueEditor interface. Value editors can extend ValueEditor instead of implementing the entire IValueEditor interface. For a list of value editors defined by WFC, see Value Editor Classes.