All Packages Class Hierarchy This Package Previous Next Index
Interface com.ibm.hi.customizer.beans.scci.SCTextComponent
- public interface SCTextComponent
- extends SCCustomComponent
SCTextComponent is the parent class for classes containing
a cursor.
- See Also:
- SCTextfield, SCLabel
-
clearSelection()
- Deselects all selected text in this text component.
-
copy()
- Copies any selected text to the clipboard.
-
getCaretPosition()
- Gets the position of the text insertion caret for
this text component.
-
getColumns()
- Gets the number of columns in this text component.
-
getSelectedText()
- Gets the selected text.
-
getSelectionEnd()
- Gets the end position of the selected text in
this text component.
-
getSelectionStart()
- Gets the start position of the selected text in
this text component.
-
getText()
- Gets the text.
-
getText(int, int)
- Gets the text starting at the specified offset
of the specified length.
-
select(int, int)
- Selects the text between the specified start and end positions.
-
selectAll()
- Selects all the text in this text component.
-
setCaretPosition(int)
- Sets the position of the text insertion caret for
this text component.
-
setSelectionEnd(int)
- Sets the selection end for this text component to
the specified position.
-
setSelectionStart(int)
- Sets the selection start for this text component to
the specified position.
-
setText(int, String)
- Sets the text starting at the specified offset
of a specified string.
-
setText(String)
- Sets the text.
getText
public abstract String getText()
- Gets the text.
- Returns:
- the text
- See Also:
- setText, getCaption
setText
public abstract void setText(String text)
- Sets the text. If the textComponent is host-linked, the operation is ignored.
- Parameters:
-
text
the - text to set
- See Also:
- getText, setCaption
getText
public abstract String getText(int offset,
int length)
- Gets the text starting at the specified offset
of the specified length.
- Parameters:
-
offset
- the offset
-
length
- the length
- Returns:
- the text starting at the specified offset
of the specified length
- See Also:
- setText, getCaption
setText
public abstract void setText(int offset,
String text)
- Sets the text starting at the specified offset
of a specified string. If the textComponent is host-linked, the operation is ignored.
- Parameters:
-
offset
- the offset
-
text
- the text to set
- See Also:
- getText, setCaption
getColumns
public abstract int getColumns()
- Gets the number of columns in this text component.
- Returns:
- the number of columns.
getSelectedText
public abstract String getSelectedText()
- Gets the selected text.
- Returns:
- the selected text.
- See Also:
- select
setSelectionStart
public abstract void setSelectionStart(int selecitonStart)
- Sets the selection start for this text component to
the specified position. The new start point is constrained
to be at or before the current selection end. It also
cannot be set to less than zero (the beginning of the
component's text).
If the caller supplies a value for
selectionStart
that is out of bounds, the method enforces these constraints
silently, and without failure.
- Parameters:
-
selectionStart
- the start position of the
selected text.
- See Also:
- getSelectionStart, setSelectionEnd
getSelectionStart
public abstract int getSelectionStart()
- Gets the start position of the selected text in
this text component.
- Returns:
- the start position of the selected text.
- See Also:
- setSelectionStart, getSelectionEnd
setSelectionEnd
public abstract void setSelectionEnd(int selectionEnd)
- Sets the selection end for this text component to
the specified position. The new end point is constrained
to be at or after the current selection start. It also
cannot be set beyond the end of the component's text.
If the caller supplies a value for
selectionEnd
that is out of bounds, the method enforces these constraints
silently, and without failure.
- Parameters:
-
selectionEnd
- the end position of the
selected text.
- See Also:
- getSelectionEnd, setSelectionStart
getSelectionEnd
public abstract int getSelectionEnd()
- Gets the end position of the selected text in
this text component.
- Returns:
- the end position of the selected text.
- See Also:
- setSelectionEnd, getSelectionStart
select
public abstract void select(int selectionStart,
int selectionEnd)
- Selects the text between the specified start and end positions.
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'.
- Parameters:
-
selectionStart
- the start position of the
text to select.
-
selectionEnd
- the end position of the
text to select.
- See Also:
- setSelectionStart, setSelectionEnd, selectAll
selectAll
public abstract void selectAll()
- Selects all the text in this text component.
- See Also:
- select
clearSelection
public abstract void clearSelection()
- Deselects all selected text in this text component.
- See Also:
- select
copy
public abstract void copy()
- Copies any selected text to the clipboard.
setCaretPosition
public abstract void setCaretPosition(int position)
- Sets the position of the text insertion caret for
this text component. Valid caret positions are 0
(just before the first character) to #columns (which whould place the caret right
after the last character). It should also be noted that
the caret will be placed at the last appropriate position if
a value greater than the width of the field is passed in.
- Parameters:
-
position
- the position of the text insertion caret.
- Throws: IllegalArgumentException
- if the value supplied
for
position
is less than zero.
- See Also:
- getCaretPosition
getCaretPosition
public abstract int getCaretPosition()
- Gets the position of the text insertion caret for
this text component.
- Returns:
- the position of the text insertion caret.
- See Also:
- setCaretPosition
All Packages Class Hierarchy This Package Previous Next Index