All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.ibm.beans.tools.assembly.SubAssembly

public interface interface SubAssembly
extends Serializable
This interface defines the methods that a class must support to be an assembly surface subassembly model.

Any meta-data used by a subassembly model must be directly or indirectly referenced by the object implementing this interface so that all session data needed to re-edit the assembly in the future can be properly saved. Each meta-data object to be saved must also belong to a class implementing the Serialization interface.

Note that only model-specific information should be associated with this object. User interface, or view, information should be handled by the subassembly view associated with the subassembly model.

See Also:
Assembly, SubAssemblyView, SubAssemblyGen

Method Index

 o addBean(BeanReference)
Adds a bean reference to the assembly.
 o addView(SubAssemblyView)
Adds a view to the active views of the model.
 o closeIfEmpty()
Requests that the model remove itself as a listener from any bean if it has no data associated with it.
 o createView(int)
Creates a new view for a subassembly model.
 o getModelName()
Determines the locale-specific name of the subassembly model.
 o getSubAssemblyGen()
Returns the subassembly generator object that performs code generation and bean initialization if necessary.
 o getViewName()
Returns an array of locale-specific view names supported by the subassembly model.
 o removeBean(BeanReference)
Removes a bean reference from the assembly.
 o removeView(SubAssemblyView)
Removes a view from the active views of the model.
 o selectBean(BeanReference)
Specifies which bean is currently selected.
 o setAssembly(Assembly)
Specifies the assembly with which the subassembly is associated.
 o setModifiable(boolean)
Specifies whether a user can change the subassembly model.

Methods

 o setAssembly
 public abstract void setAssembly(Assembly am)
Specifies the assembly with which the subassembly is associated.

Parameters:
am - The assembly with which this subassembly is associated.
 o addBean
 public abstract void addBean(BeanReference br)
Adds a bean reference to the assembly. This method is called by the assembly when a bean is added to the assembly. This method allows the subassembly model an opportunity to perform whatever introspection is necessary to add the new bean to its model.

Parameters:
br - The reference to the bean being added to the assembly.
 o removeBean
 public abstract void removeBean(BeanReference br)
Removes a bean reference from the assembly. This method is called by the assembly when a bean is removed from the assembly. This method allows the subassembly model an opportunity to perform whatever actions are necessary to remove the bean from its model.

Parameters:
br - The reference to the bean being removed from the assembly.
 o selectBean
 public abstract void selectBean(BeanReference br)
Specifies which bean is currently selected. This method is called by the assembly when a bean is selected by the user. This method allows the subassembly model an opportunity to update its associated views to reflect the selection status of the specified bean.

Parameters:
br - The reference to the selected bean. This parameter can be null indicating that no bean is selected.
 o setModifiable
 public abstract void setModifiable(boolean modify)
Specifies whether a user can change the subassembly model. This method is called by the assembly to tell the subassembly model whether the user is permitted to make changes to the subassembly model.

Parameters:
modify - An indication of whether the subassembly is modifiable or read-only. True indicates that a user can change a model; false, no chanegs are permitted.
 o closeIfEmpty
 public abstract boolean closeIfEmpty()
Requests that the model remove itself as a listener from any bean if it has no data associated with it. The assembly uses this method to determine if a model should be kept or discarded when all active views associated with it have been closed. If the model contains no data it will be discarded.

Returns:
true if the model is empty; false otherwise. If this method returns false, no actions are taken.
 o getModelName
 public abstract String getModelName()
Determines the locale-specific name of the subassembly model. This method is called by the assembly to determine the locale-specific name of the subassembly model. The name returned is added to the Views sub-menu of the assembly surface.

If the associated getViewName() method returns a non-null value, the model menu item added to the Views sub-menu will be a cascading menu item which will open to show the set of view names supported by the model; otherwise the model menu item will be a single menu item corresponding to the one and only view supported by the model.

Returns:
The locale-specific name of the subassembly model.
 o getViewName
 public abstract String[] getViewName()
Returns an array of locale-specific view names supported by the subassembly model. This method is called by the assembly to determine the locale-specific names of the views supported by the subassembly model.

If the model only has one view, and it is permissible to use the model name as the view name, then the model may return null. Otherwise, the model should return the array of names to be used to identify its different views.

The array of names returned is used to update the portion of the assembly tool menu bar that specifies the list of available subassembly model views. In addition, the array indexes are used by the createView() method to define a mapping between the view name and the corresponding subassembly view object to be created when the user selects a specified view from the menu.

Returns:
An array of locale-specific names of the views supported by the subassembly model.
 o createView
 public abstract SubAssemblyView createView(int viewNameIndex)
Creates a new view for a subassembly model. This method is called by the assembly to create a subassembly view object when the user selects a specified view from the assembly tool menu.

The viewNameIndex argument is an index into the array of names returned by the getViewName() method, and is used to identify which view supported by the subassembly model is to be created. If the model returns null as the value of the getViewName() method, then the index specified will always be 0.

Note that upon return, any user interface associated with the view should not yet be visible. The assembly will invoke the open() method on the subassembly view object returned by this method when it is time to make the user interface visible.

Parameters:
viewNameIndex - The index of the subassembly view object to create.
Returns:
A new instance of the requested view.
 o addView
 public abstract void addView(SubAssemblyView sav)
Adds a view to the active views of the model. This method is called by the assembly to inform the subassembly model that the view specified by the sav argument is active. It is then the responsibility of the subassembly model to update the active views list whenever changes occur to the model.

Note that the subassembly model should only update views marked as active by this method and should not automatically update any views it creates using the createView() method because the assembly invokes the addView() method after calling the createView() method when a new view is opened.

In addition, it is possible that a view may already be open (from a previous assembly being edited) when a subassembly model is created. In this case, the addView() method will not be preceded by a createView() method call.

Parameters:
sav - The view being added as an active view of the model.
 o removeView
 public abstract void removeView(SubAssemblyView sav)
Removes a view from the active views of the model. This method is called by the assembly when a subassembly model view is closed. This method allows the subassembly model an opportunity to remove the view from the list of views it maintains.

Parameters:
sav - The view being removed as an active view of the model.
 o getSubAssemblyGen
 public abstract SubAssemblyGen getSubAssemblyGen()
Returns the subassembly generator object that performs code generation and bean initialization if necessary. This method is called by the assembly when it begins the process of creating the bean represented by the current assembly. If the subassembly model needs to generate code or initialize instance data in the bean being created, then it must return a subassembly generator object that will perform the necessary code generation and initialization if necessary.

Because SubAssemblyGen is an interface, it is possible for the subassembly model to implement the interface and return itself as the result, instead of creating a separate helper class.

Returns:
the subassembly generator object to use for generating and initializing the bean being assembled. This method can return null when the bean being assembled does not require either generation or initialization.

All Packages  Class Hierarchy  This Package  Previous  Next  Index