当前位置: 首页>>代码示例>>Java>>正文


Java FavoritesManager.getInstance方法代码示例

本文整理汇总了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());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SendToFavoritesAction.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:EditFavoritesAction.java

示例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));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:EditFavoritesAction.java

示例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));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:EditFavoritesAction.java

示例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());
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:SendToFavoritesAction.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:EditFavoritesAction.java

示例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));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:EditFavoritesAction.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AddAllOpenFilesToFavorites.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:RenameFavoritesListAction.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:RenameFavoritesListAction.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:RenameFavoritesListAction.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:RenameFavoritesListAction.java


注:本文中的com.intellij.ide.favoritesTreeView.FavoritesManager.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。