public class Annotations extends Object implements DocumentListener
Modifier and Type | Class and Description |
---|---|
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 |
Modifier and Type | Field and Description |
---|---|
static Comparator<JMenu> |
MENU_COMPARATOR
Sorts the subMenu items
|
Constructor and Description |
---|
Annotations(BaseDocument doc) |
Modifier and Type | Method and Description |
---|---|
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)
Searches line annotations for given type
|
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)
Deprecated.
The method name contains a typo. Use
getPassiveAnnotationsForLine |
AnnotationDesc[] |
getPassiveAnnotations(int offset)
Return list of passive annotations attached on the line of given offset
|
AnnotationDesc[] |
getPassiveAnnotationsForLine(int line) |
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
|
String |
toString() |
public static final Comparator<JMenu> MENU_COMPARATOR
public Annotations(BaseDocument doc)
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)
line
- source linetype
- annotation type nameAnnotationDesc
of given type on provided line@Deprecated public AnnotationDesc[] getPasiveAnnotations(int line)
getPassiveAnnotationsForLine
public AnnotationDesc[] getPassiveAnnotationsForLine(int line)
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)