Skip to content

CollapsibleGroup

Mark Reeves edited this page Jan 3, 2018 · 10 revisions

CollapsibleGroup is a grouping component for WCollapsible and WTabSet. The purpose of a CollapsibleGroup is to define those collapsible components which are to be controlled by a WCollapsibleToggle. Note though that a WTabSet can only be an effective member of a CollapsibleGroup if the WTabSet has TabSetType.ACCORDION and its single property is not true.

Contents

Why use CollapsibleGroup

CollapsibleGroup has one use: to allow a WCollapsibleToggle to control WCollapsible and / or WTabSet components.

Creating a CollapsibleGroup

CollapsibleGroup has a simple (default) constructor.

CollapsibleGroup group = new CollapsibleGroup();

Associating a WCollapsibleToggle

A CollapsibleGroup is only useful if it is associated with a WCollapsibleToggle. If the UI does not use a WCollapsibleToggle there is no point having a CollapsibleGroup.

// A WCollapsibleToggle can be associated with a
// CollapsibleGroup during construction
WCollapsibleToggle toggle = new WCollapsibleToggle(group);

// alternately a WCollapsibleToggle can be associated with a group
group.setCollapsibleToggle(toggle);

// or even the other way around
toggle.setGroup(group);

Adding collapsible components

A WCollapsible may be associated with a CollapsibleGroup during instantiation or by using a setter as demonstrated below. A WTabSet may only be associated with a CollapsibleGroup using the setter.

// A WCollapsible may be added to the group using a constructor:
WCollapsible collapsible = new WCollapsible(collapsibleContent,
    label, mode, group);

// or an existing WCollapsible may be added to a group
// given WCollapsible collapsible2
collapsible2.setGroup(group);

// WTabSet can also be added to a CollapsibleGroup
// given WTabSet accordion
accordion.setGroup(group);

Related components

Further information

Clone this wiki locally