org.openide.text
Class DocumentLine

java.lang.Object
  |
  +--org.openide.text.Annotatable
        |
        +--org.openide.text.Line
              |
              +--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

Inner Class Summary
static class DocumentLine.Set
          Abstract implementation of Line.Set.
 
Inner classes inherited from class org.openide.text.Line
Line.Part, 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_TRY_SHOW
 
Fields inherited from class org.openide.text.Annotatable
PROP_ANNOTATION_COUNT, PROP_DELETED, PROP_TEXT
 
Constructor Summary
DocumentLine(DataObject 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, getDataObject, getDisplayName, 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(DataObject obj,
                    PositionRef pos)
Constructor.
Parameters:
obj - data object we belong to
pos - position on the line
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 ())) 
 
Overrides:
getLineNumber in class Line
Following copied from class: org.openide.text.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.
Overrides:
show in class Line
Following copied from class: org.openide.text.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.
Overrides:
setBreakpoint in class Line
Following copied from class: org.openide.text.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.
Overrides:
isBreakpoint in class Line
Following copied from class: org.openide.text.Line
Returns:
true is there is

markError

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

unmarkError

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

markCurrentLine

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

unmarkCurrentLine

public void unmarkCurrentLine()
Description copied from class: Line
Unmark this line as current.
Overrides:
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
Following copied from class: org.openide.text.Annotatable
Returns:
text representing the content of annotatable. The return value can be null, what means that document is closed.


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.