net.sf.genuine.organizer
Interface ComponentManager

All Known Subinterfaces:
InternalComponentManager
All Known Implementing Classes:
DefaultComponentManager

public interface ComponentManager

The component manager is responsible for all graphical components that can be shown, for example, in internal frames. This manager can be used to show and hide those components and to change some of their settings.

Author:
Tim Wellhausen

Method Summary
 void addComponentListener(java.lang.String moduleId, java.lang.String componentId, java.lang.String instanceId, ComponentListener listener)
          Adds a listener for the component that is identified by the given module id, component id, and instance id so that the listener is notified when the component is shown, hidden, activated, or deactivated.
 void changeComponentTitle(java.lang.String moduleId, java.lang.String componentId, java.lang.String instanceId, java.lang.String title)
          Changes the title of the component that is identified by the given module id, component id, and instance id.
 void hideComponent(java.lang.String moduleId, java.lang.String componentId, java.lang.String instanceId)
          Hides the component that is identified by the given module id, component id, and instance id.
 void removeComponentListener(java.lang.String moduleId, java.lang.String componentId, java.lang.String instanceId, ComponentListener listener)
          Removes a listener from the component that is identified by the given module id, component id, and instance id.
 void setDefaultButton(java.lang.String moduleId, java.lang.String componentId, java.lang.String instanceId, GenuineButton button)
          Sets the given button as default button of the frame into which the component that is identified by the given module id, component id, and instance id is embedded.
 void showComponent(java.lang.String moduleId, java.lang.String componentId)
          Shows the visual component that is identified by the given module id and component id.
 void showComponent(java.lang.String moduleId, java.lang.String componentId, java.lang.String instanceId)
          Shows the visual component that is identified by the given module id, component id, and instance id.
 

Method Detail

showComponent

public void showComponent(java.lang.String moduleId,
                          java.lang.String componentId)
Shows the visual component that is identified by the given module id and component id.

If there may be only one instance of the component defined, that instance is shown. If there may be multiple instances of the component, a new instance is created and shown.

Whether there should be only one instance or whether multiple instances are desired has to be defined in the XML configuration data of the visual component.

If a new component instance is created, Module.createVisualComponent(String, String) is called by the component manager. The module may keep track of all instances of a component that have been created in that method.

Throws:
java.lang.IllegalArgumentException - Thrown if no such component exists.
java.lang.IllegalStateException - Thrown if the component cannot be shown.

showComponent

public void showComponent(java.lang.String moduleId,
                          java.lang.String componentId,
                          java.lang.String instanceId)
Shows the visual component that is identified by the given module id, component id, and instance id. This method does not create any component instances. Passing an instance identifier for a non-existing component results in an error.

Throws:
java.lang.IllegalArgumentException - Thrown if no such component instance exists.
java.lang.IllegalStateException - Thrown if the component cannot be shown.

hideComponent

public void hideComponent(java.lang.String moduleId,
                          java.lang.String componentId,
                          java.lang.String instanceId)
Hides the component that is identified by the given module id, component id, and instance id.

Throws:
java.lang.IllegalArgumentException - Thrown if no such component exists.
java.lang.IllegalStateException - Thrown if the component cannot be hidden.

changeComponentTitle

public void changeComponentTitle(java.lang.String moduleId,
                                 java.lang.String componentId,
                                 java.lang.String instanceId,
                                 java.lang.String title)
Changes the title of the component that is identified by the given module id, component id, and instance id.

Throws:
java.lang.IllegalArgumentException - Thrown if no such component exists.

setDefaultButton

public void setDefaultButton(java.lang.String moduleId,
                             java.lang.String componentId,
                             java.lang.String instanceId,
                             GenuineButton button)
Sets the given button as default button of the frame into which the component that is identified by the given module id, component id, and instance id is embedded.

Throws:
java.lang.IllegalArgumentException - Thrown if no such component exists.

addComponentListener

public void addComponentListener(java.lang.String moduleId,
                                 java.lang.String componentId,
                                 java.lang.String instanceId,
                                 ComponentListener listener)
Adds a listener for the component that is identified by the given module id, component id, and instance id so that the listener is notified when the component is shown, hidden, activated, or deactivated.

Throws:
java.lang.IllegalArgumentException - Thrown if no such component exists.

removeComponentListener

public void removeComponentListener(java.lang.String moduleId,
                                    java.lang.String componentId,
                                    java.lang.String instanceId,
                                    ComponentListener listener)
Removes a listener from the component that is identified by the given module id, component id, and instance id.

Throws:
java.lang.IllegalArgumentException - Thrown if no such component exists.