|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.editor.Annotations
public class Annotations
Annotations class act as data model containing all annotations attached to one document. Class uses instances of private class LineAnnotations for grouping of added annotations by line. These objects (LineAnnotations) are referenced from two collections. First one is Map where the key is Mark. It is used during the drawing in DrawLayerFactory.AnnotationLayer - when the mark appears in mark change, the LineAnnotations instance is found for it and the active annotation on the line can be queried. Second is List where the LineAnnotations are sorted by line number. This list is used for drawing the annotations in the gutter when the sequential order is important. The class also listen on document. It need to know how many lines where removed or added to refresh the LineAnnotations.line property.
Nested Class Summary | |
---|---|
static interface |
Annotations.AnnotationsListener
Listener for listening on changes in Annotations object. |
static class |
Annotations.LineAnnotations
Manager of all annotations attached to one line. |
static class |
Annotations.MenuComparator
|
Field Summary | |
---|---|
static Comparator |
MENU_COMPARATOR
Sorts the subMenu items |
Constructor Summary | |
---|---|
Annotations(BaseDocument doc)
|
Method Summary | |
---|---|
AnnotationDesc |
activateNextAnnotation(int line)
Activate next annotation on the line. |
void |
addAnnotation(AnnotationDesc anno)
Add annotation |
void |
addAnnotationsListener(Annotations.AnnotationsListener listener)
Add AnnotationsListener listener |
void |
changedUpdate(DocumentEvent e)
Gives notification that an attribute or set of attributes changed. |
JMenu |
createMenu(BaseKit kit,
int line)
Creates popup menu with all actions for the given line. |
JPopupMenu |
createPopupMenu(BaseKit kit,
int line)
Creates popup menu with all actions for the given line. |
protected void |
fireChangedAll()
Fire AnnotationsListener.ChangedAll change |
protected void |
fireChangedLine(int line)
Fire AnnotationsListener.ChangedLine change |
void |
frontAnnotation(AnnotationDesc anno)
Move annotation in front of others. |
AnnotationDesc |
getActiveAnnotation(int line)
Returns the active annotation for the given line number. |
AnnotationDesc |
getActiveAnnotation(Mark mark)
Finds active annotation for the Mark. |
AnnotationDesc |
getAnnotation(int line,
String type)
Get next line number with some annotation |
DrawLayerFactory.AnnotationLayer |
getLayer()
Finds the drawing layer for annotations |
protected Annotations.LineAnnotations |
getLineAnnotations(int line)
Finds LineAnnotations for the given line number |
int |
getNextLineWithAnnotation(int line)
Get next line number with some annotation |
int |
getNumberOfAnnotations(int line)
Returns number of visible annotations on the line |
AnnotationDesc[] |
getPasiveAnnotations(int line)
Return list of pasive annotations which should be drawn on the backgorund |
AnnotationDesc[] |
getPassiveAnnotations(int offset)
Return list of passive annotations attached on the line of given offset |
void |
insertUpdate(DocumentEvent e)
Checks the number of inserted lines and recalculate LineAnnotations.line property |
boolean |
isGlyphButtonColumn()
Return whether this document has or had more annotations on one line. |
boolean |
isGlyphColumn()
Return whether this document has or had any glyph icon attached. |
protected void |
refreshLine(int line)
Notify view that it is necessary to redraw the line of the document |
void |
removeAnnotation(AnnotationDesc anno)
Remove annotation |
void |
removeAnnotationsListener(Annotations.AnnotationsListener listener)
Remove AnnotationsListener listener |
void |
removeUpdate(DocumentEvent e)
Checks the number of removed lines and recalculate LineAnnotations.line property |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Comparator MENU_COMPARATOR
Constructor Detail |
---|
public Annotations(BaseDocument doc)
Method Detail |
---|
public DrawLayerFactory.AnnotationLayer getLayer()
public void addAnnotation(AnnotationDesc anno)
public void removeAnnotation(AnnotationDesc anno)
public AnnotationDesc getActiveAnnotation(Mark mark)
protected Annotations.LineAnnotations getLineAnnotations(int line)
public AnnotationDesc getActiveAnnotation(int line)
public void frontAnnotation(AnnotationDesc anno)
public AnnotationDesc activateNextAnnotation(int line)
public int getNextLineWithAnnotation(int line)
public AnnotationDesc getAnnotation(int line, String type)
public AnnotationDesc[] getPasiveAnnotations(int line)
public AnnotationDesc[] getPassiveAnnotations(int offset)
public int getNumberOfAnnotations(int line)
protected void refreshLine(int line)
public void removeUpdate(DocumentEvent e)
removeUpdate
in interface DocumentListener
public void insertUpdate(DocumentEvent e)
insertUpdate
in interface DocumentListener
public void changedUpdate(DocumentEvent e)
changedUpdate
in interface DocumentListener
public void addAnnotationsListener(Annotations.AnnotationsListener listener)
public void removeAnnotationsListener(Annotations.AnnotationsListener listener)
protected void fireChangedLine(int line)
protected void fireChangedAll()
public boolean isGlyphColumn()
public boolean isGlyphButtonColumn()
public JPopupMenu createPopupMenu(BaseKit kit, int line)
public JMenu createMenu(BaseKit kit, int line)
|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |