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

Method Index

 o clearSelection()
Deselects all selected text in this text component.
 o copy()
Copies any selected text to the clipboard.
 o getCaretPosition()
Gets the position of the text insertion caret for this text component.
 o getColumns()
Gets the number of columns in this text component.
 o getSelectedText()
Gets the selected text.
 o getSelectionEnd()
Gets the end position of the selected text in this text component.
 o getSelectionStart()
Gets the start position of the selected text in this text component.
 o getText()
Gets the text.
 o getText(int, int)
Gets the text starting at the specified offset of the specified length.
 o select(int, int)
Selects the text between the specified start and end positions.
 o selectAll()
Selects all the text in this text component.
 o setCaretPosition(int)
Sets the position of the text insertion caret for this text component.
 o setSelectionEnd(int)
Sets the selection end for this text component to the specified position.
 o setSelectionStart(int)
Sets the selection start for this text component to the specified position.
 o setText(int, String)
Sets the text starting at the specified offset of a specified string.
 o setText(String)
Sets the text.

Methods

 o getText
 public abstract String getText()
Gets the text.

Returns:
the text
See Also:
setText, getCaption
 o setText
 public abstract void setText(String text)
Sets the text. If the textComponent is host-linked, the operation is ignored.

Parameters:
textthe - text to set
See Also:
getText, setCaption
 o 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
 o 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
 o getColumns
 public abstract int getColumns()
Gets the number of columns in this text component.

Returns:
the number of columns.
 o getSelectedText
 public abstract String getSelectedText()
Gets the selected text.

Returns:
the selected text.
See Also:
select
 o 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
 o 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
 o 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
 o 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
 o 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
 o selectAll
 public abstract void selectAll()
Selects all the text in this text component.

See Also:
select
 o clearSelection
 public abstract void clearSelection()
Deselects all selected text in this text component.

See Also:
select
 o copy
 public abstract void copy()
Copies any selected text to the clipboard.

 o 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
 o 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