use of com.intellij.ide.SelectInTarget in project intellij-community by JetBrains.
the class ProjectViewSelectInGroupTarget method canSelect.
@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;
}
use of com.intellij.ide.SelectInTarget in project intellij-community by JetBrains.
the class ProjectViewSelectInGroupTarget method selectIn.
@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<>();
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;
}
}
}
use of com.intellij.ide.SelectInTarget in project intellij-community by JetBrains.
the class ProjectViewSelectInTarget method getSubTargets.
@Override
@NotNull
public Collection<SelectInTarget> getSubTargets(@NotNull 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;
}
use of com.intellij.ide.SelectInTarget in project intellij-community by JetBrains.
the class PyCharmEduInitialConfigurator method patchProjectAreaExtensions.
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);
}
}
}
Aggregations