org.gnu.gtk
Class SimpleList

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.SimpleList

public class SimpleList
extends Widget

This is a widget which contains a list of strings. It is a wrapper class for the more powerful set of tree and list objects, described at TreeView.


Constructor Summary
SimpleList()
          Constructs a SimpleList object.
 
Method Summary
 void add(java.lang.String text, int position)
          Adds a new element at the given position
 void addEnd(java.lang.String text)
          Adds an element to the end of the list
 void addStart(java.lang.String text)
          Adds an element to the start of the list
 java.lang.String[] getEntries()
           
 java.lang.String[] getSelected()
           
 boolean getSelected(int index)
          Returns true if the element at index is selected
 int getSize()
          Returns the number of items in the list
 java.lang.String getValue(int position)
          Returns the string at the given position
 void remove(int position)
          Removes the element at the given position
 void remove(java.lang.String val)
          Remove the given element.
 void select(int index)
          Selects the element at index
 void setEditable(boolean setting)
          Sets whether the user may edit the cell contents directly.
 void setSelectable(SelectionMode setting)
          Sets how many of the elements can be selected.
 
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, getEventListenerClass, getEventType, getExtensionEvents, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getType, 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

SimpleList

public SimpleList()
Constructs a SimpleList object.

Method Detail

addStart

public void addStart(java.lang.String text)
Adds an element to the start of the list

Parameters:
text - the text of the element

addEnd

public void addEnd(java.lang.String text)
Adds an element to the end of the list

Parameters:
text - The text of the element

add

public void add(java.lang.String text,
                int position)
Adds a new element at the given position

Parameters:
text - The text of the new element
position - The position in which it should be placed. 0 is at the start of the list.

getValue

public java.lang.String getValue(int position)
Returns the string at the given position

Parameters:
position - The position in the list to investigate
Returns:
The value of the cell at that position

getSelected

public boolean getSelected(int index)
Returns true if the element at index is selected


select

public void select(int index)
Selects the element at index


setSelectable

public void setSelectable(SelectionMode setting)
Sets how many of the elements can be selected.


remove

public void remove(int position)
Removes the element at the given position


remove

public void remove(java.lang.String val)
Remove the given element. This iterates over the elements contained in the list until a matching element is found.


setEditable

public void setEditable(boolean setting)
Sets whether the user may edit the cell contents directly.


getSize

public int getSize()
Returns the number of items in the list


getSelected

public java.lang.String[] getSelected()

getEntries

public java.lang.String[] getEntries()