本文整理汇总了Java中com.intellij.ide.projectView.impl.ProjectViewPane类的典型用法代码示例。如果您正苦于以下问题:Java ProjectViewPane类的具体用法?Java ProjectViewPane怎么用?Java ProjectViewPane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectViewPane类属于com.intellij.ide.projectView.impl包,在下文中一共展示了ProjectViewPane类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testSelectProject
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
public void testSelectProject() {
ProjectView projectView = ProjectView.getInstance(getProject());
projectView.changeView(ProjectViewPane.ID);
assertEquals(ProjectViewPane.ID, projectView.getCurrentViewId());
//FavoritesManager favoritesManager = FavoritesManager.getInstance(getProject());
//favoritesManager.createNewList("xxxx");
//
//AbstractProjectViewPane currentPane = projectView.getCurrentProjectViewPane();
//assertEquals(FavoritesProjectViewPane.ID, currentPane.getId());
//assertEquals("xxxx", currentPane.getSubId());
//
//favoritesManager.createNewList("yyyy");
//currentPane = projectView.getCurrentProjectViewPane();
//assertEquals(FavoritesProjectViewPane.ID, currentPane.getId());
//assertEquals("yyyy", currentPane.getSubId());
//
//favoritesManager.removeFavoritesList("xxxx");
//currentPane = projectView.getCurrentProjectViewPane();
//assertEquals(FavoritesProjectViewPane.ID, currentPane.getId());
//assertEquals("yyyy", currentPane.getSubId());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ProjectViewSwitchingTest.java
示例2: selectElement
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
@Override
public void selectElement(final PsiElement element) {
if (element != null) {
final PackageSet packageSet = getCurrentScope().getValue();
final PsiFile psiFile = element.getContainingFile();
if (packageSet == null) return;
final VirtualFile virtualFile = psiFile != null ? psiFile.getVirtualFile() :
(element instanceof PsiDirectory ? ((PsiDirectory)element).getVirtualFile() : null);
if (virtualFile != null) {
final ProjectView projectView = ProjectView.getInstance(myProject);
final NamedScopesHolder holder = NamedScopesHolder.getHolder(myProject, CURRENT_SCOPE_NAME, myDependencyValidationManager);
if (packageSet instanceof PackageSetBase && !((PackageSetBase)packageSet).contains(virtualFile, myProject, holder) ||
psiFile != null && !packageSet.contains(psiFile, holder)) {
projectView.changeView(ProjectViewPane.ID);
}
projectView.select(element, virtualFile, false);
}
Editor editor = EditorHelper.openInEditor(element);
if (editor != null) {
ToolWindowManager.getInstance(myProject).activateEditorComponent();
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ScopeTreeViewPanel.java
示例3: selectElement
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
@Override
public void selectElement(final PsiElement element) {
if (element != null) {
final PackageSet packageSet = getCurrentScope().getValue();
final PsiFile psiFile = element.getContainingFile();
if (packageSet == null) return;
final VirtualFile virtualFile = psiFile != null ? psiFile.getVirtualFile() :
(element instanceof PsiDirectory ? ((PsiDirectory)element).getVirtualFile() : null);
if (virtualFile != null) {
final ProjectView projectView = ProjectView.getInstance(myProject);
final NamedScopesHolder holder = NamedScopesHolder.getHolder(myProject, CURRENT_SCOPE_NAME, myDependencyValidationManager);
if (packageSet instanceof PackageSetBase && !((PackageSetBase)packageSet).contains(virtualFile, holder) ||
psiFile != null && !packageSet.contains(psiFile, holder)) {
projectView.changeView(ProjectViewPane.ID);
}
projectView.select(element, virtualFile, false);
}
Editor editor = EditorHelper.openInEditor(element);
if (editor != null) {
ToolWindowManager.getInstance(myProject).activateEditorComponent();
}
}
}
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:ScopeTreeViewPanel.java
示例4: JSGraphQLLanguageUIProjectService
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
public JSGraphQLLanguageUIProjectService(@NotNull final Project project) {
myProject = project;
final MessageBusConnection messageBusConnection = project.getMessageBus().connect(this);
// the restart action
final AnAction restartInstanceAction = ActionManager.getInstance().getAction(JSGraphQLRestartLanguageServiceAction.class.getName());
// tool window
myToolWindowManager = new JSGraphQLLanguageToolWindowManager(project, GRAPH_QL_TOOL_WINDOW_NAME, GRAPH_QL_TOOL_WINDOW_NAME, JSGraphQLIcons.UI.GraphQLNode, restartInstanceAction);
Disposer.register(this, this.myToolWindowManager);
// listen for editor file tab changes to update the list of current errors
messageBusConnection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, this);
// add editor headers to already open files since we've only just added the listener for fileOpened()
final FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
for (VirtualFile virtualFile : fileEditorManager.getOpenFiles()) {
insertEditorHeaderComponentIfApplicable(fileEditorManager, virtualFile);
}
// listen for configuration changes
messageBusConnection.subscribe(JSGraphQLConfigurationListener.TOPIC, this);
// finally init the tool window tabs
initToolWindow();
// and notify to configure the schema
project.putUserData(JSGraphQLParserDefinition.JSGRAPHQL_ACTIVATED, true);
EditorNotifications.getInstance(project).updateAllNotifications();
// make sure the GraphQL schema is shown in the project tree if not already
if(!JSGraphQLSchemaDirectoryNode.isShownForProject(project)) {
final ProjectView projectView = ProjectView.getInstance(project);
if (projectView != null && projectView.getCurrentProjectViewPane() instanceof ProjectViewPane) {
projectView.refresh();
}
}
}
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:41,代码来源:JSGraphQLLanguageUIProjectService.java
示例5: addToolbarActions
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
@Override
@RequiredDispatchThread
public void addToolbarActions(@NotNull AbstractProjectViewPane pane, @NotNull DefaultActionGroup actionGroup)
{
if(pane instanceof ProjectViewPane)
{
actionGroup.addAction(new ShowMetaFilesAction(pane)).setAsSecondary(true);
}
}
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:10,代码来源:Unity3dShowMetaFileProjectViewPaneOptionProvider.java
示例6: select
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
public static ActionCallback select(@NotNull Project project,
final Object toSelect,
@Nullable final String viewId,
@Nullable final String subviewId,
final VirtualFile virtualFile,
final boolean requestFocus) {
final ActionCallback result = new ActionCallback();
final ProjectView projectView = ProjectView.getInstance(project);
if (ApplicationManager.getApplication().isUnitTestMode()) {
AbstractProjectViewPane pane = projectView.getProjectViewPaneById(ProjectViewPane.ID);
pane.select(toSelect, virtualFile, requestFocus);
return result;
}
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
final ToolWindow projectViewToolWindow = windowManager.getToolWindow(ToolWindowId.PROJECT_VIEW);
final Runnable runnable = new Runnable() {
@Override
public void run() {
if (requestFocus) {
projectView.changeView(viewId, subviewId);
}
projectView.selectCB(toSelect, virtualFile, requestFocus).notify(result);
}
};
if (requestFocus) {
projectViewToolWindow.activate(runnable, false);
} else {
projectViewToolWindow.show(runnable);
}
return result;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:38,代码来源:ProjectViewSelectInTarget.java
示例7: select
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
@Nonnull
public static ActionCallback select(@Nonnull Project project,
final Object toSelect,
@Nullable final String viewId,
@Nullable final String subviewId,
final VirtualFile virtualFile,
final boolean requestFocus) {
final ActionCallback result = new ActionCallback();
final ProjectView projectView = ProjectView.getInstance(project);
if (ApplicationManager.getApplication().isUnitTestMode()) {
AbstractProjectViewPane pane = projectView.getProjectViewPaneById(ProjectViewPane.ID);
pane.select(toSelect, virtualFile, requestFocus);
return result;
}
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
final ToolWindow projectViewToolWindow = windowManager.getToolWindow(ToolWindowId.PROJECT_VIEW);
final Runnable runnable = () -> {
Runnable r = () -> projectView.selectCB(toSelect, virtualFile, requestFocus).notify(result);
projectView.changeViewCB(ObjectUtils.chooseNotNull(viewId, ProjectViewPane.ID), subviewId).doWhenProcessed(r);
};
if (requestFocus) {
projectViewToolWindow.activate(runnable, true);
}
else {
projectViewToolWindow.show(runnable);
}
return result;
}
开发者ID:consulo,项目名称:consulo,代码行数:33,代码来源:ProjectViewSelectInTarget.java
示例8: testAutoscrollFromSourceOnOpening
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
public void testAutoscrollFromSourceOnOpening() throws Exception {
final PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(getPackageDirectory());
PsiClass psiClass = classes[0];
FileEditorManager.getInstance(getProject()).openFile(psiClass.getContainingFile().getVirtualFile(), true);
ProjectView projectView = ProjectView.getInstance(getProject());
((ProjectViewImpl)projectView).setAutoscrollFromSource(true, ProjectViewPane.ID);
ToolWindow toolWindow = ToolWindowManager.getInstance(getProject()).getToolWindow(ToolWindowId.PROJECT_VIEW);
new ProjectViewToolWindowFactory().createToolWindowContent(getProject(), toolWindow);
projectView.changeView(ProjectViewPane.ID);
JComponent component = ((ProjectViewImpl)projectView).getComponent();
DataContext context = DataManager.getInstance().getDataContext(component);
PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(context);
assertEquals("Class1.java", ((PsiJavaFile)element).getName());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:NavigateFromSourceTest.java
示例9: navigateToDirectory
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
@Override
public void navigateToDirectory(PsiDirectory psiDirectory, boolean requestFocus) {
ProjectViewSelectInTarget.select(psiDirectory.getProject(), this, ProjectViewPane.ID, null, psiDirectory.getVirtualFile(), requestFocus);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:PsiNavigationSupportImpl.java
示例10: getMinorViewId
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
@Override
public String getMinorViewId() {
return ProjectViewPane.ID;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ProjectPaneSelectInTarget.java
示例11: select
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
@NotNull
public static ActionCallback select(@NotNull Project project,
final Object toSelect,
@Nullable final String viewId,
@Nullable final String subviewId,
final VirtualFile virtualFile,
final boolean requestFocus) {
final ActionCallback result = new ActionCallback();
final ProjectView projectView = ProjectView.getInstance(project);
if (ApplicationManager.getApplication().isUnitTestMode()) {
AbstractProjectViewPane pane = projectView.getProjectViewPaneById(ProjectViewPane.ID);
pane.select(toSelect, virtualFile, requestFocus);
return result;
}
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
final ToolWindow projectViewToolWindow = windowManager.getToolWindow(ToolWindowId.PROJECT_VIEW);
final Runnable runnable = new Runnable() {
@Override
public void run() {
Runnable r = new Runnable() {
@Override
public void run() {
projectView.selectCB(toSelect, virtualFile, requestFocus).notify(result);
}
};
if (requestFocus) {
projectView.changeViewCB(ObjectUtils.chooseNotNull(viewId, ProjectViewPane.ID), subviewId).doWhenProcessed(r);
}
else {
r.run();
}
}
};
if (requestFocus) {
projectViewToolWindow.activate(runnable, false);
}
else {
projectViewToolWindow.show(runnable);
}
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:47,代码来源:ProjectViewSelectInTarget.java
示例12: configure
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
@Override
public void configure(@NotNull MavenProject mavenProject, @NotNull Project project, @Nullable Module module) {
if (module == null) return;
Element cfg = mavenProject.getPluginConfiguration("com.googlecode", "maven-idea-plugin");
if (cfg == null) return;
configureJdk(cfg, module);
MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(project);
String downloadSources = cfg.getChildTextTrim("downloadSources");
if (!StringUtil.isEmptyOrSpaces(downloadSources)) {
projectsManager.getImportingSettings().setDownloadSourcesAutomatically(Boolean.parseBoolean(downloadSources));
}
String downloadJavadocs = cfg.getChildTextTrim("downloadJavadocs");
if (!StringUtil.isEmptyOrSpaces(downloadJavadocs)) {
projectsManager.getImportingSettings().setDownloadDocsAutomatically(Boolean.parseBoolean(downloadJavadocs));
}
String assertNotNull = cfg.getChildTextTrim("assertNotNull");
if (!StringUtil.isEmptyOrSpaces(assertNotNull)) {
CompilerConfiguration.getInstance(project).setAddNotNullAssertions(Boolean.parseBoolean(assertNotNull));
}
String autoscrollToSource = cfg.getChildTextTrim("autoscrollToSource");
if (!StringUtil.isEmptyOrSpaces(autoscrollToSource)) {
((ProjectViewImpl)ProjectView.getInstance(project)).setAutoscrollToSource(Boolean.parseBoolean(autoscrollToSource), ProjectViewPane.ID);
}
String autoscrollFromSource = cfg.getChildTextTrim("autoscrollFromSource");
if (!StringUtil.isEmptyOrSpaces(autoscrollFromSource)) {
((ProjectViewImpl)ProjectView.getInstance(project)).setAutoscrollFromSource(Boolean.parseBoolean(autoscrollFromSource), ProjectViewPane.ID);
}
String hideEmptyPackages = cfg.getChildTextTrim("hideEmptyPackages");
if (!StringUtil.isEmptyOrSpaces(hideEmptyPackages)) {
ProjectView.getInstance(project).setHideEmptyPackages(Boolean.parseBoolean(hideEmptyPackages), ProjectViewPane.ID);
}
String optimizeImportsBeforeCommit = cfg.getChildTextTrim("optimizeImportsBeforeCommit");
if (!StringUtil.isEmptyOrSpaces(optimizeImportsBeforeCommit)) {
VcsConfiguration.getInstance(module.getProject()).OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT = Boolean.parseBoolean(optimizeImportsBeforeCommit);
}
String performCodeAnalisisBeforeCommit = cfg.getChildTextTrim("performCodeAnalisisBeforeCommit");
if (!StringUtil.isEmptyOrSpaces(performCodeAnalisisBeforeCommit)) {
VcsConfiguration.getInstance(module.getProject()).CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT = Boolean.parseBoolean(performCodeAnalisisBeforeCommit);
}
String reformatCodeBeforeCommit = cfg.getChildTextTrim("reformatCodeBeforeCommit");
if (!StringUtil.isEmptyOrSpaces(reformatCodeBeforeCommit)) {
VcsConfiguration vcsConfiguration = VcsConfiguration.getInstance(module.getProject());
boolean value = Boolean.parseBoolean(reformatCodeBeforeCommit);
vcsConfiguration.REFORMAT_BEFORE_FILE_COMMIT = value;
vcsConfiguration.REFORMAT_BEFORE_PROJECT_COMMIT = value;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:60,代码来源:MavenIdeaPluginConfigurer.java
示例13: reloadSchemaFileElements
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
@SuppressWarnings("CodeBlock2Expr")
private void reloadSchemaFileElements(JSGraphQLSchemaFileElements schemaFileElements) {
final SchemaWithVersionResponse schemaWithVersion = JSGraphQLNodeLanguageServiceClient.getSchemaWithVersion(project);
if(schemaWithVersion != null) {
// update the psi schema file
UIUtil.invokeLaterIfNeeded(() -> {
ApplicationManager.getApplication().runWriteAction(() -> {
if(project.isDisposed()) {
return;
}
final Document document = PsiDocumentManager.getInstance(project).getDocument(schemaFileElements.getFile());
if(document != null) {
// only change the PSI by re-parsing when the schema url or text is different
if(isNewSchemaUrl(schemaFileElements, schemaWithVersion) || !Objects.equals(document.getText(), schemaWithVersion.getSchema())) {
// reload the schema via a listener once the schema file psi has been updated
schemaFileElements.onPendingReloadSchema(schemaWithVersion);
if (!Boolean.TRUE.equals(project.getUserData(IS_GRAPHQL_SCHEMA_FILE_LISTENER_ADDED))) {
PsiManager.getInstance(project).addPsiTreeChangeListener(new PsiTreeChangeAdapter() {
@Override
public void childrenChanged(@NotNull PsiTreeChangeEvent event) {
if (event.getParent() == schemaFileElements.getFile()) {
schemaFileElements.reloadSchema();
schemaFileElements.getFile().setName(getSchemaFileName());
project.getMessageBus().syncPublisher(JSGraphQLSchemaLanguageServiceListener.TOPIC).onSchemaReloaded();
final ProjectView projectView = ProjectView.getInstance(project);
if (projectView != null && projectView.getCurrentProjectViewPane() instanceof ProjectViewPane) {
projectView.refresh();
}
}
}
}, project);
project.putUserData(IS_GRAPHQL_SCHEMA_FILE_LISTENER_ADDED, true);
}
// finally, update the document to cause the re-parse and schema file psi update
document.setText(schemaWithVersion.getSchema());
}
}
});
});
}
}
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:47,代码来源:JSGraphQLSchemaLanguageProjectService.java
示例14: testAutoscrollFromSourceOnOpening
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
public void testAutoscrollFromSourceOnOpening() throws Exception {
final PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(getPackageDirectory());
PsiClass psiClass = classes[0];
FileEditorManager.getInstance(getProject()).openFile(psiClass.getContainingFile().getVirtualFile(), true);
ProjectView projectView = ProjectView.getInstance(getProject());
((ProjectViewImpl)projectView).setAutoscrollFromSource(true, ProjectViewPane.ID);
ToolWindow toolWindow = ToolWindowManager.getInstance(getProject()).getToolWindow(ToolWindowId.PROJECT_VIEW);
new ProjectViewToolWindowFactory().createToolWindowContent(getProject(), toolWindow);
projectView.changeView(ProjectViewPane.ID);
JComponent component = ((ProjectViewImpl)projectView).getComponent();
DataContext context = DataManager.getInstance().getDataContext(component);
PsiElement element = LangDataKeys.PSI_ELEMENT.getData(context);
assertEquals("Class1.java", ((PsiJavaFile)element).getName());
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:NavigateFromSourceTest.java
示例15: addToolbarActions
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
@Override
public void addToolbarActions(@Nonnull AbstractProjectViewPane pane, @Nonnull DefaultActionGroup actionGroup) {
if (pane instanceof ProjectViewPane) {
actionGroup.addAction(new ShowExcludedFilesAction(pane)).setAsSecondary(true);
}
}
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:ShowExcludedFilesProjectViewPaneOptionProvider.java
示例16: getMinorViewId
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
public String getMinorViewId() {
return ProjectViewPane.ID;
}
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:ProjectPaneSelectInTarget.java
示例17: testAutoscrollFromSourceOnOpening
import com.intellij.ide.projectView.impl.ProjectViewPane; //导入依赖的package包/类
public void testAutoscrollFromSourceOnOpening() throws Exception
{
final PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(getPackageDirectory());
PsiClass psiClass = classes[0];
FileEditorManager.getInstance(getProject()).openFile(psiClass.getContainingFile().getVirtualFile(), true);
ProjectView projectView = ProjectView.getInstance(getProject());
((ProjectViewImpl) projectView).setAutoscrollFromSource(true, ProjectViewPane.ID);
ToolWindow toolWindow = ToolWindowManager.getInstance(getProject()).getToolWindow(ToolWindowId.PROJECT_VIEW);
new ProjectViewToolWindowFactory().createToolWindowContent(getProject(), toolWindow);
projectView.changeView(ProjectViewPane.ID);
JComponent component = ((ProjectViewImpl) projectView).getComponent();
DataContext context = DataManager.getInstance().getDataContext(component);
PsiElement element = context.getData(LangDataKeys.PSI_ELEMENT);
assertEquals("Class1.java", ((PsiJavaFile) element).getName());
}
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:NavigateFromSourceTest.java
注:本文中的com.intellij.ide.projectView.impl.ProjectViewPane类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论