org.gnome.gtk
Class Expander
Object
org.freedesktop.bindings.Pointer
org.freedesktop.bindings.Proxy
org.gnome.glib.Object
org.gnome.gtk.Object
org.gnome.gtk.Widget
org.gnome.gtk.Container
org.gnome.gtk.Bin
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 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.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 |
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
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