|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.fieldassist.TextContentAdapter
An IControlContentAdapter
for SWT Text controls. This is a
convenience class for easily creating a ContentProposalAdapter
for
text fields.
Constructor Summary | |
---|---|
TextContentAdapter()
|
Method Summary | |
---|---|
String |
getControlContents(Control control)
Get the text contents of the control. |
int |
getCursorPosition(Control control)
Get the current cursor position in the control. |
Rectangle |
getInsertionBounds(Control control)
Get the bounds (in pixels) of the insertion point for the control content. |
void |
insertControlContents(Control control,
String text,
int cursorPosition)
Insert the specified contents into the control's current contents. |
void |
setControlContents(Control control,
String text,
int cursorPosition)
Set the contents of the specified control to the specified text. |
void |
setCursorPosition(Control control,
int position)
Set the current cursor position in the control. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TextContentAdapter()
Method Detail |
public String getControlContents(Control control)
IControlContentAdapter
getControlContents
in interface IControlContentAdapter
control
- the control whose contents are to be retrieved.
public void setControlContents(Control control, String text, int cursorPosition)
IControlContentAdapter
null
.
setControlContents
in interface IControlContentAdapter
control
- the control whose contents are to be set (replaced).text
- the String specifying the new control content.cursorPosition
- the zero-based index representing the desired cursor position
in the control's contents after the contents are set.public void insertControlContents(Control control, String text, int cursorPosition)
IControlContentAdapter
null
.
insertControlContents
in interface IControlContentAdapter
control
- the control whose contents are to be altered.text
- the String to be inserted into the control contents.cursorPosition
- the zero-based index representing the desired cursor position
within the inserted contents after the insertion is made.public int getCursorPosition(Control control)
IControlContentAdapter
getCursorPosition
in interface IControlContentAdapter
control
- the control whose position is to be retrieved.
public Rectangle getInsertionBounds(Control control)
IControlContentAdapter
getInsertionBounds
in interface IControlContentAdapter
control
- the control whose offset is to be retrieved.
public void setCursorPosition(Control control, int position)
IControlContentAdapter
setCursorPosition
in interface IControlContentAdapter
control
- the control whose cursor position is to be set.position
- the zero-based index representing the cursor position in the
control's contents.
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.