Update breadcrumbs on actual options changes

This commit is contained in:
Alexander Zolotov
2015-07-31 17:54:01 +03:00
parent a3154c84c6
commit f68998ade4
2 changed files with 10 additions and 4 deletions
@@ -137,10 +137,10 @@ public class BreadcrumbsLoaderComponent extends AbstractProjectComponent {
private static void removeBreadcrumbs(@NotNull FileEditorManager fileEditorManager, @NotNull VirtualFile file) {
final FileEditor[] fileEditors = fileEditorManager.getAllEditors(file);
for (final FileEditor fileEditor : fileEditors) {
for (FileEditor fileEditor : fileEditors) {
if (fileEditor instanceof TextEditor) {
Editor editor = ((TextEditor)fileEditor).getEditor();
final BreadcrumbsXmlWrapper wrapper = BreadcrumbsXmlWrapper.getBreadcrumbsComponent(editor);
BreadcrumbsXmlWrapper wrapper = BreadcrumbsXmlWrapper.getBreadcrumbsComponent(editor);
if (wrapper != null) {
disposeWrapper(fileEditorManager, fileEditor, wrapper);
}
@@ -60,8 +60,11 @@ public class WebEditorOptions implements PersistentStateComponent<WebEditorOptio
}
public void setBreadcrumbsEnabled(boolean b) {
boolean oldValue = myBreadcrumbsEnabled;
myBreadcrumbsEnabled = b;
ApplicationManager.getApplication().getMessageBus().syncPublisher(WEB_EDITOR_OPTIONS).breadcrumbsOptionsChanged(this);
if (oldValue != b) {
ApplicationManager.getApplication().getMessageBus().syncPublisher(WEB_EDITOR_OPTIONS).breadcrumbsOptionsChanged(this);
}
}
public boolean isBreadcrumbsEnabledInXml() {
@@ -69,8 +72,11 @@ public class WebEditorOptions implements PersistentStateComponent<WebEditorOptio
}
public void setBreadcrumbsEnabledInXml(boolean b) {
boolean oldValue = myBreadcrumbsEnabledInXml;
myBreadcrumbsEnabledInXml = b;
ApplicationManager.getApplication().getMessageBus().syncPublisher(WEB_EDITOR_OPTIONS).breadcrumbsOptionsChanged(this);
if (oldValue != b) {
ApplicationManager.getApplication().getMessageBus().syncPublisher(WEB_EDITOR_OPTIONS).breadcrumbsOptionsChanged(this);
}
}
public boolean isShowCssInlineColorPreview() {