本文整理汇总了Java中com.intellij.ide.projectView.impl.AbstractProjectViewPane类的典型用法代码示例。如果您正苦于以下问题:Java AbstractProjectViewPane类的具体用法?Java AbstractProjectViewPane怎么用?Java AbstractProjectViewPane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractProjectViewPane类属于com.intellij.ide.projectView.impl包,在下文中一共展示了AbstractProjectViewPane类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
});
}
示例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);
}
示例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);
}
}
}
}
示例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();
}
});
}
示例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());
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
}
示例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);
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}