IDEA-169924 show/hide breadcrumbs from a gutter popup

This commit is contained in:
Sergey Malenkov
2017-04-05 21:18:54 +03:00
parent 5c899da11a
commit 17729d6db5
4 changed files with 38 additions and 1 deletions
@@ -0,0 +1,35 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.editor.actions;
import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.editor.ex.EditorSettingsExternalizable;
import com.intellij.openapi.project.DumbAware;
public class ToggleShowBreadcrumbsGloballyAction extends ToggleAction implements DumbAware {
@Override
public boolean isSelected(AnActionEvent event) {
return EditorSettingsExternalizable.getInstance().isBreadcrumbsShown();
}
@Override
public void setSelected(AnActionEvent event, boolean selected) {
EditorSettingsExternalizable.getInstance().setBreadcrumbsShown(selected);
UISettings.getInstance().fireUISettingsChanged();
}
}
@@ -1499,6 +1499,7 @@ action.EditorGutterToggleGlobalSoftWraps.text=Soft-Wrap All Files
action.EditorGutterToggleLocalSoftWraps.gutterText=Soft-Wrap Current File
action.EditorGutterToggleGlobalLineNumbers.text=Show Line Numbers
action.EditorGutterToggleGlobalIndentLines.text=Show Indent Guides
action.EditorGutterToggleGlobalBreadcrumbs.text=Show Breadcrumbs
action.ExcludeFromProject.text=Exclude From Project...
group.MarkFileAs.text=Mark File as
action.MarkAsPlainTextAction.text=Mark as Plain Text
@@ -654,6 +654,7 @@
<group id="EditorGutterPopupMenu">
<action id="EditorGutterToggleGlobalLineNumbers" class="com.intellij.openapi.editor.actions.ToggleShowLineNumbersGloballyAction"/>
<action id="EditorGutterToggleGlobalIndentLines" class="com.intellij.openapi.editor.actions.ToggleShowIndentLinesGloballyAction"/>
<action id="EditorGutterToggleGlobalBreadcrumbs" class="com.intellij.openapi.editor.actions.ToggleShowBreadcrumbsGloballyAction"/>
<separator/>
<action id="EditorGutterToggleGlobalSoftWraps" class="com.intellij.openapi.editor.actions.ToggleSoftWrapsGloballyAction"/>
<reference ref="EditorToggleUseSoftWraps"/>
@@ -86,7 +86,7 @@ public class BreadcrumbsInitializingActivity implements StartupActivity, DumbAwa
}
private static void reinitBreadcrumbsInAllEditors(@NotNull Project project) {
if (!project.isDisposed()) return;
if (project.isDisposed()) return;
FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
for (VirtualFile virtualFile : fileEditorManager.getOpenFiles()) {
reinitBreadcrumbsComponent(fileEditorManager, virtualFile);