org.gnu.gtk
Class Expander

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.GObject
          extended by org.gnu.gtk.GtkObject
              extended by org.gnu.gtk.Widget
                  extended by org.gnu.gtk.Container
                      extended by org.gnu.gtk.Bin
                          extended by org.gnu.gtk.Expander

public class Expander
extends Bin

A container which can hide its child.

An Expander allows the user to hide or show its child by clicking on an expander triangle similar to the triangles used in a TreeView.


Constructor Summary
Expander(org.gnu.glib.Handle handle)
           
Expander(java.lang.String label, boolean hasMnemonic)
          Creates a new Expander using label as the text of the label.
 
Method Summary
 void addListener(ExpanderListener listener)
          Register an object to handle dialog events.
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 EventType getEventType(java.lang.String signal)
           
 boolean getExpanded()
          Queries an Expander and returns its current state.
static Expander getExpander(org.gnu.glib.Handle handle)
          Internal static factory method to be used by Java-Gnome only.
 java.lang.String getLabel()
          Fetches the text from the label of the Expander, as set by setLabel(String).
 Widget getLabelWidget()
          Retrieves the label widget for the frame.
 int getSpacing()
          Gets the value set by setSpacing(int).
static Type getType()
          Retrieve the runtime type used by the GLib library.
 boolean getUseMarkup()
          Returns whether the label's text is interpreted as marked up with the Pango text markup language.
 boolean getUseUnderline()
          Returns whether an embedded underline in the Expander label indicates a mnemonic.
 void removeListener(ExpanderListener listener)
          Removes a listener
 void setExpanded(boolean expanded)
          Sets the state of the expander.
 void setLabel(java.lang.String label)
          Sets the text of the label of the expander to label.
 void setLabelWidget(Widget label)
          Set the label widget for the Expander.
 void setSpacing(int spacing)
          Sets the spacing field of Expander, which is the number of pixels to place between Expander and the child.
 void setUseMarkup(boolean useMarkup)
          Sets whether the text of the label contains markup in Pango's text markup language.
 void setUseUnderline(boolean useUnderline)
          If true, an underline in the text of the Expander label indicates the next character should be used for the mnemonic accelerator key.
 
Methods inherited from class org.gnu.gtk.Bin
getChild
 
Methods inherited from class org.gnu.gtk.Container
add, addListener, getBooleanChildProperty, getBorderWidth, getChildProperty, getChildren, getIntChildProperty, getResizeMode, remove, removeListener, resizeChildren, setBooleanChildProperty, setBorderWidth, setChildProperty, setIntChildProperty, setResizeMode
 
Methods inherited from class org.gnu.gtk.Widget
activate, addAccelerator, addEvents, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, canActivateAccel, createContext, createLayout, draw, drawArea, drawArea, finish, getAccessible, getAllocation, getCanFocus, getColormap, getContext, getData, getDisplay, getDragData, getExtensionEvents, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getWidget, getWindow, grabDefault, grabFocus, hasFocus, hasScreen, hide, hideAll, highlight, highlight, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeAccelerator, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setCanFocus, setColormap, setDoubleBuffered, setDragDestination, setDragIcon, setDragIconPixbuf, setDragIconStock, setDragSource, setEvents, setExtensionEvents, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll, unHighlight, unHighlight
 
Methods inherited from class org.gnu.gtk.GtkObject
destroy, sink
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class org.gnu.glib.Struct
equals, getHandle, getNullHandle, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expander

public Expander(java.lang.String label,
                boolean hasMnemonic)
Creates a new Expander using label as the text of the label.

If hasMnemonic is true, the label will be interpreted as containing Mnemonic characters (keyboard accelerators). If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the button.

Parameters:
label - the text of the label
hasMnemonic - see above description

Expander

public Expander(org.gnu.glib.Handle handle)
Method Detail

getExpander

public static Expander getExpander(org.gnu.glib.Handle handle)
Internal static factory method to be used by Java-Gnome only.


setExpanded

public void setExpanded(boolean expanded)
Sets the state of the expander. Set to TRUE, if you want the child widget to be revealed, and FALSE if you want the child widget to be hidden.

Parameters:
expanded - whether the child widget is revealed

getExpanded

public boolean getExpanded()
Queries an Expander and returns its current state. Returns TRUE if the child widget is revealed.

Returns:
the current state of the expander
See Also:
getExpanded()

setSpacing

public void setSpacing(int spacing)
Sets the spacing field of Expander, which is the number of pixels to place between Expander and the child.

Parameters:
spacing - distance between the Expander and child in pixels

getSpacing

public int getSpacing()
Gets the value set by setSpacing(int).

Returns:
spacing between the expander and child in pixels

setLabel

public void setLabel(java.lang.String label)
Sets the text of the label of the expander to label. This will also clear any previously set labels.

Parameters:
label - a string

getLabel

public java.lang.String getLabel()
Fetches the text from the label of the Expander, as set by setLabel(String). If the label text has not been set the return value will be NULL. This will be the case if you create an empty button with Button.Button() to use as a container.

Returns:
the text of the label widget

setUseUnderline

public void setUseUnderline(boolean useUnderline)
If true, an underline in the text of the Expander label indicates the next character should be used for the mnemonic accelerator key.

Parameters:
useUnderline - TRUE if underlines in the text indicate mnemonics

getUseUnderline

public boolean getUseUnderline()
Returns whether an embedded underline in the Expander label indicates a mnemonic.

Returns:
TRUE if an embedded underline in the Expander label indicates the mnemonic accelerator keys.
See Also:
setUseUnderline(boolean)

setUseMarkup

public void setUseMarkup(boolean useMarkup)
Sets whether the text of the label contains markup in Pango's text markup language.

Parameters:
useMarkup - TRUE if the label's text should be parsed for markup
See Also:
Label.setMarkup(String)

getUseMarkup

public boolean getUseMarkup()
Returns whether the label's text is interpreted as marked up with the Pango text markup language.

Returns:
TRUE if the label's text will be parsed for markup
See Also:
setUseMarkup(boolean)

setLabelWidget

public void setLabelWidget(Widget label)
Set the label widget for the Expander. This is the widget that will appear embedded alongside the Expander arrow.

Parameters:
label - the new label widget

getLabelWidget

public Widget getLabelWidget()
Retrieves the label widget for the frame.

Returns:
the label widget, or NULL if there is none
See Also:
setLabelWidget(Widget)

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.


addListener

public void addListener(ExpanderListener listener)
Register an object to handle dialog events.

See Also:
ExpanderListener

removeListener

public void removeListener(ExpanderListener listener)
Removes a listener

See Also:
addListener(ExpanderListener)

getEventListenerClass

public java.lang.Class getEventListenerClass(java.lang.String signal)
Overrides:
getEventListenerClass in class Container

getEventType

public EventType getEventType(java.lang.String signal)
Overrides:
getEventType in class Container