org.openide.text 6.9.22

org.openide.text
Class DocumentLine

java.lang.Object
  extended by org.openide.text.Annotatable
      extended by org.openide.text.Line
          extended by org.openide.text.DocumentLine
All Implemented Interfaces:
Serializable

public abstract class DocumentLine
extends Line

Implementation of a line in a StyledDocument. One object of this class represents a line in the document by holding a PositionRef, which can represent a position in an open or closed document.

See Also:
Serialized Form

Nested Class Summary
static class DocumentLine.Set
          Abstract implementation of Line.Set.
 
Field Summary
protected  PositionRef pos
          reference to one position on the line
 
Fields inherited from class org.openide.text.Line
PROP_LINE_NUMBER, SHOW_GOTO, SHOW_SHOW, SHOW_TOFRONT, SHOW_TRY_SHOW
 
Fields inherited from class org.openide.text.Annotatable
PROP_ANNOTATION_COUNT, PROP_DELETED, PROP_TEXT
 
Constructor Summary
DocumentLine(Lookup obj, PositionRef pos)
          Constructor.
 
Method Summary
protected  void addAnnotation(Annotation anno)
          Add annotation to this Annotatable class
 boolean equals(Object o)
           
 int getLineNumber()
          Get the line number.
 String getText()
          Get content of the annotatable.
 int hashCode()
           
 boolean isBreakpoint()
          Test if there is a breakpoint set at this line.
 void markCurrentLine()
          Mark this line as current.
 void markError()
          Mark an error at this line.
protected  void removeAnnotation(Annotation anno)
          Remove annotation to this Annotatable class
 void setBreakpoint(boolean b)
          Set or clear a (debugger) breakpoint at this line.
abstract  void show(int kind, int column)
          Show the line.
 void unmarkCurrentLine()
          Unmark this line as current.
 void unmarkError()
          Unmark error at this line.
 
Methods inherited from class org.openide.text.Line
canBeMarkedCurrent, createPart, getDisplayName, getLookup, show
 
Methods inherited from class org.openide.text.Annotatable
addPropertyChangeListener, firePropertyChange, getAnnotationCount, isDeleted, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pos

protected PositionRef pos
reference to one position on the line

Constructor Detail

DocumentLine

public DocumentLine(Lookup obj,
                    PositionRef pos)
Constructor.

Parameters:
obj - context we belong to
pos - position on the line
Since:
4.3
Method Detail

getLineNumber

public int getLineNumber()
Description copied from class: Line
Get the line number. The last condition in following should always be true:
   Line.Set lineSet = 
   Line l = 

   l.equals (lineSet.getCurrent (l.getLineNumber ()))
 

Specified by:
getLineNumber in class Line
Returns:
current line number (may change as text is edited)

show

public abstract void show(int kind,
                          int column)
Description copied from class: Line
Show the line.

Specified by:
show in class Line
Parameters:
kind - one of Line.SHOW_TRY_SHOW, Line.SHOW_SHOW, or Line.SHOW_GOTO
column - the column of this line which should be selected

setBreakpoint

public void setBreakpoint(boolean b)
Description copied from class: Line
Set or clear a (debugger) breakpoint at this line.

Specified by:
setBreakpoint in class Line
Parameters:
b - true to turn on

isBreakpoint

public boolean isBreakpoint()
Description copied from class: Line
Test if there is a breakpoint set at this line.

Specified by:
isBreakpoint in class Line
Returns:
true is there is

markError

public void markError()
Description copied from class: Line
Mark an error at this line.

Specified by:
markError in class Line

unmarkError

public void unmarkError()
Description copied from class: Line
Unmark error at this line.

Specified by:
unmarkError in class Line

markCurrentLine

public void markCurrentLine()
Description copied from class: Line
Mark this line as current.

Specified by:
markCurrentLine in class Line

unmarkCurrentLine

public void unmarkCurrentLine()
Description copied from class: Line
Unmark this line as current.

Specified by:
unmarkCurrentLine in class Line

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

addAnnotation

protected void addAnnotation(Annotation anno)
Add annotation to this Annotatable class

Overrides:
addAnnotation in class Annotatable
Parameters:
anno - annotation which will be attached to this class

removeAnnotation

protected void removeAnnotation(Annotation anno)
Remove annotation to this Annotatable class

Overrides:
removeAnnotation in class Annotatable
Parameters:
anno - annotation which will be detached from this class

getText

public String getText()
Description copied from class: Annotatable
Get content of the annotatable. The listeners can listen on changes of PROP_TEXT property to learn that content of Annotatable is changing.

Overrides:
getText in class Line
Returns:
text representing the content of annotatable. The return value can be null, what means that document is closed.

org.openide.text 6.9.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.