Search in sources :

Example 6 with NavigatableAdapter

use of com.intellij.pom.NavigatableAdapter in project intellij by bazelbuild.

the class BlazePythonSyncPlugin method validateProjectView.

@Override
public boolean validateProjectView(@Nullable Project project, BlazeContext context, ProjectViewSet projectViewSet, WorkspaceLanguageSettings workspaceLanguageSettings) {
    ProjectViewFile topLevelProjectViewFile = projectViewSet.getTopLevelProjectViewFile();
    if (!supportsPythonWorkspaceType() && workspaceLanguageSettings.isWorkspaceType(WorkspaceType.PYTHON)) {
        String msg = "Python workspace type is not supported (and is unnecessary) for this IDE. ";
        boolean fixable = topLevelProjectViewFile != null && topLevelProjectViewFile.projectView.getScalarValue(WorkspaceTypeSection.KEY) == WorkspaceType.PYTHON;
        msg += fixable ? "Click here to remove it, retaining python support" : "Please remove it and resync.";
        IssueOutput.error(msg).navigatable(project == null || !fixable ? null : new NavigatableAdapter() {

            @Override
            public void navigate(boolean requestFocus) {
                fixLanguageSupport(project, true);
            }
        }).submit(context);
        return false;
    }
    return true;
}
Also used : ProjectViewFile(com.google.idea.blaze.base.projectview.ProjectViewSet.ProjectViewFile) NavigatableAdapter(com.intellij.pom.NavigatableAdapter)

Aggregations

NavigatableAdapter (com.intellij.pom.NavigatableAdapter)6 Nullable (org.jetbrains.annotations.Nullable)3 ProjectViewFile (com.google.idea.blaze.base.projectview.ProjectViewSet.ProjectViewFile)2 HyperlinkInfo (com.intellij.execution.filters.HyperlinkInfo)1 RangeHighlighter (com.intellij.openapi.editor.markup.RangeHighlighter)1 Project (com.intellij.openapi.project.Project)1 VcsVirtualFile (com.intellij.openapi.vcs.vfs.VcsVirtualFile)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 Navigatable (com.intellij.pom.Navigatable)1 XmlTag (com.intellij.psi.xml.XmlTag)1 RelativePoint (com.intellij.ui.awt.RelativePoint)1 MavenDomDependency (org.jetbrains.idea.maven.dom.model.MavenDomDependency)1 MavenDomProjectModel (org.jetbrains.idea.maven.dom.model.MavenDomProjectModel)1