org.openide.text
Class DocumentLine

java.lang.Object
  |
  +--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.Set
 
Field Summary
protected  PositionRef pos
          reference to one position on the line
 
Fields inherited from class org.openide.text.Line
SHOW_GOTO, SHOW_SHOW, SHOW_TRY_SHOW
 
Constructor Summary
DocumentLine(DataObject obj, PositionRef pos)
          Constructor.
 
Method Summary
 boolean equals(Object o)
           
 int getLineNumber()
          Get the line number.
 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.
 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, getDataObject, getDisplayName, show
 
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


Built on February 22 2001.  |  Portions Copyright 1997-2000 Sun Microsystems, Inc. All rights reserved.