java-gnome version 4.0.15

org.gnome.gtk
Class Expander

Object
  extended by org.freedesktop.bindings.Pointer
      extended by org.freedesktop.bindings.Proxy
          extended by org.gnome.glib.Object
              extended by org.gnome.gtk.Object
                  extended by org.gnome.gtk.Widget
                      extended by org.gnome.gtk.Container
                          extended by org.gnome.gtk.Bin
                              extended by org.gnome.gtk.Expander

public class Expander
extends Bin

A Container that can hide its child. It can be in two states: one, called "expanded", where the child Widget is shown; and another where the child Widget is "hidden". In both states, it shows a control, usually a little triangle, that the user can click to change between both states, i.e. to alternatively show or hide the child.

This Container is useful for hiding advanced options from a Dialog, while still providing a way to let users access those options. You usually specify a text label that is show near the expander triangle that contains a brief description of the hidden elements.

To add the child Widget, you should use the Container add() method, as follows:

 Widget advancedOptionsWidget;
 Expander advancedOptions;
 
 // create a Widget with some options we want to hide 
 advancedOptionsWidget = ... 
 advancedOptions = new Expander("Advanced Options");
 advancedOptions.add(advancedOptionsWidget);
 
Note that the child Widget is hidden by default, you can use the setExpanded() method to show it from the beginning.

Since:
4.0.7
Author:
Vreixo Formoso

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.EnterNotifyEvent, Widget.ExposeEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.UnmapEvent, Widget.VisibilityNotifyEvent
 
Constructor Summary
Expander(String label)
          Create a new Expander with the given label.
 
Method Summary
 boolean getExpanded()
          Get the expanded state of this Expander, i.e., whether its child is shown or hidden.
 void setExpanded(boolean expanded)
          Set the state of this Expander.
 
Methods inherited from class org.gnome.gtk.Bin
getChild
 
Methods inherited from class org.gnome.gtk.Container
add, getChildren, remove, setBorderWidth
 
Methods inherited from class org.gnome.gtk.Widget
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getRequisition, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, modifyBackground, modifyBase, modifyFont, modifyText, queueDraw, queueDrawArea, setCanDefault, setCanFocus, setColormap, setEvents, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
 
Methods inherited from class org.freedesktop.bindings.Pointer
toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Expander

public Expander(String label)
Create a new Expander with the given label. Underscore characters will be interpreted as marking mnemonic keys.

Since:
4.0.7
Method Detail

getExpanded

public boolean getExpanded()
Get the expanded state of this Expander, i.e., whether its child is shown or hidden.

Since:
4.0.7

setExpanded

public void setExpanded(boolean expanded)
Set the state of this Expander.

Parameters:
expanded - true to show the child Widget, false to hide it.
Since:
4.0.7


java-gnome