# com.bea.ide.control
EditorSupport Interface

public interface EditorSupport

Provides information needed by the IDE to customize a control's behavior in Design View. This includes the icons displayed for the control's methods, what should happen when the user double-clicks a method arrow, and whether the user should be allowed to edit the control's interface as defined in a JCX file.
This class defines several constants that represent possible behaviors within the IDE. Your implementation of getBehavior should return the appropriate thing based on the type of behavior being requested. If you don't have a specific behavor for a behaviorName, just return null.
When the IDE calls getBehavior, it passes in a "behavior name" whose value is one of these constants. It all passes in an extension of the ControlBehaviorContext interface that indicates the context for the specific behavior. For example, your implementation of getBehavior might receive the BEHAVIOR_ATTRIBUTE_EDITOR constant and ControlAttribute; this would indicate that the IDE is prompting your code for an instance of the class to use as a custom attribute editor. You can use the behavior context instance to get more specific information about the attribute, tag (property), method, extension instance, or extension interface that is the current context.

All Known Implementing Classes
  `DefaultEditorSupport`

## Field Summary

`public static final `String`` | `BEHAVIOR_ATTRIBUTE_EDITOR` The classname of the editor to use for an attribute.
`public static final `String`` | `BEHAVIOR_ATTRIBUTE_VALIDATOR` The classname for a validator to use for an attribute.
`public static final `String`` | `BEHAVIOR_EDIT_CALLBACK` Whether the user can add, remove, or change signatures of methods in a callback interface in an extension file.
`public static final `String`` | `BEHAVIOR_EDIT_METHOD` Whether the user can add, remove, or change signatures of methods in a control extension file.
`public static final `String`` | `BEHAVIOR_ICONS` Paths to icons to show on the method.
`public static final `String`` | `BEHAVIOR_MAINICON` The path to the icon to show as the main editing icon (XQuery map, SQL box, and so on).

## Method Summary

`public `Object`` | `getBehavior`(`String` behaviorName, `ControlBehaviorContext` context) Called by the IDE to retrieve specifics related to the specified behavior.

## Field Detail

### BEHAVIOR_ATTRIBUTE_EDITOR

    public static final String BEHAVIOR_ATTRIBUTE_EDITOR

  The classname of the editor to use for an attribute. This allows customization of the display and editing of an attribute value.
  - Context object associated with this behavior: `ControlAttribute```
  - Value to return: an implementation of an custom attribute editor, such as an extension of `AttributeEditorSimple``` or `AttributeEditorWizard```.
  - IDE default behavior: a default editor based on attribute type

### BEHAVIOR_ATTRIBUTE_VALIDATOR

    public static final String BEHAVIOR_ATTRIBUTE_VALIDATOR

  The classname for a validator to use for an attribute. This is generally not necessary if BEHAVIOR_ATTRIBUTE_EDITOR is not null, as the functionality is covered by the editor's onFinish() method.
  - Context object associated with this behavior: `ControlAttribute```
  - Value to return: an implementation of an attribute validator, `ValidateAttribute```.
  - IDE default behavior: any text is allowed in the attribute

### BEHAVIOR_EDIT_CALLBACK

    public static final String BEHAVIOR_EDIT_CALLBACK

  Whether the user can add, remove, or change signatures of methods in a callback interface in an extension file. If false, the new control wizard will have to create any needed callback methods.
  - Context object associated with this behavior: `ControlExtensionInterface``` for adding; `ControlMethod``` for deleting
  - Value to return: Boolean.TRUE to indicate that the user may edit; Boolean.FALSE to indicate that editing is not allowed.
  - IDE default behavior: Boolean.TRUE

### BEHAVIOR_EDIT_METHOD

    public static final String BEHAVIOR_EDIT_METHOD

  Whether the user can add, remove, or change signatures of methods in a control extension file. If false, the new control wizard will have to create any needed methods.
  - Context object associated with this behavior: `ControlExtensionInterface``` for adding; `ControlMethod``` for deleting
  - Value to return: Boolean.TRUE to indicate that the user may edit; Boolean.FALSE to indicate that editing is not allowed.
  - IDE default behavior: Boolean.TRUE

### BEHAVIOR_ICONS

    public static final String BEHAVIOR_ICONS

  Paths to icons to show on the method. The IDE is free to show only a limited number of these. They'll be cropped to 16x16.
  - Context object associated with this behavior: `ControlMethod```
  - Value to return: `List``` containing Strings specifying paths to icons
  - IDE default behavior: standard icons for buffer and conversation

### BEHAVIOR_MAINICON

    public static final String BEHAVIOR_MAINICON

  The path to the icon to show as the main editing icon (XQuery map, SQL box, and so on). The icon should be no larger than 32x24.
  - Context object associated with this behavior: `ControlMethod```
  - Value to return: a String specifying a path to the icon to use
  - IDE default behavior: a simple arrow with no icon

## Method Detail

### getBehavior(String, ControlBehaviorContext) Method

    public Object getBehavior(String behaviorName,
                              ControlBehaviorContext context)

Called by the IDE to retrieve specifics related to the specified behavior.
WARNING: the information in the context object passed in here is intended for use only during this call. Any information that editors or validators might later need should be copied out of the context object before returning from getBehavior().

#### Parameters

behaviorName
  An EditorSupport constant representing the name of the behavior which is being queried.

context
  The appropriate context object for the behavior. For behaviors that need no context, this will be null.

#### Returns

The behavior that the IDE should use for the given context. The type of object returned will depend on the behavorName. If null is returned, the default value will be used.