本文整理汇总了Java中com.intellij.ide.favoritesTreeView.FavoritesManager.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java FavoritesManager.getInstance方法的具体用法?Java FavoritesManager.getInstance怎么用?Java FavoritesManager.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.favoritesTreeView.FavoritesManager
的用法示例。
在下文中一共展示了FavoritesManager.getInstance方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
Project project = e.getProject();
final FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
FavoritesTreeNodeDescriptor[] roots = FavoritesTreeViewPanel.CONTEXT_FAVORITES_ROOTS_DATA_KEY.getData(dataContext);
if (roots == null) return;
for (FavoritesTreeNodeDescriptor root : roots) {
FavoritesTreeNodeDescriptor listNode = root.getFavoritesRoot();
if (listNode != null && listNode !=root && listNode.getElement() instanceof FavoritesListNode) {
doSend(favoritesManager, new FavoritesTreeNodeDescriptor[]{root}, listNode.getElement().getName());
}
}
}
示例2: actionPerformed
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
Project project = e.getProject();
FavoritesViewTreeBuilder treeBuilder = FavoritesTreeViewPanel.FAVORITES_TREE_BUILDER_KEY.getData(e.getDataContext());
String listName = FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY.getData(e.getDataContext());
if (project == null || treeBuilder == null || listName == null) {
return;
}
FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
FavoritesListProvider provider = favoritesManager.getListProvider(listName);
Set<Object> selection = treeBuilder.getSelectedElements();
if (provider != null && provider.willHandle(CommonActionsPanel.Buttons.EDIT, project, selection)) {
provider.handle(CommonActionsPanel.Buttons.EDIT, project, selection, treeBuilder.getTree());
return;
}
favoritesManager.renameList(project, listName);
}
示例3: update
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e) {
e.getPresentation().setText(getTemplatePresentation().getText());
e.getPresentation().setIcon(CommonActionsPanel.Buttons.EDIT.getIcon());
e.getPresentation().setEnabled(true);
Project project = e.getProject();
FavoritesViewTreeBuilder treeBuilder = FavoritesTreeViewPanel.FAVORITES_TREE_BUILDER_KEY.getData(e.getDataContext());
String listName = FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY.getData(e.getDataContext());
if (project == null || treeBuilder == null || listName == null) {
e.getPresentation().setEnabled(false);
return;
}
FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
FavoritesListProvider provider = favoritesManager.getListProvider(listName);
Set<Object> selection = treeBuilder.getSelectedElements();
if (provider != null) {
e.getPresentation().setEnabled(provider.willHandle(CommonActionsPanel.Buttons.EDIT, project, selection));
e.getPresentation().setText(provider.getCustomName(CommonActionsPanel.Buttons.EDIT));
}
}
示例4: update
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e) {
e.getPresentation().setText(CommonActionsPanel.Buttons.EDIT.getText());
e.getPresentation().setIcon(CommonActionsPanel.Buttons.EDIT.getIcon());
e.getPresentation().setEnabled(true);
Project project = e.getProject();
FavoritesViewTreeBuilder treeBuilder = FavoritesTreeViewPanel.FAVORITES_TREE_BUILDER_KEY.getData(e.getDataContext());
String listName = FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY.getData(e.getDataContext());
if (project == null || treeBuilder == null || listName == null) {
e.getPresentation().setEnabled(false);
return;
}
FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
FavoritesListProvider provider = favoritesManager.getListProvider(listName);
Set<Object> selection = treeBuilder.getSelectedElements();
if (provider != null) {
e.getPresentation().setEnabled(provider.willHandle(CommonActionsPanel.Buttons.EDIT, project, selection));
e.getPresentation().setText(provider.getCustomName(CommonActionsPanel.Buttons.EDIT));
}
}
示例5: actionPerformed
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
Project project = e.getProject();
final FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
FavoritesTreeNodeDescriptor[] roots = dataContext.getData(FavoritesTreeViewPanel.CONTEXT_FAVORITES_ROOTS_DATA_KEY);
if (roots == null) return;
for (FavoritesTreeNodeDescriptor root : roots) {
FavoritesTreeNodeDescriptor listNode = root.getFavoritesRoot();
if (listNode != null && listNode !=root && listNode.getElement() instanceof FavoritesListNode) {
doSend(favoritesManager, new FavoritesTreeNodeDescriptor[]{root}, listNode.getElement().getName());
}
}
}
示例6: actionPerformed
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
Project project = e.getProject();
FavoritesViewTreeBuilder treeBuilder = e.getDataContext().getData(FavoritesTreeViewPanel.FAVORITES_TREE_BUILDER_KEY);
String listName = e.getDataContext().getData(FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY);
if (project == null || treeBuilder == null || listName == null) {
return;
}
FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
FavoritesListProvider provider = favoritesManager.getListProvider(listName);
Set<Object> selection = treeBuilder.getSelectedElements();
if (provider != null && provider.willHandle(CommonActionsPanel.Buttons.EDIT, project, selection)) {
provider.handle(CommonActionsPanel.Buttons.EDIT, project, selection, treeBuilder.getTree());
return;
}
favoritesManager.renameList(project, listName);
}
示例7: update
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e) {
e.getPresentation().setText(CommonActionsPanel.Buttons.EDIT.getText());
e.getPresentation().setIcon(CommonActionsPanel.Buttons.EDIT.getIcon());
e.getPresentation().setEnabled(true);
Project project = e.getProject();
FavoritesViewTreeBuilder treeBuilder = e.getDataContext().getData(FavoritesTreeViewPanel.FAVORITES_TREE_BUILDER_KEY);
String listName = e.getDataContext().getData(FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY);
if (project == null || treeBuilder == null || listName == null) {
e.getPresentation().setEnabled(false);
return;
}
FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
FavoritesListProvider provider = favoritesManager.getListProvider(listName);
Set<Object> selection = treeBuilder.getSelectedElements();
if (provider != null) {
e.getPresentation().setEnabled(provider.willHandle(CommonActionsPanel.Buttons.EDIT, project, selection));
e.getPresentation().setText(provider.getCustomName(CommonActionsPanel.Buttons.EDIT));
}
}
示例8: actionPerformed
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getProject();
if (project == null) {
return;
}
final FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
final ArrayList<PsiFile> filesToAdd = getFilesToAdd(project);
for (PsiFile file : filesToAdd) {
favoritesManager.addRoots(myFavoritesName, null, file);
}
}
示例9: actionPerformed
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
final Project project = e.getProject();
if (project == null) {
return;
}
final FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
String listName = FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY.getData(dataContext);
if (listName == null || favoritesManager.getListProvider(listName) != null) return;
favoritesManager.renameList(project, listName);
}
示例10: update
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
Project project = e.getProject();
if (project == null) {
e.getPresentation().setEnabled(false);
return;
}
final FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
String listName = FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY.getData(dataContext);
e.getPresentation().setEnabled(listName != null && favoritesManager.getListProvider(listName) == null);
}
示例11: actionPerformed
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
final Project project = e.getProject();
if (project == null) {
return;
}
final FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
String listName = dataContext.getData(FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY);
if (listName == null || favoritesManager.getListProvider(listName) != null) return;
favoritesManager.renameList(project, listName);
}
示例12: update
import com.intellij.ide.favoritesTreeView.FavoritesManager; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
Project project = e.getProject();
if (project == null) {
e.getPresentation().setEnabled(false);
return;
}
final FavoritesManager favoritesManager = FavoritesManager.getInstance(project);
String listName = dataContext.getData(FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY);
e.getPresentation().setEnabled(listName != null && favoritesManager.getListProvider(listName) == null);
}