A nested manager can be expanded or
collapsed. When collapsed, a nested manager has a different
representation, as illustrated in the following figure.
![collapsemanagers.gif](../../JViews_Framework/usradvfwork/_media/collapsemanagers_default.gif)
Expanded and collapsed manager
To expand/collapse a manager, the
IlvManager
class provides the following methods:
When a nested manager is collapsed, the
contents of the manager and the frame are no longer drawn. Only the
new graphic representation is shown.
Defining the collapsed representation
The graphic representation that defines the collapsed manager is
a graphic object, an instance of IlvGraphic. This allows you to define any
kind of collapsed representation for your manager. The default
graphic object used to draw a collapsed manager is an instance of
the class: IlvDefaultCollapsedGraphic, which
represents a folder above the name of the manager. To change this
default representation, you use the following methods of the
class
IlvManager
:
void setCollapsedGraphic(IlvGraphic graphic)
IlvGraphic getCollapsedGraphic()
Note that the graphic object used for the
collapsed representation cannot be shared by several managers.
When the manager is collapsing, the
collapsed graphic will be placed at the center of the area of the
manager. When the manager is expanding, it will move so that its
center will be placed at the center of the collapsed graphic.
Expand/collapse events
When the manager is expanded or collapsed, it fires an event to
notify you of this change. The event is defined by the class ManagerExpansionEvent.
To listen to such events, you must create a listener that
implements the ManagerExpansionListener interface, which
defines the two methods:
- managerCollapsed which is called after the manager is collapsed.
- managerExpanded which is called before the manager is expanded.
You will then register your listener using the following method
of the
IlvManager
class:
void addManagerExpansionListener(ManagerExpansionListener listener)