# PropertyCustomizer

Import: `import com.install4j.api.beaninfo.PropertyCustomizer;`

```java
interface PropertyCustomizer
```

Customizer component for a property that is used in a dialog. Implementing classes must extend `Component`.
A Property customizer is specified in a [`property converter`](PropertyConverter.md).
Property converters are registered on a per-bean basis with
[`Install4JBeanInfo.setPropertyConverters`](Install4JBeanInfo.md#setpropertyconverters-propertyconverter).


**See also:**

- [PropertyConverter.getPropertyCustomizerClass](PropertyConverter.md#getpropertycustomizerclass)

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`setValue(Object, Bean)`](#setvalue-object-bean) | `void` | Sets the property value and the bean. |
| [`ok()`](#ok) | `boolean` | Called if the property customizer dialog is exited with the OK button. |
| [`cancel()`](#cancel) | `void` | Called if the property customizer dialog is exited with the Cancel button. |
| [`isModified()`](#ismodified) | `boolean` | Called by the install4j IDE when the dialog is closed to determine if the user has made any modifications. |
| [`setParentWindow(Window)`](#setparentwindow-window) | `void` | Called by the install4j IDE after the property customizer is initialized and sets the parent window. |

### setValue(Object, Bean)

```java
void setValue(Object value, Bean bean)
```

Sets the property value and the bean. The install4j IDE will call this method just before
the property customizer dialog is shown.


**Parameters:**

- `value` — the property value
- `bean` — the bean

### ok()

```java
boolean ok()
```

Called if the property customizer dialog is exited with the OK button.
If the user input is not valid, you can return `false` in order to
prevent the dialog from closing. You should display a warning message in that case.


**Returns:** if the dialog should be closed

### cancel()

```java
void cancel()
```

Called if the property customizer dialog is exited with the Cancel button.
If you have already modified the bean, you should revert it to its original state.

### isModified()

```java
boolean isModified()
```

Called by the install4j IDE when the dialog is closed to determine if the
user has made any modifications.


**Returns:** `true` if modified

### setParentWindow(Window)

```java
void setParentWindow(Window window)
```

Called by the install4j IDE after the property customizer is initialized and sets the parent window.


**Parameters:**

- `window` — the parent window

