|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.editor.LineMark
A LineMark is an object that represents a line position within a document. LineMarks are tracked by the document, and moved around as changes to the document occur. Someone interested in a LineMark can ask the mark for its markLine, which will return the line that it is on.
A LineMark can be constructed as a lightweight mark, in which case it does not store a reference to the document in which it exists, thus it cannot be asked what line it exists on. The purpose of a lightweight mark is to enable the same mark to exist in multiple places in the document (i.e. you can add a lightweight LineMark to the same document over and over again). The lightweight capability was originally created to display executable lines when running the debugger, but it can be used for other types of display-only markup as well.
EditorDocument
Constructor Summary | |
LineMark()
Create a new "heavyweight" LineMark. |
|
LineMark(boolean lightweight)
Create a new LineMark. |
|
LineMark(boolean lightweight,
javax.swing.text.Style style)
Create a new LineMark that paints using the specified style. |
|
LineMark(boolean lightweight,
javax.swing.text.Style style,
EditorPane editor)
Create a new LineMark that paints using the specified style and make sure it will only be displayed in the specified editor. |
|
LineMark(javax.swing.text.Style style)
Create a new "heavyweight" LineMark that paints using the specified style. |
Method Summary | |
void |
addEditor(EditorPane editor)
Normally linemarks are tied to a document and all editors that display that document will show the linemark. |
boolean |
displayInEditor(EditorPane editor)
Should this line mark be displayed in the incoming editor? If this line mark is not editor specific, it can always be displayed in all editors, otherwise the incoming editor has to be one of the editors set by addEditor. |
int |
getDisplayPriority()
Describes the logical priority this mark belongs to for ordering purposes. |
protected EditorDocument |
getDocument()
Get the document that this mark is associated with. |
int |
getMarkLine()
Get the current location of this mark. |
javax.swing.text.Style |
getStyle()
Get the style to use when painting a line with this mark. |
boolean |
isLightweight()
Check to see if this is a lightweight mark or not. |
void |
removeEditor()
Remove all the ties that this line mark has to all editor panes. |
void |
removeEditor(javax.swing.text.Document doc)
Remove all the ties that this line mark has to all editor panes belonging to this document. |
void |
removeEditor(EditorPane editor)
Remove all the ties that this line mark has to the incoming editor pane. |
protected void |
setDisplayPriority(int priority)
Set the logical priority this mark belongs to for ordering purposes. |
void |
setDocument(EditorDocument doc)
This is called by the document when a mark is inserted. |
protected void |
setStyle(javax.swing.text.Style style)
Set the style to use when painting a line with this mark. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LineMark()
public LineMark(boolean lightweight)
lightweight
- True if this is to be a lightweight mark.public LineMark(javax.swing.text.Style style)
style
- The style to use when painting a line with this mark.public LineMark(boolean lightweight, javax.swing.text.Style style)
lightweight
- True if this is to be a lightweight mark.style
- The style to use when painting a line with this mark.public LineMark(boolean lightweight, javax.swing.text.Style style, EditorPane editor)
lightweight
- True if this is to be a lightweight mark.style
- The style to use when painting a line with this mark.editor
- The editor that should exclusively show this linemark.Method Detail |
public boolean isLightweight()
public javax.swing.text.Style getStyle()
protected void setStyle(javax.swing.text.Style style)
style
- The style.public int getDisplayPriority()
For reference, here are some of the defined priority values:
protected void setDisplayPriority(int priority)
priority
- An int value specifying the display priority of this mark.getDisplayPriority()
public void setDocument(EditorDocument doc)
protected EditorDocument getDocument()
This is provided so that subclasses can manage themselves, if desired. A subclasses can get access to the document it are associated with so that it can remove itself from that document before placing itself somewhere else.
public void addEditor(EditorPane editor)
editor
- The EditorPane that should be tied to this lineMark.
This call does nothing if editor is null.public boolean displayInEditor(EditorPane editor)
public void removeEditor(EditorPane editor)
editor
- The editor pane that should not be tied
to this line mark anymore.public void removeEditor(javax.swing.text.Document doc)
doc
- The document whose editors should not
have any ties anymore to this linemark.public void removeEditor()
public int getMarkLine()
-1
is
returned if this mark does not exist in a document, or if this
mark is lightweight.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |