public class ComboContentAdapter extends Object implements IControlContentAdapter
IControlContentAdapter for SWT Combo controls. This is a
convenience class for easily creating a ContentProposalAdapter for
combo fields.| Constructor and Description |
|---|
ComboContentAdapter() |
| Modifier and Type | Method and Description |
|---|---|
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 index)
Set the current cursor position in the control.
|
public String getControlContents(Control control)
IControlContentAdaptergetControlContents in interface IControlContentAdaptercontrol - the control whose contents are to be retrieved.public void setControlContents(Control control, String text, int cursorPosition)
IControlContentAdapternull.setControlContents in interface IControlContentAdaptercontrol - 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)
IControlContentAdapternull.insertControlContents in interface IControlContentAdaptercontrol - 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)
IControlContentAdaptergetCursorPosition in interface IControlContentAdaptercontrol - the control whose position is to be retrieved.public Rectangle getInsertionBounds(Control control)
IControlContentAdaptergetInsertionBounds in interface IControlContentAdaptercontrol - the control whose offset is to be retrieved.public void setCursorPosition(Control control, int index)
IControlContentAdaptersetCursorPosition in interface IControlContentAdaptercontrol - the control whose cursor position is to be set.index - the zero-based index representing the cursor position in the
control's contents.Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.