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

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

public class TextContent
extends java.lang.Object


Field Summary
static int NO_WRAPPING
           
static int WRAPPING
           
 
Constructor Summary
TextContent(TextBlockTarget target, int noLines, int wrapStyle)
           
 
Method Summary
 void alignDisplay(int line)
          Aligns the lines of content so that the specified line is within the array of lines returned by getDisplayLines().
 void breakBlock(CursorPosition cursorAt)
           
 boolean decreaseDepth()
           
 void delete(TextSelection selection)
          deletes the selected text
 void deleteLeft(CursorPosition cursorAt)
           
 void deleteRight(CursorPosition cursorAt)
           
 int getDisplayFromLine()
           
 java.lang.String[] getDisplayLines()
           
 int getNoDisplayLines()
          Returns the number of lines that this field will display the content.
 int getNoLinesOfContent()
          Returns the number of lines required to display the content text in it entirety.
 java.lang.String getText()
          returns the entire text of the content, with a newline between each block (but not after the final block.
 java.lang.String getText(int forLine)
          returns the text on the specified line
 java.lang.String getText(TextSelection selection)
          returns only the text that is selected
 void increaseDepth()
           
 void insert(CursorPosition cursorAt, java.lang.String characters)
           
 void setNoDisplayLines(int noDisplayLines)
           
 void setText(java.lang.String text)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_WRAPPING

public static final int NO_WRAPPING
See Also:
Constant Field Values

WRAPPING

public static final int WRAPPING
See Also:
Constant Field Values
Constructor Detail

TextContent

public TextContent(TextBlockTarget target,
                   int noLines,
                   int wrapStyle)
Method Detail

getNoDisplayLines

public int getNoDisplayLines()
Returns the number of lines that this field will display the content. This can be smaller than the actual number of lines of content, but will be at least one.


alignDisplay

public void alignDisplay(int line)
Aligns the lines of content so that the specified line is within the array of lines returned by getDisplayLines().

See Also:
getDisplayLines()

breakBlock

public void breakBlock(CursorPosition cursorAt)

delete

public void delete(TextSelection selection)
deletes the selected text


deleteLeft

public void deleteLeft(CursorPosition cursorAt)

deleteRight

public void deleteRight(CursorPosition cursorAt)

getText

public java.lang.String getText()
returns the entire text of the content, with a newline between each block (but not after the final block.


getText

public java.lang.String getText(int forLine)
returns the text on the specified line


getText

public java.lang.String getText(TextSelection selection)
returns only the text that is selected


insert

public void insert(CursorPosition cursorAt,
                   java.lang.String characters)

getNoLinesOfContent

public int getNoLinesOfContent()
Returns the number of lines required to display the content text in it entirety.


setText

public void setText(java.lang.String text)

toString

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

getDisplayLines

public java.lang.String[] getDisplayLines()

getDisplayFromLine

public int getDisplayFromLine()

setNoDisplayLines

public void setNoDisplayLines(int noDisplayLines)

increaseDepth

public void increaseDepth()

decreaseDepth

public boolean decreaseDepth()


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