• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AbstractProjectViewPane类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.ide.projectView.impl.AbstractProjectViewPane的典型用法代码示例。如果您正苦于以下问题:Java AbstractProjectViewPane类的具体用法?Java AbstractProjectViewPane怎么用?Java AbstractProjectViewPane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AbstractProjectViewPane类属于com.intellij.ide.projectView.impl包,在下文中一共展示了AbstractProjectViewPane类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: selectInTargetFile

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
private void selectInTargetFile(final VirtualFile targetFile) {
    UIUtil.invokeLaterIfNeeded(new Runnable() {
        public void run() {
            Project project = deviceResult.anActionEvent.getProject();
            Editor editor = deviceResult.anActionEvent.getData(PlatformDataKeys.EDITOR);
            MySelectInContext selectInContext = new MySelectInContext(targetFile, editor, project);
            ProjectViewImpl projectView = (ProjectViewImpl) ProjectView.getInstance(project);
            AbstractProjectViewPane currentProjectViewPane = projectView.getCurrentProjectViewPane();
            SelectInTarget target = currentProjectViewPane.createSelectInTarget();
            if (target != null && target.canSelect(selectInContext)) {
                target.selectIn(selectInContext, false);
            } else {
                selectInContext = new MySelectInContext(targetFile.getParent(), editor, project);
                if (target != null && target.canSelect(selectInContext)) {
                    target.selectIn(selectInContext, false);
                }
            }
        }
    });
}
 
开发者ID:zzz40500,项目名称:ADB-Duang,代码行数:21,代码来源:PullCommand.java


示例2: doubleClick

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
private void doubleClick(final Object object) {
  if (object instanceof Navigatable) {
    Navigatable navigatable = (Navigatable)object;
    if (navigatable.canNavigate()) {
      navigatable.navigate(true);
    }
  }
  else if (object instanceof Module) {
    ProjectView projectView = ProjectView.getInstance(myProject);
    AbstractProjectViewPane projectViewPane = projectView.getProjectViewPaneById(projectView.getCurrentViewId());
    if (projectViewPane != null) {
      projectViewPane.selectModule((Module)object, true);
    }
  }
  else if (object instanceof Project) {
    return;
  }
  hideHint(true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:NavBarPanel.java


示例3: update

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  super.update(e);
  e.getPresentation().setEnabled(false);
  final DataContext dataContext = e.getDataContext();
  final Project project = CommonDataKeys.PROJECT.getData(dataContext);
  if (project != null) {
    final AbstractProjectViewPane projectViewPane = ProjectView.getInstance(project).getCurrentProjectViewPane();
    if (projectViewPane != null) {
      final String scopeName = projectViewPane.getSubId();
      if (scopeName != null) {
        e.getPresentation().setEnabled(true);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:EditScopesAction.java


示例4: queueUpdate

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
private void queueUpdate(final VirtualFile fileToRefresh,
                         final Function<PsiFile, DefaultMutableTreeNode> rootToReloadGetter, final String scopeName) {
  if (myProject.isDisposed()) return;
  AbstractProjectViewPane pane = ProjectView.getInstance(myProject).getCurrentProjectViewPane();
  if (pane == null || !ScopeViewPane.ID.equals(pane.getId()) ||
      !scopeName.equals(pane.getSubId())) {
    return;
  }
  myUpdateQueue.queue(new Update(fileToRefresh) {
    @Override
    public void run() {
      if (myProject.isDisposed() || !fileToRefresh.isValid()) return;
      final PsiFile psiFile = PsiManager.getInstance(myProject).findFile(fileToRefresh);
      if (psiFile != null) {
        reload(rootToReloadGetter.fun(psiFile));
      }
    }

    @Override
    public boolean isExpired() {
      return !isTreeShowing();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ScopeTreeViewPanel.java


示例5: fireListeners

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
private void fireListeners(ChangeList list, @Nullable String oldName) {
  AbstractProjectViewPane pane = ProjectView.getInstance(myProject).getCurrentProjectViewPane();
  if (pane == null || !ScopeViewPane.ID.equals(pane.getId())) {
    return;
  }
  final String subId = pane.getSubId();
  if (!list.getName().equals(subId) && (oldName == null || !oldName.equals(subId))) {
    return;
  }
  ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
      myDependencyValidationManager.fireScopeListeners();
    }
  }, myProject.getDisposed());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ScopeTreeViewPanel.java


示例6: patchProjectAreaExtensions

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
private static void patchProjectAreaExtensions(@NotNull final Project project) {
  Executor debugExecutor = DefaultDebugExecutor.getDebugExecutorInstance();
  unregisterAction(debugExecutor.getId(), ExecutorRegistryImpl.RUNNERS_GROUP);
  unregisterAction(debugExecutor.getContextActionId(), ExecutorRegistryImpl.RUN_CONTEXT_GROUP);

  ExtensionsArea projectArea = Extensions.getArea(project);

  for (SelectInTarget target : Extensions.getExtensions(SelectInTarget.EP_NAME, project)) {
    if (ToolWindowId.FAVORITES_VIEW.equals(target.getToolWindowId()) ||
        ToolWindowId.STRUCTURE_VIEW.equals(target.getToolWindowId())) {
      projectArea.getExtensionPoint(SelectInTarget.EP_NAME).unregisterExtension(target);
    }
  }

  for (AbstractProjectViewPane pane : Extensions.getExtensions(AbstractProjectViewPane.EP_NAME, project)) {
    if (pane.getId().equals(ScopeViewPane.ID)) {
      Disposer.dispose(pane);
      projectArea.getExtensionPoint(AbstractProjectViewPane.EP_NAME).unregisterExtension(pane);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:PyCharmEduInitialConfigurator.java


示例7: invokeDialog

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
@NotNull
@Override
protected PsiElement[] invokeDialog(@NotNull Project project, @NotNull DataContext dataContext) {
  final IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext);
  if (view != null) {
    // If you're in the Android View, we want to ask you not just the filename but also let you
    // create other resource folder configurations
    AbstractProjectViewPane pane = ProjectView.getInstance(project).getCurrentProjectViewPane();
    if (pane instanceof AndroidProjectViewPane) {
      return CreateResourceFileAction.getInstance().invokeDialog(project, dataContext);
    }

    final PsiDirectory directory = view.getOrChooseDirectory();
    if (directory != null) {
      InputValidator validator = createValidator(project, directory);
      Messages.showInputDialog(project, AndroidBundle.message("new.file.dialog.text"),
                               AndroidBundle.message("new.typed.resource.dialog.title", myResourcePresentableName),
                               Messages.getQuestionIcon(), "", validator);
    }
  }
  return PsiElement.EMPTY_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:CreateTypedResourceFileAction.java


示例8: dissociate

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
public static void dissociate(final Collection<ResourceBundle> resourceBundles, final Project project) {
  final FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
  final Set<PsiFileSystemItem> toUpdateInProjectView = new HashSet<PsiFileSystemItem>();
  for (ResourceBundle resourceBundle : resourceBundles) {
    fileEditorManager.closeFile(new ResourceBundleAsVirtualFile(resourceBundle));
    for (final PropertiesFile propertiesFile : resourceBundle.getPropertiesFiles()) {
      fileEditorManager.closeFile(propertiesFile.getVirtualFile());
      PsiDirectory containingDirectory = propertiesFile.getContainingFile().getContainingDirectory();
      if (containingDirectory != null) {
        toUpdateInProjectView.add(containingDirectory);
      }
    }
    ResourceBundleManager.getInstance(project).dissociateResourceBundle(resourceBundle);
  }
  AbstractProjectViewPane currentProjectViewPane = ProjectView.getInstance(project).getCurrentProjectViewPane();
  if (currentProjectViewPane == null) {
    return;
  }
  AbstractTreeBuilder treeBuilder = currentProjectViewPane.getTreeBuilder();
  if (treeBuilder != null) {
    for (PsiFileSystemItem item : toUpdateInProjectView) {
      treeBuilder.queueUpdateFrom(item, false);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DissociateResourceBundleAction.java


示例9: doubleClick

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
private void doubleClick(final Object object) {
  if (object instanceof Navigatable) {
    final Navigatable navigatable = (Navigatable)object;
    if (navigatable.canNavigate()) {
      navigatable.navigate(true);
    }
  }
  else if (object instanceof Module) {
    final ProjectView projectView = ProjectView.getInstance(myProject);
    final AbstractProjectViewPane projectViewPane = projectView.getProjectViewPaneById(projectView.getCurrentViewId());
    projectViewPane.selectModule((Module)object, true);
  }
  else if (object instanceof Project) {
    return;
  }
  hideHint(true);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:NavBarPanel.java


示例10: update

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  super.update(e);
  e.getPresentation().setEnabled(false);
  final DataContext dataContext = e.getDataContext();
  final Project project = PlatformDataKeys.PROJECT.getData(dataContext);
  if (project != null) {
    final AbstractProjectViewPane projectViewPane = ProjectView.getInstance(project).getCurrentProjectViewPane();
    if (projectViewPane != null) {
      final String scopeName = projectViewPane.getSubId();
      if (scopeName != null) {
        e.getPresentation().setEnabled(true);
      }
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:EditScopesAction.java


示例11: update

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  super.update(e);
  e.getPresentation().setEnabled(false);
  final DataContext dataContext = e.getDataContext();
  final Project project = dataContext.getData(CommonDataKeys.PROJECT);
  if (project != null) {
    final AbstractProjectViewPane projectViewPane = ProjectView.getInstance(project).getCurrentProjectViewPane();
    if (projectViewPane != null) {
      final String scopeName = projectViewPane.getSubId();
      if (scopeName != null) {
        e.getPresentation().setEnabled(true);
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:EditScopesAction.java


示例12: doMove

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
public static void doMove(final Module[] modules, final ModuleGroup group, @Nullable final DataContext dataContext) {
  Project project = modules[0].getProject();
  for (final Module module : modules) {
    ModifiableModuleModel model = dataContext != null
                                  ? LangDataKeys.MODIFIABLE_MODULE_MODEL.getData(dataContext)
                                  : null;
    if (model != null){
      model.setModuleGroupPath(module, group == null ? null : group.getGroupPath());
    } else {
      ModuleManagerImpl.getInstanceImpl(project).setModuleGroupPath(module, group == null ? null : group.getGroupPath());
    }
  }

  AbstractProjectViewPane pane = ProjectView.getInstance(project).getCurrentProjectViewPane();
  if (pane != null) {
    pane.updateFromRoot(true);
  }

  if (!ProjectSettingsService.getInstance(project).processModulesMoved(modules, group) && pane != null) {
    if (group != null) {
      pane.selectModuleGroup(group, true);
    }
    else {
      pane.selectModule(modules[0], true);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:MoveModulesToGroupAction.java


示例13: extractModules

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
private static List<Module> extractModules(TreeNode[] sourceNodes) {
  final List<Module> modules = new ArrayList<Module>();
  for (TreeNode sourceNode : sourceNodes) {
    if (sourceNode instanceof DefaultMutableTreeNode) {
      final Object userObject = AbstractProjectViewPane.extractUserObject((DefaultMutableTreeNode)sourceNode);
      if (userObject instanceof Module) {
        modules.add((Module) userObject);
      }
    }
  }
  return modules;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ModuleGroupNode.java


示例14: getSubTargets

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
@Override
@NotNull
public Collection<SelectInTarget> getSubTargets(@NotNull SelectInContext context) {
  List<SelectInTarget> result = new ArrayList<SelectInTarget>();
  AbstractProjectViewPane pane = ProjectView.getInstance(myProject).getProjectViewPaneById(getMinorViewId());
  int index = 0;
  for (String subId : pane.getSubIds()) {
    result.add(new ProjectSubViewSelectInTarget(this, subId, index++));
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ProjectViewSelectInTarget.java


示例15: findResourceDirectory

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
@Nullable
public static PsiDirectory findResourceDirectory(@NotNull DataContext dataContext) {
  // Look at the set of selected files and see if one *specific* resource directory is implied (selected, or a parent
  // of all selected nodes); if so, use it; otherwise return null.
  //
  // In the Android Project View we don't want to do this, since there is only ever a single "res" node,
  // even when you have other overlays.
  // If you're in the Android View, we want to ask you not just the filename but also let you
  // create other resource folder configurations
  Project project = CommonDataKeys.PROJECT.getData(dataContext);
  if (project != null) {
    AbstractProjectViewPane pane = ProjectView.getInstance(project).getCurrentProjectViewPane();
    if (pane instanceof AndroidProjectViewPane) {
      return null;
    }
  }

  VirtualFile file = CommonDataKeys.VIRTUAL_FILE.getData(dataContext);
  if (file != null) {
    // See if it's inside a res folder (or is equal to a resource folder
    Module module = LangDataKeys.MODULE.getData(dataContext);
    if (module != null) {
      LocalResourceManager manager = LocalResourceManager.getInstance(module);
      if (manager != null) {
        VirtualFile resFolder = getResFolderParent(manager, file);
        if (resFolder != null) {
          return AndroidPsiUtils.getPsiDirectorySafely(module.getProject(), resFolder);
        }
      }
    }
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:CreateResourceActionBase.java


示例16: getModulesToBuildFromSelection

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
/**
 * Returns the modules to build based on the current selection in the 'Project' tool window. If the module that corresponds to the project
 * is selected, all the modules in such projects are returned. If there is no selection, an empty array is returned.
 *
 * @param project     the given project.
 * @param dataContext knows the modules that are selected. If {@code null}, this method gets the {@code DataContext} from the 'Project'
 *                    tool window directly.
 * @return the modules to build based on the current selection in the 'Project' tool window.
 */
@NotNull
public static Module[] getModulesToBuildFromSelection(@NotNull Project project, @Nullable DataContext dataContext) {
  if (dataContext == null) {
    ProjectView projectView = ProjectView.getInstance(project);
    AbstractProjectViewPane pane = projectView.getCurrentProjectViewPane();

    if (pane != null) {
      JComponent treeComponent = pane.getComponentToFocus();
      dataContext = DataManager.getInstance().getDataContext(treeComponent);
    }
    else {
      return Module.EMPTY_ARRAY;
    }
  }
  Module[] modules = MODULE_CONTEXT_ARRAY.getData(dataContext);
  if (modules != null) {
    if (modules.length == 1 && isProjectModule(modules[0])) {
      return ModuleManager.getInstance(project).getModules();
    }
    return modules;
  }

  Module module = MODULE.getData(dataContext);
  if (module != null) {
    return isProjectModule(module) ? ModuleManager.getInstance(project).getModules() : new Module[]{module};
  }

  return Module.EMPTY_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:Projects.java


示例17: saveContext

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
public void saveContext(Element toElement) throws WriteExternalException {
  for (AbstractProjectViewPane pane : myPanes) {
    Element paneElement = new Element(pane.getId());
    pane.writeExternal(paneElement);
    toElement.addContent(paneElement);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ProjectViewContextProvider.java


示例18: loadContext

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
public void loadContext(Element fromElement) throws InvalidDataException {
  for (AbstractProjectViewPane pane : myPanes) {
    Element paneElement = fromElement.getChild(pane.getId());
    if (paneElement != null) {
      pane.readExternal(paneElement);
      if (pane.getTree() != null) {
        pane.restoreExpandedPaths();
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ProjectViewContextProvider.java


示例19: clearContext

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
public void clearContext() {
  for (AbstractProjectViewPane pane : myPanes) {
    JTree tree = pane.getTree();
    if (tree != null) {
      TreeUtil.collapseAll(tree, -1);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ProjectViewContextProvider.java


示例20: getSelectedProjectFile

import com.intellij.ide.projectView.impl.AbstractProjectViewPane; //导入依赖的package包/类
/**
 * determine the VirtualFile which selected in Project view
 * @param project
 * @return
 */
public static VirtualFile getSelectedProjectFile(@NotNull Project project) {

    AbstractProjectViewPane currentProjectViewPane = ProjectView.getInstance(project).getCurrentProjectViewPane();
    if (currentProjectViewPane == null) {
        return null;
    }
    DefaultMutableTreeNode node = currentProjectViewPane.getSelectedNode();
    if (node == null) {
        return null;
    }
    Object selected = null;
    Object userObject = node.getUserObject();
    if (userObject instanceof AbstractTreeNode) {
        selected =  ((AbstractTreeNode)userObject).getValue();
    }
    else  if (userObject instanceof NodeDescriptor) {
        selected =  ((NodeDescriptor)userObject).getElement();
    }

    if (selected == null) {
        return null;
    }

    VirtualFile vf = null;
    if (selected instanceof PsiDirectory) {
        vf = ((PsiDirectory)selected).getVirtualFile();
    }
    else if (selected instanceof PsiElement) {
        vf = ((PsiElement) selected).getContainingFile().getVirtualFile().getParent();
    }
    else {
        // ignored
    }

    return vf;
}
 
开发者ID:MrHunterZhao,项目名称:OpenTerminalHere,代码行数:42,代码来源:FileUtil.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CommunicationException类代码示例发布时间:2022-05-22
下一篇:
Java NameNodeFile类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap