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

public interface IProperty
extends `IPropertyNode`

This interface extends IPropertyNode to provide property value access and editing. Nodes in an IElement's property heirarchy that have values should implement this interface. In addtion to methods for getting and setting the value object, this interface returns the editor component that the property view will use to display and edit the value.

Normally the property editor returned by this interface will be configured to handle all necessary validation of user input. However, the validate callback in this interface provides an additional opportunity for validation checking of an edited value.

As an example, the default property text field editor may be configured to prohibit empty strings and to restrict certain character input. However, the property value may need a name uniqueness check which the IProperty implementor may choose to put inside the IProperty.validate callback which searches the containing structure of the property's IElement.

Related Topics

``IPropertyNode``
``PropertyError``

All Known Implementing Classes
  `DefaultProperty`

All Superinterfaces
  `IPropertyNode`

## Method Summary

`public `IPropertyEditor`` | `getEditor`() Returns the component used to display and edit the property value in the IDE's property view.
`public `Object`` | `getValue`() Returns the value of this property.
`public boolean` | `hasDefault`() Returns whether this property has a default value.
`public boolean` | `isDefault`() Returns whether the current value is the default.
`public boolean` | `isEditable`() Returns whether this property can be can be changed.
`public void` | `resetToDefault`() Sets the value of this property to its default value.
`public void` | `setValue`(`Object` value) Sets the value of this property.
`public `PropertyError`` | `validate`(`Object` value) Called by the property editor to determine whether the edited object is an acceptable value for this property.

Methods from interface `com.bea.ide.ui.propertyeditor.`IPropertyNode``
``getAction`, `getChildren`, `getDescription`, `getLabel``

## Method Detail

### getEditor() Method

    public IPropertyEditor getEditor()

Returns the component used to display and edit the property value in the IDE's property view.

#### Returns

IPropertyEditor

### getValue() Method

    public Object getValue()

Returns the value of this property. The PropertyEditor returned by getEditor must be able to handle this type of object.

#### Returns

value object.

### hasDefault() Method

    public boolean hasDefault()

Returns whether this property has a default value. If false, then isDefault and resetToDefault will not be used. If true, then if isDefault is true, then resetToDefault should set the property value to its default.

### isDefault() Method

    public boolean isDefault()

Returns whether the current value is the default. The property editor will display default and non-default values differently.

### isEditable() Method

    public boolean isEditable()

Returns whether this property can be can be changed. If false, setValue and resetToDefault should not be called on this property.

### resetToDefault() Method

    public void resetToDefault()

Sets the value of this property to its default value. Will only be called if the property has a default, is editable, and is not currently a default.

### setValue(Object) Method

    public void setValue(Object value)

Sets the value of this property. Called by the property editor to commit an edited property value. Property editor validation checks will be performed and the validate callback will be made before setValue is called.

#### Parameters

value
  Property value object.

### validate(Object) Method

    public PropertyError validate(Object value)

Called by the property editor to determine whether the edited object is an acceptable value for this property. This method will be called by the property editor before it calls setValue.

Note that the property editor may be configured to do all necessary input validation and so no additional validation may be needed in this callback.

A null return indicates the value is valid.

#### Parameters

value
  Edited property value to validate.

#### Returns

PropertyError if there is a validation problem, null if the value is valid.