|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gnu.glib.GObject
org.gnu.gtk.GtkObject
org.gnu.gtk.Widget
org.gnu.gtk.Entry
A single line text entry widget. A fairly large set of key bindings are supported by default. If the entered text is longer than the allocation of the widget, the widget will scroll so that the cursor position is visible.
Field Summary |
Fields inherited from class org.gnu.glib.GObject |
eventsInitialized |
Constructor Summary | |
Entry()
Creates a new Entry widget. |
|
Entry(Handle handle)
|
Method Summary | |
void |
addListener(EntryListener listener)
Register an object to handle spin events. |
void |
copyClipboard()
Causes the characters in the current selection to be copied to the clipboard. |
void |
cutClipboard()
Causes the characters in the current selection to be copied to the clipboard and then deleted from the widget. |
void |
deleteSelection()
Deletes the contents of the current selection. |
void |
deleteText(int start,
int end)
Delete a sequence of characters. |
protected void |
fireEntryEvent(EntryEvent event)
|
float |
getAlignment()
Gets the value set by setAlignment(float) . |
java.lang.String |
getCharacters(int start,
int end)
Retrieve a sequence of characters. |
EntryCompletion |
getCompletion()
|
int |
getCursorPosition()
Retrieves the current cursor position. |
boolean |
getEditable()
Retrieves whether the text contained in the widget is editable. |
java.lang.Class |
getEventListenerClass(java.lang.String signal)
|
EventType |
getEventType(java.lang.String signal)
|
boolean |
getHasFrame()
Gets the value set by setHasFrame(boolean) . |
Layout |
getLayout()
Gets the Layout used to display the entry. |
Point |
getLayoutOffsets()
Obtains the position of the Layout used to render text in the entry, in widget coordinates. |
int |
getMaxLength()
Returns the maximum length of the contents of the widget. |
java.lang.String |
getText()
Retrieve the contents of the entry widget. |
static Type |
getType()
Retrieve the runtime type used by the GLib library. |
boolean |
getVisible()
Retrieves whether the contents of the entry are visible or not. |
int |
getWidth()
Gets the value set by setWidth(int) . |
protected static boolean |
gtk_entry_get_activates_default(Handle entry)
|
protected static Handle |
gtk_entry_get_completion(Handle entry)
|
protected static boolean |
gtk_entry_get_has_frame(Handle entry)
|
protected static byte |
gtk_entry_get_invisible_char(Handle entry)
|
protected static void |
gtk_entry_get_layout_offsets(Handle entry,
int[] x,
int[] y)
|
protected static Handle |
gtk_entry_get_layout(Handle entry)
|
protected static int |
gtk_entry_get_max_length(Handle entry)
|
protected static java.lang.String |
gtk_entry_get_text(Handle entry)
|
protected static int |
gtk_entry_get_type()
|
protected static boolean |
gtk_entry_get_visibility(Handle entry)
|
protected static int |
gtk_entry_get_width_chars(Handle entry)
|
protected static Handle |
gtk_entry_new()
|
protected static void |
gtk_entry_set_activates_default(Handle entry,
boolean setting)
|
protected static void |
gtk_entry_set_completion(Handle entry,
Handle completion)
|
protected static void |
gtk_entry_set_has_frame(Handle entry,
boolean setting)
|
protected static void |
gtk_entry_set_invisible_char(Handle entry,
byte ch)
|
protected static void |
gtk_entry_set_max_length(Handle entry,
int max)
|
protected static void |
gtk_entry_set_text(Handle entry,
java.lang.String text)
|
protected static void |
gtk_entry_set_visibility(Handle entry,
boolean visible)
|
protected static void |
gtk_entry_set_width_chars(Handle entry,
int numChars)
|
void |
handleToggleOverwrite()
|
int |
insertText(java.lang.String text,
int offset)
Insert text at a given point |
int |
layoutIndexToTextIndex(int layoutIndex)
Converts from a position in the entry contents (returned by getText() ) to a position in the entry's PangoLayout (returned by getLayout() , with text retrieved via Layout.getText() ). |
void |
pasteClipboard()
Causes the contents of the clipboard to be pasted into this widget at the current cursor position. |
void |
removeListener(EntryListener listener)
Removes a listener |
void |
selectRegion(int start,
int end)
Methods from Editable |
void |
setActivateDefaultWidget(boolean setting)
If setting is TRUE, pressing Enter in the entry will activate the default widget for the window containing the entry. |
void |
setAlignment(float xalign)
Sets the alignment for the contents of the entry. |
void |
setCompletion(EntryCompletion completion)
|
void |
setCursorPosition(int position)
Sets the cursor position |
void |
setEditable(boolean isEditable)
Determines if the user can edit the text contained in the widget. |
void |
setHasFrame(boolean setting)
Sets whether the entry has a beveled frame around it. |
void |
setInvisibleChar(char character)
Sets the character to use in place of the actual text when setVisibility has been called to set text visibility to FALSE (ie this is the character used in "password mode" to show the user how many characters have been typed). |
void |
setMaxLength(int max)
Sets the maximum allowed length of the contents of the widget. |
void |
setText(java.lang.String text)
Sets the text in the widget to the given value, replacing the current contents. |
void |
setVisible(boolean visible)
Sets whether the contents of the entry are visible or not. |
void |
setWidth(int number)
Changes the size request of the entry to be about the right size for number characters. |
int |
textIndexToLayoutIndex(int textIndex)
Converts from a position in the entry's PangoLayout (returned by getLayout() ) to a position in the entry contents (returned by
getText() ). |
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 java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Entry()
public Entry(Handle handle)
Method Detail |
public void setText(java.lang.String text)
text
- The new text.public java.lang.String getText()
public void setVisible(boolean visible)
The default invisible char is the asterisk '*', but it can be changed with setInvisibleChar().
public boolean getVisible()
public void setInvisibleChar(char character)
public void setMaxLength(int max)
max
- The maximum length of the entry, or 0 for no maximum.
(other than the maximum length of entries.) The value passed in will be
clamped to the range 0-65536.public int getMaxLength()
public boolean getHasFrame()
setHasFrame(boolean)
.
public int getWidth()
setWidth(int)
.
public void setActivateDefaultWidget(boolean setting)
setting
- TRUE to activate window's default widget on Enter
keypresspublic void setHasFrame(boolean setting)
public void setWidth(int number)
number
- Width in Characterspublic Layout getLayout()
public Point getLayoutOffsets()
Point
identifying the x and y offset
of the layout.public void setAlignment(float xalign)
xalign
- The horizontal alignment, from 0 (left) to 1
(right). Reversed for RTL layouts.public float getAlignment()
setAlignment(float)
.
public int layoutIndexToTextIndex(int layoutIndex)
getText()
) to a position in the entry's PangoLayout
(returned by getLayout()
, with text retrieved via Layout.getText()
).
public int textIndexToLayoutIndex(int textIndex)
PangoLayout
(returned by getLayout()
) to a position in the entry contents (returned by
getText()
).
public static Type getType()
public void addListener(EntryListener listener)
EntryListener
public void removeListener(EntryListener listener)
addListener(EntryListener)
protected void fireEntryEvent(EntryEvent event)
public java.lang.Class getEventListenerClass(java.lang.String signal)
getEventListenerClass
in class Widget
public EventType getEventType(java.lang.String signal)
getEventType
in class Widget
public void handleToggleOverwrite()
public void setCompletion(EntryCompletion completion)
public EntryCompletion getCompletion()
public void selectRegion(int start, int end)
selectRegion
in interface Editable
public int insertText(java.lang.String text, int offset)
Editable
insertText
in interface Editable
text
- The text to insert.offset
- The offset into the buffer to begin the insert.
public void deleteText(int start, int end)
Editable
deleteText
in interface Editable
public java.lang.String getCharacters(int start, int end)
Editable
getCharacters
in interface Editable
public void cutClipboard()
Editable
cutClipboard
in interface Editable
public void copyClipboard()
Editable
copyClipboard
in interface Editable
public void pasteClipboard()
Editable
pasteClipboard
in interface Editable
public void deleteSelection()
Editable
deleteSelection
in interface Editable
public void setCursorPosition(int position)
Editable
setCursorPosition
in interface Editable
position
- The position of the cursor. The cursor is displayed
before the character with the given (base 0) index in the widget. The
value must be less than or equal to the number of characters in the widget.public int getCursorPosition()
Editable
getCursorPosition
in interface Editable
public void setEditable(boolean isEditable)
Editable
setEditable
in interface Editable
isEditable
- true if the user can edit the text.public boolean getEditable()
Editable
getEditable
in interface Editable
protected static final int gtk_entry_get_type()
protected static final Handle gtk_entry_new()
protected static final void gtk_entry_set_visibility(Handle entry, boolean visible)
protected static final boolean gtk_entry_get_visibility(Handle entry)
protected static final void gtk_entry_set_invisible_char(Handle entry, byte ch)
protected static final byte gtk_entry_get_invisible_char(Handle entry)
protected static final void gtk_entry_set_has_frame(Handle entry, boolean setting)
protected static final boolean gtk_entry_get_has_frame(Handle entry)
protected static final void gtk_entry_set_max_length(Handle entry, int max)
protected static final int gtk_entry_get_max_length(Handle entry)
protected static final void gtk_entry_set_activates_default(Handle entry, boolean setting)
protected static final boolean gtk_entry_get_activates_default(Handle entry)
protected static final void gtk_entry_set_width_chars(Handle entry, int numChars)
protected static final int gtk_entry_get_width_chars(Handle entry)
protected static final void gtk_entry_set_text(Handle entry, java.lang.String text)
protected static final java.lang.String gtk_entry_get_text(Handle entry)
protected static final Handle gtk_entry_get_layout(Handle entry)
protected static final void gtk_entry_get_layout_offsets(Handle entry, int[] x, int[] y)
protected static final void gtk_entry_set_completion(Handle entry, Handle completion)
protected static final Handle gtk_entry_get_completion(Handle entry)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |