# com.bea.ide.ui.propertyeditor
IPropertyEditor Interface

public interface IPropertyEditor

This component manages display and editing of a property value in the IDE's property view. Mouse over, selection, and focus rendering will be handled by this class, as well as customizable formatting of the value string. Some PropertyEditor implementations support editing in place in the property table, selection from a drop-down panel and/or use of custom editor dialogs. PropertyEditors allowing keyboard input will support customizable filtering and validation.

A PropertyEditor is created with a reference to an IProperty which is used to get and set the property value as well provide any additional validation of edited values.

Related Topics

``IProperty``
``PropertyError``

All Known Implementing Classes
  `DefaultPropertyEditor`, `ComboBoxPropertyEditor`

## Method Summary

`public void` | `activate`(`FocusListener` l) Notification that this editor has been added to the property view.
`public void` | `deactivate`(`FocusListener` l) Notification that this editor is about to be removed from the property view.
`public `Component`` | `getComponent`() Returns the component which will be added to the property view for display and editing of the property value.
`public `IProperty`` | `getProperty`() Returns the IProperty whose value this editor displays.
`public boolean` | `setFocused`() Called by the property view when this property editor should request focus to a component in its display.

## Method Detail

### activate(FocusListener) Method

    public void activate(FocusListener l)

Notification that this editor has been added to the property view. The editor should read its IProperty settings and redisplay.

The focus listener passed in should be added to all focusable components in the editor. The property view will update its selection highlighting for this property based on the focus gain and loss events received by this listener.

Note that if the property editor uses popup windows, it may need to add this focus listener to any focusable components in the popup window.

#### Parameters

l
  the focus listener

Related Topics

``FocusListener``

### deactivate(FocusListener) Method

    public void deactivate(FocusListener l)

Notification that this editor is about to be removed from the property view.

The listener should be removed from any focusable components that it was added to in addFocusListener. Additionally, the editor shoud detach any of it's own focus listeners or input verifier.

#### Parameters

l
  the focus listener

Related Topics

``FocusListener``

### getComponent() Method

    public Component getComponent()

Returns the component which will be added to the property view for display and editing of the property value.

Note that this method may be called multiple times.

#### Returns

Component

### getProperty() Method

    public IProperty getProperty()

Returns the IProperty whose value this editor displays.

#### Returns

IProperty

### setFocused() Method

    public boolean setFocused()

Called by the property view when this property editor should request focus to a component in its display.

Return value should reflect whether the focus request is guaranteed to fail or is likely to succeed. If the property editor already has focus, return true (note that this differs from the behavior of the Component and JComponent request focus methods which return false if the component already has focus).

Use of Component/JComponent.requestFocus(boolean temporary) is recommended (despite swing/awt java doc to the contrary). It is the only focus request method that both gives a return value, and will change active windows if necessary.

#### Returns

`false` if the focus request is guaranteed to fail; `true` if it is likely to succeed