public interface FormEnvironment
The form environment gives access to form components in a form panel as well as to other design time or runtime services related to form components.
It provides access to the ComponentTuple of a form component as well as to the IDs that the framework assigns to form components. Furthermore, the form environment contains utility methods that can be used at design time. This class is passed to the containing screen as well as to every form component.
Screen.setFormPanel(javax.swing.JPanel, FormEnvironment)
,
FormComponent.setFormEnvironment(FormEnvironment)
Method Summary | |
---|---|
void |
addDesignTimeChangeListener(javax.swing.event.ChangeListener changeListener)
If your form component would like to be notified when the list of form components changes at design time, you can add a change listener here. |
ComponentTuple |
getComponentTuple(FormComponent formComponent)
Get the ComponentTuple associated with a form component. |
java.lang.String |
getDesignTimeName(FormComponent formComponent)
At design time, the install4j GUI allows the user to name instances of form components in a form. |
FormComponent |
getFormComponentById(java.lang.String id)
Get the form component of a certain ID. |
FormComponent[] |
getFormComponents()
Returns all form components that are contained in the same form. |
java.lang.String |
getId(FormComponent formComponent)
Get the ID that the framework associates with a form component. |
Screen |
getScreen()
Get the form screen associated with this form environment. |
boolean |
handleConsole(Console console)
Handle console mode for all form components in a form. |
boolean |
isDesignTime()
Returns whether the form component has been instantiated at design time. |
void |
removeDesignTimeChangeListener(javax.swing.event.ChangeListener changeListener)
Remove a change listener added with addDesignTimeChangeListener. |
Method Detail |
---|
FormComponent[] getFormComponents()
FormComponent.setFormEnvironment(FormEnvironment)
java.lang.String getId(FormComponent formComponent)
The ID can be transformed back to the form component with the getFormComponentById method.
formComponent
- the form component whose ID should be returned
getFormComponentById(String)
FormComponent getFormComponentById(java.lang.String id)
id
- the ID of the form component
getId(FormComponent)
ComponentTuple getComponentTuple(FormComponent formComponent)
formComponent
- the form component whose ComponentTuple should be returned
boolean handleConsole(Console console) throws UserCanceledException
console
- the Console object as passed to the handleConsole method of the containing screen.
UserCanceledException
- if the user cancels a question or notice. This exception can be passed on to the framework.FormComponent.handleConsole(com.install4j.api.screens.Console)
,
Screen.handleConsole(com.install4j.api.screens.Console)
boolean isDesignTime()
void addDesignTimeChangeListener(javax.swing.event.ChangeListener changeListener)
This method has no effect at runtime.
changeListener
- the listenervoid removeDesignTimeChangeListener(javax.swing.event.ChangeListener changeListener)
This method has no effect at runtime.
changeListener
- the listenerjava.lang.String getDesignTimeName(FormComponent formComponent)
formComponent
- the form component whose name should be returned.
Screen getScreen()