    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Interface jclass.bwt.JCTextInterface

public interface JCTextInterface

##

addTextCursorListener(JCTextCursorListener)
  Adds the specified JCTextCursorEvent listener to receive cursor movement events.
addTextListener(JCTextListener)
  Adds the specified listener to receive text events.
append(String)
  Appends text to the end.
beep()
  Emits a beep.
getChanged()
  Returns true if the user has changed the value since the last programmatic setting.
getColumns()
  Returns the number of columns.
getCursorPosition()
  Gets the position of the cursor.
getEditable()
  Returns the boolean indicating whether this component is editable or not.
getLastPosition()
  Gets the position of the last character in the text.
getMinimumSize(int)
  Returns the minimum size needed for the specified number of columns.
getOverstrike()
  Gets the Overstrike value.
getSelectedBackground()
  Gets the SelectedBackground value.
getSelectedForeground()
  Gets the SelectedForeground value.
getSelectedText()
  Returns the selected text contained in this component.
getSelectionEnd()
  Returns the selected text's end position.
getSelectionList()
  Gets the current SelectionList.
getSelectionStart()
  Returns the selected text's start position.
getShowCursorPosition()
  Gets the ShowCursorPosition value.
getText()
  Returns the text contained in this component.
insert(String, int)
  Inserts text at the specified position.
isEditable()
  Returns the boolean indicating whether this component is editable or not.
pointToPosition(int, int)
  Maps a physical position to the corresponding character position.
replaceRange(String, int, int)
  Replaces text between two positions with the specified text.
select(int, int)
  Selects the text found between the specified start and end locations.
selectAll()
  Selects all the text in the component.
setAlignment(int)
  Sets the position of the text:
  BWTEnum.LEFT (default), CENTER, or RIGHT.
setColumns(int)
  Sets the number of columns.
setCursorPosition(int)
  Sets the position of the cursor.
setEditable(boolean)
  Determines whether this component is editable.
setMaximumLength(int)
  Sets the maximum number of characters which may be entered by the user (default: BWTEnum.MAXINT).
setOverstrike(boolean)
  If false (default), characters typed by the user are inserted into the current text.
setSelectedBackground(Color)
  Sets the background color of selected text (default: blue).

  HTML param name/value: "SelectedBackground"/color

setSelectedForeground(Color)
  Sets the foreground color of selected text (default: background color).

  HTML param name/value: "SelectedForeground"/color

setSelectionEnd(int)
  Sets the selected text's end position.
setSelectionList(int[])
  Sets a list of values used for multi-click.
setSelectionStart(int)
  Sets the selected text's start position.
setShowCursorPosition(boolean)
  If set to true (default), the cursor position will be indicated with a vertical I-beam.
setStringCase(int)
  Sets the case of text entered by the user or set programmatically:

      BWTEnum.CASE_AS_IS       No conversion (default)
      BWTEnum.CASE_LOWER       Convert to lower case
      BWTEnum.CASE_UPPER       Convert to upper case

setText(String)
  Sets the text of this component to the specified text.
showPosition(int)
  Scrolls the text if necessary to ensure that the position is visible.

##

setText

     public abstract void setText(String t)

  Sets the text of this component to the specified text.

  See Also:
    getText

getText

     public abstract String getText()

  Returns the text contained in this component.

  See Also:
    setText

getSelectedText

     public abstract String getSelectedText()

  Returns the selected text contained in this component.

  See Also:
    setText

isEditable

     public abstract boolean isEditable()

  Returns the boolean indicating whether this component is editable or not.

  See Also:
    setEditable

getEditable

     public abstract boolean getEditable()

  Returns the boolean indicating whether this component is editable or not.

  See Also:
    setEditable

setEditable

     public abstract void setEditable(boolean t)

  Determines whether this component is editable.

  See Also:
    isEditable

getSelectionStart

     public abstract int getSelectionStart()

  Returns the selected text's start position.

getSelectionEnd

     public abstract int getSelectionEnd()

  Returns the selected text's end position.

setSelectionStart

     public abstract void setSelectionStart(int pos)

  Sets the selected text's start position.

setSelectionEnd

     public abstract void setSelectionEnd(int pos)

  Sets the selected text's end position.

select

     public abstract void select(int start,
                                 int end)

  Selects the text found between the specified start and end locations.

selectAll

     public abstract void selectAll()

  Selects all the text in the component.

insert

     public abstract void insert(String str,
                                 int pos)

  Inserts text at the specified position.

  See Also:
    setText, replaceRange

append

     public abstract void append(String str)

  Appends text to the end.

  See Also:
    insert

replaceRange

     public abstract void replaceRange(String str,
                                       int start,
                                       int end)

  Replaces text between two positions with the specified text.

getColumns

     public abstract int getColumns()

  Returns the number of columns.

setColumns

     public abstract void setColumns(int v)

  Sets the number of columns.

setAlignment

     public abstract void setAlignment(int v)

  Sets the position of the text:
  BWTEnum.LEFT (default), CENTER, or RIGHT.

setMaximumLength

     public abstract void setMaximumLength(int v)

  Sets the maximum number of characters which may be entered by the user (default: BWTEnum.MAXINT). If the user attempts to enter more characters, the values will be ignored and the bell will be sounded. This value is ignored for values set programmatically.

setStringCase

     public abstract void setStringCase(int v)

  Sets the case of text entered by the user or set programmatically:

      BWTEnum.CASE_AS_IS       No conversion (default)
      BWTEnum.CASE_LOWER       Convert to lower case
      BWTEnum.CASE_UPPER       Convert to upper case

beep

     public abstract void beep()

  Emits a beep.

getChanged

     public abstract boolean getChanged()

  Returns true if the user has changed the value since the last programmatic setting.

getMinimumSize

     public abstract Dimension getMinimumSize(int columns)

  Returns the minimum size needed for the specified number of columns.

getSelectionList

     public abstract int[] getSelectionList()

  Gets the current SelectionList.

  See Also:
    setSelectionList

setSelectionList

     public abstract void setSelectionList(int list[])

  Sets a list of values used for multi-click. As the mouse is clicked in rapid succession, each click selects the next type in the list. Valid BWTEnum values (in order of the default list):

       SELECT_POSITION     Selects the current pointer position
       SELECT_WORD         Selects the current word
       SELECT_LINE         Selects the current line
       SELECT_PARAGRAPH    Selects the current paragraph
       SELECT_ALL          Selects all the text

  Default list: { BWTEnum.SELECT_POSITION, SELECT_WORD, SELECT_LINE, SELECT_ALL }

getSelectedBackground

     public abstract Color getSelectedBackground()

  Gets the SelectedBackground value.

  See Also:
    setSelectedBackground

setSelectedBackground

     public abstract void setSelectedBackground(Color v)

  Sets the background color of selected text (default: blue).

  HTML param name/value: "SelectedBackground"/color

  See Also:
    toColor

getSelectedForeground

     public abstract Color getSelectedForeground()

  Gets the SelectedForeground value.

  See Also:
    setSelectedForeground

setSelectedForeground

     public abstract void setSelectedForeground(Color v)

  Sets the foreground color of selected text (default: background color).

  HTML param name/value: "SelectedForeground"/color

  See Also:
    toColor

pointToPosition

     public abstract int pointToPosition(int x,
                                         int y)

  Maps a physical position to the corresponding character position.

showPosition

     public abstract void showPosition(int pos)

  Scrolls the text if necessary to ensure that the position is visible.

  Parameters:
    pos - the number of characters from the beginning of the text buffer.

getCursorPosition

     public abstract int getCursorPosition()

  Gets the position of the cursor.

  See Also:
    setCursorPosition

setCursorPosition

     public abstract void setCursorPosition(int pos)

  Sets the position of the cursor.

setOverstrike

     public abstract void setOverstrike(boolean v)

  If false (default), characters typed by the user are inserted into the current text.

getOverstrike

     public abstract boolean getOverstrike()

  Gets the Overstrike value.

  See Also:
    setOverstrike

getLastPosition

     public abstract int getLastPosition()

  Gets the position of the last character in the text. This represents the position that text appended to the component would be placed after.

getShowCursorPosition

     public abstract boolean getShowCursorPosition()

  Gets the ShowCursorPosition value.

  See Also:
    setShowCursorPosition

setShowCursorPosition

     public abstract void setShowCursorPosition(boolean v)

  If set to true (default), the cursor position will be indicated with a vertical I-beam.

addTextListener

     public abstract void addTextListener(JCTextListener l)

  Adds the specified listener to receive text events.

  See Also:
    JCTextEvent

addTextCursorListener

     public abstract void addTextCursorListener(JCTextCursorListener l)

  Adds the specified JCTextCursorEvent listener to receive cursor movement events.

  See Also:
    JCTextCursorEvent

    All Packages  Class Hierarchy  This Package  Previous  Next  Index