org.gnu.gtk
Class Expander

java.lang.Object
  extended byorg.gnu.glib.GObject
      extended byorg.gnu.gtk.GtkObject
          extended byorg.gnu.gtk.Widget
              extended byorg.gnu.gtk.Container
                  extended byorg.gnu.gtk.Bin
                      extended byorg.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.


Field Summary
 
Fields inherited from class org.gnu.glib.GObject
eventsInitialized
 
Constructor Summary
Expander(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.
protected  void fireExpanderEvent(ExpanderEvent event)
           
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 EventType getEventType(java.lang.String signal)
           
 boolean getExpanded()
          Queries an Expander and returns its current state.
 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.
protected static boolean gtk_expander_get_expanded(Handle expander)
           
protected static Handle gtk_expander_get_label_widget(Handle expander)
           
protected static java.lang.String gtk_expander_get_label(Handle expander)
           
protected static int gtk_expander_get_spacing(Handle expander)
           
protected static int gtk_expander_get_type()
           
protected static boolean gtk_expander_get_use_markup(Handle expander)
           
protected static boolean gtk_expander_get_use_underline(Handle expander)
           
protected static Handle gtk_expander_new_with_mnemonic(java.lang.String label)
           
protected static Handle gtk_expander_new(java.lang.String label)
           
protected static void gtk_expander_set_expanded(Handle expander, boolean expanded)
           
protected static void gtk_expander_set_label_widget(Handle expander, Handle label)
           
protected static void gtk_expander_set_label(Handle expander, java.lang.String label)
           
protected static void gtk_expander_set_spacing(Handle expander, int spacing)
           
protected static void gtk_expander_set_use_markup(Handle expander, boolean useMarkup)
           
protected static void gtk_expander_set_use_underline(Handle expander, boolean useUnderline)
           
 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, gtk_bin_get_child, gtk_bin_get_type
 
Methods inherited from class org.gnu.gtk.Container
add, addListener, fireContainerEvent, getBorderWidth, getChildren, getResizeMode, gtk_container_add, gtk_container_check_resize, gtk_container_child_type, gtk_container_get_border_width, gtk_container_get_children, gtk_container_get_focus_chain, gtk_container_get_focus_hadjustment, gtk_container_get_focus_vadjustment, gtk_container_get_resize_mode, gtk_container_get_type, gtk_container_propagate_expose, gtk_container_remove, gtk_container_resize_children, gtk_container_set_border_width, gtk_container_set_focus_chain, gtk_container_set_focus_child, gtk_container_set_focus_hadjustment, gtk_container_set_focus_vadjustment, gtk_container_set_reallocate_redraws, gtk_container_set_resize_mode, gtk_container_unset_focus_chain, remove, removeListener, resizeChildren, setBorderWidth, setResizeMode
 
Methods inherited from class org.gnu.gtk.Widget
activate, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, canActivateAccel, createContext, createLayout, destroy, draw, drawArea, drawArea, findListener, finish, fireBooleanLifeCycleEvent, fireDragDestinationEvent, fireDragSourceEvent, fireExposeEvent, fireFocusEvent, fireKeyEvent, fireLifeCycleEvent, fireMouseEvent, fireMouseMotionEvent, getAccessible, getColormap, getContext, getData, getDisplay, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getWindow, grabDefault, grabFocus, gtk_drag_dest_set, gtk_drag_dest_unset, gtk_drag_finish, gtk_drag_get_data, gtk_drag_highlight, gtk_drag_source_set_icon_pixbuf, gtk_drag_source_set_icon_stock, gtk_drag_source_set_icon, gtk_drag_source_set, gtk_drag_source_unset, gtk_drag_unhighlight, gtk_widget_activate, gtk_widget_add_accelerator, gtk_widget_add_events, gtk_widget_add_mnemonic_label, gtk_widget_can_activate_accel, gtk_widget_child_focus, gtk_widget_child_notify, gtk_widget_class_path, gtk_widget_create_pango_context, gtk_widget_create_pango_layout, gtk_widget_destroy, gtk_widget_destroyed, gtk_widget_ensure_style, gtk_widget_event, gtk_widget_freeze_child_notify, gtk_widget_get_accessible, gtk_widget_get_ancestor, gtk_widget_get_child_requisition, gtk_widget_get_child_visible, gtk_widget_get_colormap, gtk_widget_get_composite_name, gtk_widget_get_default_colormap, gtk_widget_get_default_direction, gtk_widget_get_default_style, gtk_widget_get_default_visual, gtk_widget_get_direction, gtk_widget_get_display, gtk_widget_get_events, gtk_widget_get_extension_events, gtk_widget_get_modifier_style, gtk_widget_get_name, gtk_widget_get_pango_context, gtk_widget_get_parent_window, gtk_widget_get_parent, gtk_widget_get_pointer, gtk_widget_get_root_window, gtk_widget_get_screen, gtk_widget_get_sensitive, gtk_widget_get_settings, gtk_widget_get_size_request, gtk_widget_get_style, gtk_widget_get_toplevel, gtk_widget_get_type, gtk_widget_get_visual, gtk_widget_get_window, gtk_widget_grab_default, gtk_widget_grab_focus, gtk_widget_has_screen, gtk_widget_hide_all, gtk_widget_hide_on_delete, gtk_widget_hide, gtk_widget_intersect, gtk_widget_is_ancestor, gtk_widget_is_focus, gtk_widget_list_accel_closures, gtk_widget_list_mnemonic_labels, gtk_widget_map, gtk_widget_mnemonic_activate, gtk_widget_modify_base, gtk_widget_modify_bg, gtk_widget_modify_fg, gtk_widget_modify_font, gtk_widget_modify_style, gtk_widget_modify_text, gtk_widget_path, gtk_widget_pop_colormap, gtk_widget_pop_composite_child, gtk_widget_push_colormap, gtk_widget_push_composite_child, gtk_widget_queue_draw_area, gtk_widget_queue_draw, gtk_widget_queue_resize, gtk_widget_realize, gtk_widget_ref, gtk_widget_region_intersect, gtk_widget_remove_accelerator, gtk_widget_remove_mnemonic_label, gtk_widget_render_icon, gtk_widget_reparent, gtk_widget_reset_rc_styles, gtk_widget_send_expose, gtk_widget_set_accel_path, gtk_widget_set_app_paintable, gtk_widget_set_child_visible, gtk_widget_set_colormap, gtk_widget_set_composite_name, gtk_widget_set_default_colormap, gtk_widget_set_default_direction, gtk_widget_set_direction, gtk_widget_set_double_buffered, gtk_widget_set_events, gtk_widget_set_extension_events, gtk_widget_set_name, gtk_widget_set_parent_window, gtk_widget_set_parent, gtk_widget_set_redraw_on_allocate, gtk_widget_set_scroll_adjustments, gtk_widget_set_sensitive, gtk_widget_set_size_request, gtk_widget_set_state, gtk_widget_set_style, gtk_widget_shape_combine_mask, gtk_widget_show_all, gtk_widget_show_now, gtk_widget_show, gtk_widget_size_allocate, gtk_widget_size_request, gtk_widget_style_get_property, gtk_widget_thaw_child_notify, gtk_widget_translate_coordinates, gtk_widget_unmap, gtk_widget_unparent, gtk_widget_unrealize, gtk_widget_unref, handleButtonPressed, handleButtonReleased, handleDelete, handleDragDataGet, handleDragDestination, handleExpose, handleFocusIn, handleFocusOut, handleHide, handleKeyPressed, handleKeyReleased, handleMap, handleMouseEnter, handleMouseLeave, handleMouseMotion, handleNoExpose, handleRealize, handleScroll, handleShow, handleUnmap, hasFocus, hasScreen, hide, hideAll, highlight, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setColormap, setDoubleBuffered, setDragDestination, setDragIcon, setDragIconPixbuf, setDragIconStock, setDragSource, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll, unHighlight
 
Methods inherited from class org.gnu.gtk.GtkObject
getFlags, gtk_object_destroy, gtk_object_get_type, gtk_object_sink, setFlags, sink
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, equals, freezeNotify, getBooleanProperty, getData, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getHandle, getIntFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getNullHandle, getPixbufProperty, getProperty, getStringFromHandle, getStringProperty, hashCode, hasProperty, instantiateJGObjectFromGType, notify, removeEventHandler, removeListener, retrieveGObject, setBooleanProperty, setData, setData, setDoubleProperty, setFloatProperty, setHandle, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class java.lang.Object
clone, finalize, 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(Handle handle)
Method Detail

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)

fireExpanderEvent

protected void fireExpanderEvent(ExpanderEvent event)

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

gtk_expander_get_type

protected static final int gtk_expander_get_type()

gtk_expander_new

protected static final Handle gtk_expander_new(java.lang.String label)

gtk_expander_new_with_mnemonic

protected static final Handle gtk_expander_new_with_mnemonic(java.lang.String label)

gtk_expander_set_expanded

protected static final void gtk_expander_set_expanded(Handle expander,
                                                      boolean expanded)

gtk_expander_get_expanded

protected static final boolean gtk_expander_get_expanded(Handle expander)

gtk_expander_set_spacing

protected static final void gtk_expander_set_spacing(Handle expander,
                                                     int spacing)

gtk_expander_get_spacing

protected static final int gtk_expander_get_spacing(Handle expander)

gtk_expander_set_label

protected static final void gtk_expander_set_label(Handle expander,
                                                   java.lang.String label)

gtk_expander_get_label

protected static final java.lang.String gtk_expander_get_label(Handle expander)

gtk_expander_set_use_underline

protected static final void gtk_expander_set_use_underline(Handle expander,
                                                           boolean useUnderline)

gtk_expander_get_use_underline

protected static final boolean gtk_expander_get_use_underline(Handle expander)

gtk_expander_set_use_markup

protected static final void gtk_expander_set_use_markup(Handle expander,
                                                        boolean useMarkup)

gtk_expander_get_use_markup

protected static final boolean gtk_expander_get_use_markup(Handle expander)

gtk_expander_set_label_widget

protected static final void gtk_expander_set_label_widget(Handle expander,
                                                          Handle label)

gtk_expander_get_label_widget

protected static final Handle gtk_expander_get_label_widget(Handle expander)