org.gnome.gtk
Class ComboBoxEntry
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
- All Implemented Interfaces:
- CellEditable, CellLayout
- Direct Known Subclasses:
- TextComboBoxEntry
public class ComboBoxEntry
- extends ComboBox
- implements CellEditable, CellLayout
An Entry which also offers a range of pre-configured options to choose
from.
It is a
composite Widget with an Entry wrapped in a mechanism to activate a popup
dialog allowing the user to pick from a list of options.
ComboBoxEntry is powered by the same mechanism as the parent class
ComboBox; the option list is driven by a TreeModel. When constructing a
ComboBoxEntry, you specify the column from the model that will supply the
data to be used as the list of options.
Almost everyone dealing with ComboBoxEntries wonders how to get the text
showing in the Widget. You do this by very simply getting by getting it
from the Entry. Call getChild()
and call that
Entry's getText()
; given:
ComboBoxEntry combo;
Entry e;
String str;
...
you simply write:
e = (Entry) combo.getChild();
str = e.getText();
and then do something with the returned String.
Like GtkComboBox
, GtkComboBoxEntry
has a
second text-only API that is lumped into the same classes while not being
able to be used together. We have similarly spliced this functionality out
of this class into our subclass TextComboBoxEntry
.
- 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 |
Constructor Summary |
ComboBoxEntry(TreeModel model,
DataColumnString column)
Construct a new ComboBoxEntry, indicating which DataColumn in the
TreeModel is to provide the list of options for the Widget to display. |
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 |
ComboBoxEntry
public ComboBoxEntry(TreeModel model,
DataColumnString column)
- Construct a new ComboBoxEntry, indicating which DataColumn in the
TreeModel is to provide the list of options for the Widget to display.
- Since:
- 4.0.6