org.nakedobjects.plugins.dnd.viewer.view.text
Class CursorPosition

java.lang.Object
  extended by org.nakedobjects.plugins.dnd.viewer.view.text.CursorPosition

public class CursorPosition
extends java.lang.Object

Represents the position of a line cursor within a TextContent. The character position for a line extends from zero to text.length + 1. Where 0 means the cursor is to the left of the first character, and 1 is to right of the first character and to the left of the second character.


Constructor Summary
CursorPosition(TextContent content, CursorPosition pos)
           
CursorPosition(TextContent content, int line, int afterCharacter)
           
 
Method Summary
 void asFor(CursorPosition pos)
           
 void bottom()
          Move the cursor to the bottom-right of the field
 void cursorAt(Location atLocation)
           
 void end()
          Move the cursor to the end of the line
 int getCharacter()
           
 int getLine()
           
 void home()
          Move the cursor to the left end of the field
 boolean isBefore(CursorPosition positionToCompare)
           
 void left()
          Movet the cursor left by one character.
 void lineDown()
          Move down one line.
 void lineUp()
          Move up one line.
 void pageDown()
          Move down one page.
 void pageUp()
          Move cursor up by a page
 void right()
          Move the cursor right by one character.
 void right(int characters)
          Move the cursor right by one character.
 boolean samePosition(CursorPosition positionToCompare)
           
 void top()
          Move the cursor to the top-left of the field
 java.lang.String toString()
           
 void wordLeft()
          Move the cursor left to the beginning of the previous word.
 void wordRight()
          Move the cursor right to the end of the current word.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CursorPosition

public CursorPosition(TextContent content,
                      CursorPosition pos)

CursorPosition

public CursorPosition(TextContent content,
                      int line,
                      int afterCharacter)
Method Detail

asFor

public void asFor(CursorPosition pos)

bottom

public void bottom()
Move the cursor to the bottom-right of the field


cursorAt

public void cursorAt(Location atLocation)

end

public void end()
Move the cursor to the end of the line


getCharacter

public int getCharacter()
Returns:
the character within this line.

getLine

public int getLine()
Returns:
the line within the field

home

public void home()
Move the cursor to the left end of the field


left

public void left()
Movet the cursor left by one character.


lineDown

public void lineDown()
Move down one line.


lineUp

public void lineUp()
Move up one line.


pageDown

public void pageDown()
Move down one page.


pageUp

public void pageUp()
Move cursor up by a page


right

public void right()
Move the cursor right by one character.


right

public void right(int characters)
Move the cursor right by one character.


top

public void top()
Move the cursor to the top-left of the field


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

wordLeft

public void wordLeft()
Move the cursor left to the beginning of the previous word.


wordRight

public void wordRight()
Move the cursor right to the end of the current word.


samePosition

public boolean samePosition(CursorPosition positionToCompare)

isBefore

public boolean isBefore(CursorPosition positionToCompare)


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.