public final class FavoritesManager extends java.lang.Object implements PersistentStateComponent<Element>
Constructor and Description |
---|
FavoritesManager(Project project) |
Modifier and Type | Method and Description |
---|---|
void |
addFavoritesListener(FavoritesListener listener,
Disposable parent) |
boolean |
addRoots(java.lang.String name,
java.util.Collection<? extends AbstractTreeNode<?>> nodes) |
boolean |
addRoots(java.lang.String name,
Module moduleContext,
java.lang.Object elements) |
boolean |
canAddRoots(java.lang.String name,
java.util.Collection<? extends AbstractTreeNode<?>> nodes) |
boolean |
canReorder(java.lang.String nameToOrder,
java.lang.String anchorName,
boolean above) |
boolean |
contains(java.lang.String name,
VirtualFile vFile) |
void |
createNewList(java.lang.String listName) |
static AbstractUrl |
createUrlByElement(java.lang.Object element,
Project project) |
void |
fireListeners(java.lang.String listName) |
java.util.List<java.lang.String> |
getAvailableFavoritesListNames() |
java.util.Comparator<FavoriteTreeNodeDescriptor> |
getCustomComparator(java.lang.String name) |
java.lang.String |
getFavoriteListName(java.lang.String currentSubId,
VirtualFile vFile) |
java.util.List<TreeItem<Pair<AbstractUrl,java.lang.String>>> |
getFavoritesListRootUrls(java.lang.String name) |
static FavoritesManager |
getInstance(Project project) |
FavoritesListProvider |
getListProvider(java.lang.String name) |
Element |
getState() |
FavoritesViewSettings |
getViewSettings() |
protected java.util.Collection<VirtualFile> |
getVirtualFiles(java.lang.String listName,
boolean recursively) |
void |
loadState(Element element)
This method is called when new component state is loaded.
|
void |
removeFavoritesList(java.lang.String name) |
boolean |
removeRoot(java.lang.String name,
java.util.List<? extends AbstractTreeNode<?>> elements) |
void |
renameList(Project project,
java.lang.String listName) |
void |
setOrder(java.lang.String nameToOrder,
java.lang.String anchorName,
boolean above) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
public FavoritesManager(Project project)
public static FavoritesManager getInstance(Project project)
public void renameList(Project project, java.lang.String listName)
public void addFavoritesListener(FavoritesListener listener, Disposable parent)
public java.util.List<java.lang.String> getAvailableFavoritesListNames()
public void createNewList(java.lang.String listName)
public void fireListeners(java.lang.String listName)
public FavoritesViewSettings getViewSettings()
public void removeFavoritesList(java.lang.String name)
public java.util.List<TreeItem<Pair<AbstractUrl,java.lang.String>>> getFavoritesListRootUrls(java.lang.String name)
public boolean addRoots(java.lang.String name, Module moduleContext, java.lang.Object elements)
public java.util.Comparator<FavoriteTreeNodeDescriptor> getCustomComparator(java.lang.String name)
public boolean addRoots(java.lang.String name, java.util.Collection<? extends AbstractTreeNode<?>> nodes)
public boolean canAddRoots(java.lang.String name, java.util.Collection<? extends AbstractTreeNode<?>> nodes)
public boolean removeRoot(java.lang.String name, java.util.List<? extends AbstractTreeNode<?>> elements)
public void setOrder(java.lang.String nameToOrder, java.lang.String anchorName, boolean above)
public boolean canReorder(java.lang.String nameToOrder, java.lang.String anchorName, boolean above)
public FavoritesListProvider getListProvider(java.lang.String name)
public void loadState(Element element)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<Element>
element
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
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 static AbstractUrl createUrlByElement(java.lang.Object element, Project project)
public java.lang.String getFavoriteListName(java.lang.String currentSubId, VirtualFile vFile)
public boolean contains(java.lang.String name, VirtualFile vFile)
protected java.util.Collection<VirtualFile> getVirtualFiles(java.lang.String listName, boolean recursively)