|
java-gnome version 4.0.7 | ||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
java.lang.Objectorg.freedesktop.bindings.Proxy
org.gnome.glib.Object
org.gnome.gtk.Object
org.gnome.gtk.Widget
org.gnome.gtk.Entry
public class Entry
A data entry field allowing the user to input a single line of text.
| Nested Class Summary | |
|---|---|
static interface |
Entry.ACTIVATE
The activate signal occurs when the user presses
<RETURN> in an Entry. |
| Nested classes/interfaces inherited from class org.gnome.gtk.Widget |
|---|
Widget.BUTTON_PRESS_EVENT, Widget.BUTTON_RELEASE_EVENT, Widget.ENTER_NOTIFY_EVENT, Widget.EXPOSE_EVENT, Widget.FOCUS_IN_EVENT, Widget.FOCUS_OUT_EVENT, Widget.HIDE, Widget.KEY_PRESS_EVENT, Widget.KEY_RELEASE_EVENT, Widget.LEAVE_NOTIFY_EVENT, Widget.UNMAP_EVENT, Widget.VISIBILITY_NOTIFY_EVENT |
| Nested classes/interfaces inherited from interface org.gnome.gtk.Editable |
|---|
Editable.CHANGED |
| Constructor Summary | |
|---|---|
Entry()
Construct a new Entry |
|
Entry(java.lang.String text)
Construct a new Entry, initialized with the specified text |
|
| Method Summary | |
|---|---|
void |
connect(Editable.CHANGED handler)
Connect a CHANGED handler. |
void |
connect(Entry.ACTIVATE handler)
Connects an Entry.ACTIVATE handler to the Widget. |
int |
getMaxLength()
Returns the current maximum width, in characters, the text in the Entry is allowed to be. |
java.lang.String |
getText()
Get the text currently showing in the Entry. |
boolean |
isVisibleChars()
Returns the state of whether text in the Entry are visible or hidden by an obscuring character. |
void |
selectRegion(int start,
int end)
Select a region of the text in this Editable. |
void |
setAlignment(float xalign)
Set the alignment of the the text being displayed in the Entry. |
void |
setEditable(boolean editable)
Set whether the text in the Entry can be change by the user. |
void |
setInvisibleChar(char replacement)
Change the character used to obscure text when setVisibleChars() is false. |
void |
setMaxLength(int max)
Specify the maximum number of characters the user is allowed to enter. |
void |
setPosition(int position)
Set the position of the cursor in this Editable. |
void |
setText(java.lang.String text)
Replace the current contents of the Entry with the supplied text. |
void |
setVisibleChars(boolean visible)
Set whether the text in the entry is visible or obscured. |
void |
setWidthChars(int width)
Request that the width of this Entry be wide enough for a given number of characters. |
| Methods inherited from class org.gnome.gtk.Widget |
|---|
activate, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getHasFocus, getParent, getRequisition, getToplevel, getWindow, grabFocus, hide, modifyBackground, modifyText, setCanFocus, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll |
| Methods inherited from class org.freedesktop.bindings.Proxy |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Entry()
public Entry(java.lang.String text)
| Method Detail |
|---|
public void connect(Editable.CHANGED handler)
CHANGED handler.
connect in interface Editablepublic void connect(Entry.ACTIVATE handler)
Entry.ACTIVATE handler to the Widget.
public int getMaxLength()
public java.lang.String getText()
ACTIVATE
signal.
public boolean isVisibleChars()
true if characters entered are visible,
false if obscured.
public void selectRegion(int start,
int end)
Editablestart up to but not including end
will be selected.
Calling selectRegion(0, 0) will remove the selection
(although that will only happen if some other Widget has the focus; in
Windows where there is only one control the user can manipulate an
Entry will end up selected no matter what).
selectRegion in interface Editableend - If negative, then the selection will be from
start to the end of the text in the Editable.public void setAlignment(float xalign)
xalign - A value from 0.0f for fully left-aligned
through 1.0f for fully right-aligned. You can
use the constants LEFT,
CENTER and
RIGHT in Alignment for convenience
if you like. No, this has nothing to do with politics.public void setEditable(boolean editable)
public void setInvisibleChar(char replacement)
setVisibleChars() is false.
replacement - The new character to be used to obscure text. A value of
0 will cause no feedback to displayed at all
when the user is typing in the Entry.public void setMaxLength(int max)
max - A value of 0 indicates no maximum length.public void setPosition(int position)
Editable
setPosition in interface Editableposition - The value given must be less than or equal to the number of
characters currently in the Editable field. Supplying a
value of -1 will cause the cursor to move to
a position after the last character in the text.public void setText(java.lang.String text)
public void setVisibleChars(boolean visible)
* instead. This default can be changed with
setInvisibleChar().
visible - true for showing, false for hidingpublic void setWidthChars(int width)
As with all font related operations, there are a number of competing approximations involved. In particular, this method operates by influencing the size requested by this Widget; the box packing model will still have the final say in the size allocation phase.
See also Label's setWidthChars(); the
challenges and constraints involved are similar.
width - A setting of -1 will return the Entry to
normal sizing behaviour.
|
![]() java-gnome |
||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||