Search in sources :

Example 61 with ProjectViewSet

use of com.google.idea.blaze.base.projectview.ProjectViewSet in project intellij by bazelbuild.

the class OpenAllProjectViewsAction method actionPerformedInBlazeProject.

@Override
protected void actionPerformedInBlazeProject(Project project, AnActionEvent e) {
    ProjectViewSet projectViewSet = ProjectViewManager.getInstance(project).getProjectViewSet();
    if (projectViewSet == null) {
        return;
    }
    projectViewSet.getProjectViewFiles().forEach(f -> ProjectViewHelper.openProjectViewFile(project, f));
}
Also used : ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet)

Example 62 with ProjectViewSet

use of com.google.idea.blaze.base.projectview.ProjectViewSet in project intellij by bazelbuild.

the class OpenAllProjectViewsAction method updateForBlazeProject.

@Override
protected void updateForBlazeProject(Project project, AnActionEvent e) {
    ProjectViewSet projectViewSet = ProjectViewManager.getInstance(project).getProjectViewSet();
    ActionPresentationHelper.of(e).disableIf(projectViewSet == null).commit();
}
Also used : ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet)

Example 63 with ProjectViewSet

use of com.google.idea.blaze.base.projectview.ProjectViewSet in project intellij by bazelbuild.

the class OpenLocalProjectViewAction method updateForBlazeProject.

@Override
protected void updateForBlazeProject(Project project, AnActionEvent e) {
    ProjectViewSet projectViewSet = ProjectViewManager.getInstance(project).getProjectViewSet();
    ActionPresentationHelper.of(e).disableIf(projectViewSet == null).commit();
}
Also used : ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet)

Example 64 with ProjectViewSet

use of com.google.idea.blaze.base.projectview.ProjectViewSet in project intellij by bazelbuild.

the class OpenLocalProjectViewAction method openLocalProjectViewFile.

/**
 * Opens the user's local project view file.
 */
public static void openLocalProjectViewFile(Project project) {
    ProjectViewSet projectViewSet = ProjectViewManager.getInstance(project).getProjectViewSet();
    if (projectViewSet == null) {
        return;
    }
    ProjectViewHelper.openProjectViewFile(project, projectViewSet.getTopLevelProjectViewFile());
}
Also used : ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet)

Example 65 with ProjectViewSet

use of com.google.idea.blaze.base.projectview.ProjectViewSet in project intellij by bazelbuild.

the class ProjectViewUi method parseProjectView.

public ProjectViewSet parseProjectView(final List<IssueOutput> issues) {
    final String projectViewText = projectViewEditor.getDocument().getText();
    final OutputSink<IssueOutput> issueCollector = output -> {
        issues.add(output);
        return OutputSink.Propagation.Continue;
    };
    return Scope.root(context -> {
        context.addOutputSink(IssueOutput.class, issueCollector);
        ProjectViewParser projectViewParser = new ProjectViewParser(context, workspacePathResolver);
        projectViewParser.parseProjectView(projectViewText);
        return projectViewParser.getResult();
    });
}
Also used : UIManager(javax.swing.UIManager) WriteAction(com.intellij.openapi.application.WriteAction) EditorFactoryImpl(com.intellij.openapi.editor.impl.EditorFactoryImpl) ProjectViewLanguage(com.google.idea.blaze.base.lang.projectview.language.ProjectViewLanguage) Document(com.intellij.openapi.editor.Document) PsiManagerEx(com.intellij.psi.impl.PsiManagerEx) JBLabel(com.intellij.ui.components.JBLabel) PsiManager(com.intellij.psi.PsiManager) OutputSink(com.google.idea.blaze.base.scope.OutputSink) UiUtil(com.google.idea.blaze.base.ui.UiUtil) BuildSystem(com.google.idea.blaze.base.settings.Blaze.BuildSystem) ProjectManager(com.intellij.openapi.project.ProjectManager) Scope(com.google.idea.blaze.base.scope.Scope) IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) Disposer(com.intellij.openapi.util.Disposer) Project(com.intellij.openapi.project.Project) EditorEx(com.intellij.openapi.editor.ex.EditorEx) WorkspacePathResolver(com.google.idea.blaze.base.sync.workspace.WorkspacePathResolver) DataManager(com.intellij.ide.DataManager) DocumentImpl(com.intellij.openapi.editor.impl.DocumentImpl) Nullable(javax.annotation.Nullable) LightVirtualFile(com.intellij.testFramework.LightVirtualFile) Blaze(com.google.idea.blaze.base.settings.Blaze) FileManager(com.intellij.psi.impl.file.impl.FileManager) ProjectViewParser(com.google.idea.blaze.base.projectview.parser.ProjectViewParser) ProjectViewFileType(com.google.idea.blaze.base.lang.projectview.language.ProjectViewFileType) FileDocumentManagerImpl(com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl) Disposable(com.intellij.openapi.Disposable) Dimension(java.awt.Dimension) List(java.util.List) EditorColors(com.intellij.openapi.editor.colors.EditorColors) KeyboardFocusManager(java.awt.KeyboardFocusManager) ProjectImpl(com.intellij.openapi.project.impl.ProjectImpl) MutablePicoContainer(org.picocontainer.MutablePicoContainer) WorkspacePathResolverProvider(com.google.idea.blaze.base.sync.workspace.WorkspacePathResolverProvider) Result(com.intellij.openapi.application.Result) ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet) EditorFactory(com.intellij.openapi.editor.EditorFactory) JCheckBox(javax.swing.JCheckBox) EditorSettings(com.intellij.openapi.editor.EditorSettings) WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) UndoUtil(com.intellij.openapi.command.undo.UndoUtil) NotNull(org.jetbrains.annotations.NotNull) JPanel(javax.swing.JPanel) IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) ProjectViewParser(com.google.idea.blaze.base.projectview.parser.ProjectViewParser)

Aggregations

ProjectViewSet (com.google.idea.blaze.base.projectview.ProjectViewSet)74 File (java.io.File)30 Test (org.junit.Test)29 WorkspaceLanguageSettings (com.google.idea.blaze.base.sync.projectview.WorkspaceLanguageSettings)21 WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)17 WorkspaceRoot (com.google.idea.blaze.base.model.primitives.WorkspaceRoot)17 ImmutableList (com.google.common.collect.ImmutableList)16 BlazeContext (com.google.idea.blaze.base.scope.BlazeContext)16 Project (com.intellij.openapi.project.Project)16 BlazeProjectData (com.google.idea.blaze.base.model.BlazeProjectData)15 Nullable (javax.annotation.Nullable)15 List (java.util.List)14 DirectoryEntry (com.google.idea.blaze.base.projectview.section.sections.DirectoryEntry)12 TargetIdeInfo (com.google.idea.blaze.base.ideinfo.TargetIdeInfo)11 TargetMap (com.google.idea.blaze.base.ideinfo.TargetMap)11 Kind (com.google.idea.blaze.base.model.primitives.Kind)11 ArtifactLocationDecoder (com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder)11 Set (java.util.Set)11 Lists (com.google.common.collect.Lists)10 Collectors (java.util.stream.Collectors)10