public final class BookmarkManager extends java.lang.Object implements PersistentStateComponent<Element>
Constructor and Description |
---|
BookmarkManager(Project project) |
Modifier and Type | Method and Description |
---|---|
void |
addEditorBookmark(Editor editor,
int lineIndex) |
void |
addFileBookmark(VirtualFile file,
java.lang.String description) |
Bookmark |
addTextBookmark(VirtualFile file,
int lineIndex,
java.lang.String description) |
void |
applyNewStateInTestMode(java.util.List<Bookmark> newList) |
void |
editDescription(Bookmark bookmark,
javax.swing.JComponent popup) |
Bookmark |
findBookmarkForMnemonic(char m) |
Bookmark |
findEditorBookmark(Document document,
int line) |
Bookmark |
findFileBookmark(VirtualFile file) |
Bookmark |
findLineBookmark(Editor editor,
boolean isWrapped,
boolean next) |
static BookmarkManager |
getInstance(Project project) |
Element |
getState() |
java.util.List<Bookmark> |
getValidBookmarks() |
boolean |
hasBookmarksWithMnemonics() |
void |
loadState(Element state)
This method is called when new component state is loaded.
|
void |
moveBookmarkDown(Bookmark bookmark)
Try to move bookmark one position down in the list
|
void |
moveBookmarkUp(Bookmark bookmark)
Try to move bookmark one position up in the list
|
void |
removeBookmark(Bookmark bookmark) |
void |
setDescription(Bookmark bookmark,
java.lang.String description) |
void |
setMnemonic(Bookmark bookmark,
char c) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
public BookmarkManager(Project project)
public static BookmarkManager getInstance(Project project)
public void editDescription(Bookmark bookmark, javax.swing.JComponent popup)
public void addEditorBookmark(Editor editor, int lineIndex)
public Bookmark addTextBookmark(VirtualFile file, int lineIndex, java.lang.String description)
public void addFileBookmark(VirtualFile file, java.lang.String description)
public java.util.List<Bookmark> getValidBookmarks()
public Bookmark findFileBookmark(VirtualFile file)
public Bookmark findBookmarkForMnemonic(char m)
public boolean hasBookmarksWithMnemonics()
public void removeBookmark(Bookmark bookmark)
public Element getState()
getState
in interface PersistentStateComponent<Element>
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
public void loadState(Element state)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<Element>
state
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public void applyNewStateInTestMode(java.util.List<Bookmark> newList)
public void moveBookmarkUp(Bookmark bookmark)
public void moveBookmarkDown(Bookmark bookmark)
public void setMnemonic(Bookmark bookmark, char c)
public void setDescription(Bookmark bookmark, java.lang.String description)