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

Java SelectInTarget类代码示例

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

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



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

示例1: selectInTargetFile

import com.intellij.ide.SelectInTarget; //导入依赖的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: patchProjectAreaExtensions

import com.intellij.ide.SelectInTarget; //导入依赖的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


示例3: createSelectInTarget

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
public SelectInTarget createSelectInTarget() {
  return new ProjectViewSelectInTarget(myProject) {

    @Override
    public String toString() {
      return "images";
    }

    @Nullable
    @Override
    public String getMinorViewId() {
      return "images";
    }

    @Override
    public float getWeight() {
      return 10;
    }
  };
}
 
开发者ID:JetBrains,项目名称:intellij-sdk-docs,代码行数:22,代码来源:ImagesProjectViewPane.java


示例4: selectElementFromEditor

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
protected void selectElementFromEditor(@Nonnull FileEditor editor) {
  final VirtualFile file = FileEditorManagerEx.getInstanceEx(myProject).getFile(editor);
  if (file != null) {
    final PsiFile psiFile = PsiManager.getInstance(myProject).findFile(file);
    if (psiFile != null) {
      final SelectInTarget target = mySelectInTarget;
      if (target != null) {
        final SelectInContext selectInContext = SelectInContextImpl.createEditorContext(myProject, editor);

        if (target.canSelect(selectInContext)) {
          target.selectIn(selectInContext, false);
        }
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:FavoritesAutoscrollFromSourceHandler.java


示例5: createSelectInTarget

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
public SelectInTarget createSelectInTarget() {
  return new ProjectViewSelectInTarget(myProject) {

    @Override
    protected boolean canSelect(PsiFileSystemItem file) {
      if (!super.canSelect(file)) return false;
      final VirtualFile vFile = file.getVirtualFile();
      if (vFile == null || !vFile.isValid()) return false;
      return ScratchFileService.getInstance().getRootType(vFile) != null;
    }

    @Override
    protected boolean canWorkWithCustomObjects() {
      return false;
    }

    @Override
    public String toString() {
      return getTitle();
    }

    @Override
    public String getMinorViewId() {
      return getId();
    }

    @Override
    public float getWeight() {
      return ScratchProjectViewPane.this.getWeight();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:ScratchProjectViewPane.java


示例6: canSelect

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
public boolean canSelect(SelectInContext context) {
  ProjectView projectView = ProjectView.getInstance(context.getProject());
  Collection<SelectInTarget> targets = projectView.getSelectInTargets();
  for (SelectInTarget projectViewTarget : targets) {
    if (projectViewTarget.canSelect(context)) return true;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ProjectViewSelectInGroupTarget.java


示例7: selectIn

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
public void selectIn(final SelectInContext context, final boolean requestFocus) {
  ProjectView projectView = ProjectView.getInstance(context.getProject());
  Collection<SelectInTarget> targets = projectView.getSelectInTargets();
  Collection<SelectInTarget> targetsToCheck = new LinkedHashSet<SelectInTarget>();
  String currentId = projectView.getCurrentViewId();
  for (SelectInTarget projectViewTarget : targets) {
    if (Comparing.equal(currentId, projectViewTarget.getMinorViewId())) {
      targetsToCheck.add(projectViewTarget);
      break;
    }
  }
  targetsToCheck.addAll(targets);
  for (final SelectInTarget target : targetsToCheck) {
    if (target.canSelect(context)) {
      if (requestFocus) {
        IdeFocusManager.getInstance(context.getProject()).requestFocus(new FocusCommand() {
          @NotNull
          @Override
          public ActionCallback run() {
            target.selectIn(context, requestFocus);
            return ActionCallback.DONE;
          }
        }, true);
      }
      else {
        target.selectIn(context, requestFocus);
      }
      break;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:ProjectViewSelectInGroupTarget.java


示例8: getSubTargets

import com.intellij.ide.SelectInTarget; //导入依赖的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


示例9: queueFocusOnImportDirectory

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
private void queueFocusOnImportDirectory() {
  directoryFocusHandle = PantsUtil.scheduledThreadPool.scheduleWithFixedDelay(new Runnable() {
    @Override
    public void run() {
      if (ModuleManager.getInstance(myProject).getModules().length == 0 ||
          !ProjectView.getInstance(myProject).getCurrentViewId().equals(ProjectFilesViewPane.ID)) {
        return;
      }
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
          final VirtualFile pathImported = LocalFileSystem.getInstance().findFileByPath(myProjectPath);
          // Skip focusing if directory is not found.
          if (pathImported != null) {
            VirtualFile importDirectory = pathImported.isDirectory() ? pathImported : pathImported.getParent();
            SelectInContext selectInContext = new FileSelectInContext(myProject, importDirectory);
            for (SelectInTarget selectInTarget : ProjectView.getInstance(myProject).getSelectInTargets()) {
              if (selectInTarget instanceof PantsProjectPaneSelectInTarget) {
                selectInTarget.selectIn(selectInContext, false);
                break;
              }
            }
          }
          final boolean mayInterruptIfRunning = true;
          directoryFocusHandle.cancel(mayInterruptIfRunning);
        }
      });
    }
  }, 0, 1, TimeUnit.SECONDS);
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:31,代码来源:PantsSystemProjectResolver.java


示例10: selectIn

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
public void selectIn(final SelectInContext context, final boolean requestFocus) {
  ProjectView projectView = ProjectView.getInstance(context.getProject());
  Collection<SelectInTarget> targets = projectView.getSelectInTargets();
  Collection<SelectInTarget> targetsToCheck = new LinkedHashSet<SelectInTarget>();
  String currentId = projectView.getCurrentViewId();
  for (SelectInTarget projectViewTarget : targets) {
    if (Comparing.equal(currentId, projectViewTarget.getMinorViewId())) {
      targetsToCheck.add(projectViewTarget);
      break;
    }
  }
  targetsToCheck.addAll(targets);
  for (final SelectInTarget target : targetsToCheck) {
    if (target.canSelect(context)) {
      if (requestFocus) {
        IdeFocusManager.getInstance(context.getProject()).requestFocus(new FocusCommand() {
          @NotNull
          @Override
          public ActionCallback run() {
            target.selectIn(context, requestFocus);
            return new ActionCallback.Done();
          }
        }, true);
      }
      else {
        target.selectIn(context, requestFocus);
      }
      break;
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:33,代码来源:ProjectViewSelectInGroupTarget.java


示例11: getSubTargets

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
@NotNull
public Collection<SelectInTarget> getSubTargets(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:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:ProjectViewSelectInTarget.java


示例12: navigateInProjectView

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
private void navigateInProjectView(boolean requestFocus) {
  SelectInContext context = new SelectInContext() {
    @Override
    @Nonnull
    public Project getProject() {
      return myProject;
    }

    @Override
    @Nonnull
    public VirtualFile getVirtualFile() {
      return myFile;
    }

    @Override
    @Nullable
    public Object getSelectorInFile() {
      return null;
    }
  };

  for (SelectInTarget target : SelectInManager.getInstance(myProject).getTargets()) {
    if (target.canSelect(context)) {
      target.selectIn(context, requestFocus);
      return;
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:29,代码来源:OpenFileDescriptor.java


示例13: selectIn

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
public void selectIn(final SelectInContext context, final boolean requestFocus) {
  ProjectView projectView = ProjectView.getInstance(context.getProject());
  Collection<SelectInTarget> targets = projectView.getSelectInTargets();
  Collection<SelectInTarget> targetsToCheck = new LinkedHashSet<SelectInTarget>();
  String currentId = projectView.getCurrentViewId();
  for (SelectInTarget projectViewTarget : targets) {
    if (Comparing.equal(currentId, projectViewTarget.getMinorViewId())) {
      targetsToCheck.add(projectViewTarget);
      break;
    }
  }
  targetsToCheck.addAll(targets);
  targetsToCheck.stream().filter(t -> t.canSelect(context)).findFirst().ifPresent(target -> target.selectIn(context, requestFocus));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:ProjectViewSelectInGroupTarget.java


示例14: getSubTargets

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
@Nonnull
public Collection<SelectInTarget> getSubTargets(@Nonnull SelectInContext context) {
  List<SelectInTarget> result = new ArrayList<>();
  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:consulo,项目名称:consulo,代码行数:12,代码来源:ProjectViewSelectInTarget.java


示例15: createSelectInTarget

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
public SelectInTarget createSelectInTarget() {
  return new PackagesPaneSelectInTarget(myProject);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:PackageViewPane.java


示例16: createSelectInTarget

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
public SelectInTarget createSelectInTarget() {
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:TestProjectViewPSIPane.java


示例17: createSelectInTarget

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
public SelectInTarget createSelectInTarget() {
  return new FavoritesViewSelectInTarget(myProject);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FavoritesProjectViewPane.java


示例18: createSelectInTarget

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
public SelectInTarget createSelectInTarget() {
  return new ProjectPaneSelectInTarget(myProject);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ProjectViewPane.java


示例19: getSelectInTargets

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@NotNull
public abstract Collection<SelectInTarget> getSelectInTargets();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:ProjectView.java


示例20: getSubTargets

import com.intellij.ide.SelectInTarget; //导入依赖的package包/类
@Override
@NotNull
public Collection<SelectInTarget> getSubTargets(@NotNull SelectInContext context) {
  return ProjectView.getInstance(context.getProject()).getSelectInTargets();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ProjectViewSelectInGroupTarget.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Record类代码示例发布时间:2022-05-22
下一篇:
Java ImageDeformation类代码示例发布时间: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