java-gnome version 4.0.19

org.gnome.gtk
Class TextComboBoxEntry

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.ComboBox
                                  extended by org.gnome.gtk.ComboBoxEntry
                                      extended by org.gnome.gtk.TextComboBoxEntry
All Implemented Interfaces:
CellEditable, CellLayout

public class TextComboBoxEntry
extends ComboBoxEntry

A ComboBoxEntry with a simplified API for displaying and extracting Strings. When dealing with ComboBoxEntries you usually get the Entry child Widget and hook up to its methods and signals. Our text-only variant, however, has methods allowing you to quickly manipulate the list of options and to get the currently selected one.

As with the parent ComboBoxEntry, if you want what is actually in the Entry, you will have to pull the Entry out to ask it.

These are indeed the same convenience methods as found in the text-only API of GtkComboBox, which we have split into ComboBox and TextComboBox.

Since:
4.0.6
Author:
Andrew Cowie

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gnome.gtk.ComboBox
ComboBox.Changed
 
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
 
Nested classes/interfaces inherited from class org.gnome.gtk.Object
Object.Destroy
 
Constructor Summary
TextComboBoxEntry()
          Construct a new text-only ComboBoxEntry.
 
Method Summary
 void appendText(String text)
          Append an item to the list.
 String getActiveText()
          Returns the text of the active item.
 void insertText(int position, String text)
          Append an item at the supplied position.
 void prependText(String text)
          Prepend an item to the beginning of the list.
 
Methods inherited from class org.gnome.gtk.ComboBox
connect, getActive, getActiveIter, popdown, popup, setActive, setActiveIter, setModel
 
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, getSensitive, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, modifyBackground, modifyBase, modifyFont, modifyText, queueDraw, queueDrawArea, realize, setCanDefault, setCanFocus, setColormap, setEvents, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
 
Methods inherited from class org.gnome.gtk.Object
connect, destroy
 
Methods inherited from class org.freedesktop.bindings.Pointer
toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextComboBoxEntry

public TextComboBoxEntry()
Construct a new text-only ComboBoxEntry.

Since:
4.0.6
Method Detail

appendText

public void appendText(String text)
Append an item to the list.

Since:
4.0.6

getActiveText

public String getActiveText()
Returns the text of the active item.

If the TextComboBoxEntry is showing the result of the user having selected an item from the list, or the developer has called setActive(), then this will be equal to the result of calling:

 e = (Entry) combo.getChild();
 e.getText();
 
but beware that if the user hasn't caused one of the existing options to be picked and has instead entered their own data, then this won't match what is in the Entry.

Since:
4.0.6

insertText

public void insertText(int position,
                       String text)
Append an item at the supplied position. Positions are zero origin.

Since:
4.0.6

prependText

public void prependText(String text)
Prepend an item to the beginning of the list.

Since:
4.0.6


java-gnome