org.gnome.gtk
Class TextComboBoxEntry
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.ComboBox
org.gnome.gtk.ComboBoxEntry
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 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 |
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.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, 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.freedesktop.bindings.Pointer |
toString |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TextComboBoxEntry
public TextComboBoxEntry()
- Construct a new text-only ComboBoxEntry.
- Since:
- 4.0.6
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