|
org.openide.text 6.9.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.text.Annotatable org.openide.text.Line
public abstract class Line
Represents one line in a text document. The line number may change when the text is modified, but the identity of the line is retained. It is designed to allow line-dependent modules of the IDE (such as the compiler and debugger) to make use of a line consistently even as the text is modified.
Nested Class Summary | |
---|---|
static class |
Line.Part
Representation of the part of the Line's text. |
static class |
Line.Set
Object that represents a snapshot of lines at the time it was created. |
Field Summary | |
---|---|
static String |
PROP_LINE_NUMBER
Property name of the line number |
static int |
SHOW_GOTO
Opens the editor if necessary, shows the line, and takes the focus. |
static int |
SHOW_SHOW
Opens the editor if necessary and shows the line. |
static int |
SHOW_TOFRONT
Same as SHOW_GOTO except that the Window Manager attempts to front the editor window (i.e. |
static int |
SHOW_TRY_SHOW
Shows the line only if the editor is open. |
Fields inherited from class org.openide.text.Annotatable |
---|
PROP_ANNOTATION_COUNT, PROP_DELETED, PROP_TEXT |
Constructor Summary | |
---|---|
Line(Lookup context)
Create a new line object based on a given data object. |
|
Line(Object source)
Create a new line object based on a given data object. |
Method Summary | |
---|---|
boolean |
canBeMarkedCurrent(int action,
Line previousLine)
Deprecated. Deprecated since 1.20, as markCurrentLine() is deprecated by Annotation.attach(org.openide.text.Annotatable) . |
Line.Part |
createPart(int column,
int length)
Create object which represent part of the text on the line. |
String |
getDisplayName()
Composes a human presentable name for the line. |
abstract int |
getLineNumber()
Get the line number. |
Lookup |
getLookup()
Provides access to the context passed into the line constructor. |
String |
getText()
Get content of the annotatable. |
abstract boolean |
isBreakpoint()
Deprecated. Deprecated since 1.20. Use Annotation instead. |
abstract void |
markCurrentLine()
Deprecated. Deprecated since 1.20. Use Annotation.attach(org.openide.text.Annotatable) instead. |
abstract void |
markError()
Deprecated. Deprecated since 1.20. Use Annotation.attach(org.openide.text.Annotatable) instead. |
abstract void |
setBreakpoint(boolean b)
Deprecated. Deprecated since 1.20. Use Annotation.attach(org.openide.text.Annotatable) instead. |
void |
show(int kind)
Shows the line (at the first column). |
abstract void |
show(int kind,
int column)
Show the line. |
abstract void |
unmarkCurrentLine()
Deprecated. Deprecated since 1.20. Use Annotation.detach() instead. |
abstract void |
unmarkError()
Deprecated. Deprecated since 1.20. Use Annotation.detach() instead. |
Methods inherited from class org.openide.text.Annotatable |
---|
addAnnotation, addPropertyChangeListener, firePropertyChange, getAnnotationCount, isDeleted, removeAnnotation, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_LINE_NUMBER
public static final int SHOW_TRY_SHOW
show
,
Constant Field Valuespublic static final int SHOW_SHOW
show
,
Constant Field Valuespublic static final int SHOW_GOTO
show
,
Constant Field Valuespublic static final int SHOW_TOFRONT
show
,
TopComponent.toFront()
,
Constant Field ValuesConstructor Detail |
---|
public Line(Lookup context)
The context argument shall contain information about the
producer of the Line, that can be then extracted by getLookup()
call.
context
- the context for this linepublic Line(Object source)
source
- the object that is producing the LineMethod Detail |
---|
public String getDisplayName()
public final Lookup getLookup()
DataEditorSupport
provide DataObject
as the content of the lookup.
One can use:
dataObjectOrNull = (DataObject)line.getLookup ().lookup (DataObject.class);to get the access.
public abstract int getLineNumber()
Line.Set lineSet =Line l = l.equals (lineSet.getCurrent (l.getLineNumber ()))
public abstract void show(int kind, int column)
kind
- one of SHOW_TRY_SHOW
, SHOW_SHOW
, or SHOW_GOTO
column
- the column of this line which should be selectedpublic void show(int kind)
kind
- one of SHOW_TRY_SHOW
, SHOW_SHOW
, or SHOW_GOTO
show(int, int)
public abstract void setBreakpoint(boolean b)
Annotation.attach(org.openide.text.Annotatable)
instead.
b
- true
to turn onpublic abstract boolean isBreakpoint()
Annotation
instead.
true
is there ispublic abstract void markError()
Annotation.attach(org.openide.text.Annotatable)
instead.
public abstract void unmarkError()
Annotation.detach()
instead.
public abstract void markCurrentLine()
Annotation.attach(org.openide.text.Annotatable)
instead.
public abstract void unmarkCurrentLine()
Annotation.detach()
instead.
public boolean canBeMarkedCurrent(int action, Line previousLine)
markCurrentLine()
is deprecated by Annotation.attach(org.openide.text.Annotatable)
.
The default implementation simply returns true.
action
- type of action that is trying to mark this line as current
one of constants (Debugger.ACTION_BREAKPOINT_HIT,
Debugger.ACTION_TRACE_OVER, etc.)previousLine
- previous line (if any) or null
public Line.Part createPart(int column, int length)
column
- starting column of the part of the textlength
- length of the part of the text
public String getText()
Annotatable
getText
in class Annotatable
|
org.openide.text 6.9.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |