# com.bea.ide.control
ControlWizardSimple Class

public class ControlWizardSimple
extends `Object`

A single pane wizard dialog for inserting control instances, or creating JCX files.
This class provides several bit flags describing dialog configuration:

- CONFIG_INSERT_INSTANCE - Insert instance with no option to create new JCX file
- CONFIG_CREATE_EXTENSION_FILE | CONFIG_INSERT_INSTANCE - Insert instance with option to create new JCX file (tool palette)
- CONFIG_CREATE_EXTENSION_FILE - Create new JCX file without inserting instance variable anywhere (file...new menu)

Hierarchy
  `Object`
  `ControlWizardSimple`

Direct Known Subclasses
  `ControlWizard`

## Nested Class Summary

`public static class` | `ControlWizardSimple.TagAttributeList` Provides a way to capture a property annotation and its attributes for passing to the IDE.
`public static class` | `ControlWizardSimple.TagAttributeValue` Provides a way to capture a property attribute and its values for passing to the IDE.

## Field Summary

`public static final int` | `CONFIG_CREATE_EXTENSION_FILE` Configuration bit indicating that this instance can create an extension file.
`public static final int` | `CONFIG_INSERT_INSTANCE` Configuration bit indicating that this instance can generate tags needed to insert a control instance variable.
`public static final int` | `CONFIG_NO_FACTORY` Configuration bit indicating that this instance should not prompt for "use as a factory".
`public static final int` | `CONFIG_USE_EXISTING` Configuration bit indicating that this instance can use an existing extension file.

## Constructor Summary

ControlWizardSimple()

## Method Summary

`public `JComponent`` | `getComponent`() Called by the IDE to retrieve the custom panel for display in an insert dialog.
`public int` | `getConfigurationInfo`() Called by the IDE to determine what this wizard is capable of doing.
`public `EditorContext`` | `getContext`() Provides a way for subclasses to get the context as needed.
`public `String`` | `getExtensionFileContent`() Called by the IDE to get the full text of the JCX file to be created.
`public `ArrayList`` | `getInstanceAnnotations`() Called by the IDE To retrieve a list of TagAttributeList objects for inserting into the container file with the instance member.
`public `Issue`[]` | `getIssues`() When you return `false` in the onFinish method, the IDE calls this method to retrieve Issue objects containing messages that should be displayed to the user.
`public boolean` | `onFinish`() Called by the IDE when the user click the OK/Create button in the insert dialog; provides a place for you to validate values entered by the user in the dialog.
`public void` | `setConfiguration`(int config) Sets configuration bit flags being used for this invocation of the wizard.
`public void` | `setContext`(`EditorContext` ctx) Called by the IDE to pass to this wizard an EditorContext instance, which provides a way for the wizard to interact with the IDE.
`public void` | `setName`(`String` name) Called by the IDE to set the root name of the JCX interface.
`public void` | `setPackage`(`String` packageName) Called by the IDE to set the package name for the JCX interface the user is trying to create.

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Detail

### CONFIG_CREATE_EXTENSION_FILE

    public static final int CONFIG_CREATE_EXTENSION_FILE

  Configuration bit indicating that this instance can create an extension file.

### CONFIG_INSERT_INSTANCE

    public static final int CONFIG_INSERT_INSTANCE

  Configuration bit indicating that this instance can generate tags needed to insert a control instance variable. All wizards should support this.

### CONFIG_NO_FACTORY

    public static final int CONFIG_NO_FACTORY

  Configuration bit indicating that this instance should not prompt for "use as a factory".

### CONFIG_USE_EXISTING

    public static final int CONFIG_USE_EXISTING

  Configuration bit indicating that this instance can use an existing extension file. It is not necessary to set this if CONFIG_CREATE_EXTENSION_FILE is set.

## Constructor Detail

### ControlWizardSimple

    public ControlWizardSimple()

## Method Detail

### getComponent() Method

    public JComponent getComponent()

Called by the IDE to retrieve the custom panel for display in an insert dialog. When called from the Insert menu, the wizard will present this panel as "Step 3".

#### Returns

The panel to use as user interface.

### getConfigurationInfo() Method

    public int getConfigurationInfo()

Called by the IDE to determine what this wizard is capable of doing. Generally a number of CONFIG_* options are or-ed together. For example, a wizard that can create an extension and/or insert a variable would return (CONFIG_CREATE_EXTENSION_FILE | CONFIG_INSERT_INSTANCE).

#### Returns

The ControlWizardSimple constant(s) representing the configuration.

### getContext() Method

    public EditorContext getContext()

Provides a way for subclasses to get the context as needed.

### getExtensionFileContent() Method

    public String getExtensionFileContent()

Called by the IDE to get the full text of the JCX file to be created. This will never be called if the current config does not include CONFIG_CREATE_EXTENSION_FILE.

#### Returns

The contents of the new JCX file.

### getInstanceAnnotations() Method

    public ArrayList getInstanceAnnotations()

Called by the IDE To retrieve a list of TagAttributeList objects for inserting into the container file with the instance member. This will never be called if the current config does not include CONFIG_INSERT_INSTANCE.

#### Returns

A list of TagAttributeList objects containing the instance annotations.

### getIssues() Method

    public Issue[] getIssues()

When you return `false` in the onFinish method, the IDE calls this method to retrieve Issue objects containing messages that should be displayed to the user. The messages should describe what is invalid and what the user can do to fix it. If you return `null`, no messages will be shown.

#### Returns

An array of Issue objects containing messages for the user.

### onFinish() Method

    public boolean onFinish()

Called by the IDE when the user click the OK/Create button in the insert dialog; provides a place for you to validate values entered by the user in the dialog. If you return false to indicate that values are invalid, the IDE will call the getIssues method to retrieve an array of Issue objects containing messages that should be displayed to the user.

#### Returns

`true` to indicate that value are valid and the control may be inserted; `false` to indicate that the values are invalid.

### setConfiguration(int) Method

    public void setConfiguration(int config)

Sets configuration bit flags being used for this invocation of the wizard. All controls should handle CONFIG_INSERT_INSTANCE.
If a wizard can create an extension file, it should be prepared to receive both CREATE_EXTENSION by itself as well as CREATE_EXTENSTION | CREATE_INSTANCE

#### Parameters

config
  The configuration bit flag to use.

### setContext(EditorContext) Method

    public void setContext(EditorContext ctx)

Called by the IDE to pass to this wizard an EditorContext instance, which provides a way for the wizard to interact with the IDE. An EditorContext object provides a way to start a browser, start the server, get the directory for the project in which the control lives, and so on.

#### Parameters

ctx
  An EditorContext object representing the current context.

### setName(String) Method

    public void setName(String name)

Called by the IDE to set the root name of the JCX interface. This gets set as the user changes the edit control to allow for enabling/disabling in the dialog. It is set to null for invalid class names. This will never be called if the current configuration does not include CONFIG_CREATE_EXTENSION_FILE. You can use this value in building the JCX file's content.

#### Parameters

name
  The name of the JCX interface the control's user is proposing.

### setPackage(String) Method

    public void setPackage(String packageName)

Called by the IDE to set the package name for the JCX interface the user is trying to create. This gets set as the user changes the edit control to allow for enabling/disabling in the dialog. It is set to null for invalid packages. This will never be called if the current config does not include CONFIG_CREATE_EXTENSION_FILE. You can use this value in building the JCX file's content.

#### Parameters

packageName
  The name of the package in which the proposed JCX will be created.