|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SCTextComponent is the parent class for classes containing a cursor.
SCTextfield
,
SCLabel
Method Summary | |
void |
clearSelection()
Deselects all selected text in this text component. |
void |
copy()
Copies any selected text to the clipboard. |
int |
getCaretPosition()
Gets the position of the text insertion caret for this text component. |
int |
getColumns()
Gets the number of columns in this text component. |
java.lang.String |
getSelectedText()
Gets the selected text. |
int |
getSelectionEnd()
Gets the end position of the selected text in this text component. |
int |
getSelectionStart()
Gets the start position of the selected text in this text component. |
java.lang.String |
getText()
Gets the text. |
java.lang.String |
getText(int offset,
int length)
Gets the text starting at the specified offset of the specified length. |
void |
select(int selectionStart,
int selectionEnd)
Selects the text between the specified start and end positions. |
void |
selectAll()
Selects all the text in this text component. |
void |
setCaretPosition(int position)
Sets the position of the text insertion caret for this text component. |
void |
setSelectionEnd(int selectionEnd)
Sets the selection end for this text component to the specified position. |
void |
setSelectionStart(int selecitonStart)
Sets the selection start for this text component to the specified position. |
void |
setText(int offset,
java.lang.String text)
Sets the text starting at the specified offset of a specified string. |
void |
setText(java.lang.String text)
Sets the text. |
Methods inherited from interface com.ibm.hi.customizer.beans.scci.SCCustomComponent |
getBackgroundColor, getCaption, getForegroundColor, getGlobalRead, getGlobalWrite, getHelpCaption, getHostLinkLength, getHostLinkPosition, getTabNumber, hasFocus, isTempHidden, isVisible, readGlobalVariable, requestFocus, setBackgroundColor, setCaption, setForegroundColor, setGlobalRead, setGlobalWrite, setHelpCaption, setTempHidden, setVisible, toString, writeGlobalVariable |
Method Detail |
public java.lang.String getText()
setText(java.lang.String)
,
SCCustomComponent.getCaption()
public void setText(java.lang.String text)
text
- the text to setgetText()
,
SCCustomComponent.setCaption(java.lang.String)
public java.lang.String getText(int offset, int length)
offset
- the offsetlength
- the lengthsetText(java.lang.String)
,
SCCustomComponent.getCaption()
public void setText(int offset, java.lang.String text)
offset
- the offsettext
- the text to setgetText()
,
SCCustomComponent.setCaption(java.lang.String)
public int getColumns()
public java.lang.String getSelectedText()
select(int, int)
public void setSelectionStart(int selecitonStart)
selectionStart
that is out of bounds, the method enforces these constraints
silently, and without failure.selectionStart
- the start position of the
selected text.getSelectionStart()
,
setSelectionEnd(int)
public int getSelectionStart()
setSelectionStart(int)
,
getSelectionEnd()
public void setSelectionEnd(int selectionEnd)
selectionEnd
that is out of bounds, the method enforces these constraints
silently, and without failure.selectionEnd
- the end position of the
selected text.getSelectionEnd()
,
setSelectionStart(int)
public int getSelectionEnd()
setSelectionEnd(int)
,
getSelectionStart()
public void select(int selectionStart, int selectionEnd)
This method sets the start and end positions of the selected text, enforcing the restriction that the end position must be greater than or equal to the start position. The start position must be greater than or equal to zero, and the end position must note be beyond the end of the text component's text. If the caller supplies values that are inconsistent or out of bounds, the method enforces these constraints silently, and without failure.
Note that the indexing scheme is based on caret indices, not character indices. For example, to select "def" from a component with "abcdefgh" as the text, the call would be: select(3, 6);. This would start the selection at the 4th caret index (caret indexes are zero-based) which is between the 'c' and 'd', and end the selection at the 7th caret index which between the 'f' and 'g'.
selectionStart
- the start position of the
text to select.selectionEnd
- the end position of the
text to select.setSelectionStart(int)
,
setSelectionEnd(int)
,
selectAll()
public void selectAll()
select(int, int)
public void clearSelection()
select(int, int)
public void copy()
public void setCaretPosition(int position)
position
- the position of the text insertion caret.java.lang.IllegalArgumentException
- if the value supplied
for position
is less than zero.getCaretPosition()
public int getCaretPosition()
setCaretPosition(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |