add 'based on' if and only if scheme has name 'Other'

This commit is contained in:
Konstantin Bulenkov
2017-06-14 14:34:44 +02:00
parent ecb6e28502
commit dfacd78b91
2 changed files with 20 additions and 4 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* 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.
@@ -45,6 +45,7 @@ public class AnActionEvent implements PlaceProvider<String> {
private boolean myWorksInInjected;
@NonNls private static final String ourInjectedPrefix = "$injected$.";
private static final Map<String, String> ourInjectedIds = new HashMap<>();
private boolean myIsToolbarAction;
/**
* @throws IllegalArgumentException if <code>dataContext</code> is <code>null</code> or
@@ -99,8 +100,19 @@ public class AnActionEvent implements PlaceProvider<String> {
@NotNull String place,
@NotNull Presentation presentation,
@NotNull DataContext dataContext) {
return new AnActionEvent(event, dataContext, place, presentation, ActionManager.getInstance(),
event == null ? 0 : event.getModifiers());
return createFromInputEvent(event, place, presentation, dataContext, false);
}
@NotNull
public static AnActionEvent createFromInputEvent(@Nullable InputEvent event,
@NotNull String place,
@NotNull Presentation presentation,
@NotNull DataContext dataContext,
boolean isToolbarAction) {
AnActionEvent e = new AnActionEvent(event, dataContext, place, presentation, ActionManager.getInstance(),
event == null ? 0 : event.getModifiers());
e.myIsToolbarAction = isToolbarAction;
return e;
}
/**
@@ -208,6 +220,10 @@ public class AnActionEvent implements PlaceProvider<String> {
return myPlace;
}
public boolean isToolbarAction() {
return myIsToolbarAction;
}
/**
* Returns the presentation which represents the action in the place from where it is invoked
* or updated.
@@ -46,7 +46,7 @@ public class EditorColorSchemesUsagesCollector extends UsagesCollector {
schemeName = original.getName();
}
}
if (currentScheme instanceof AbstractColorsScheme) {
if (schemeName == SCHEME_NAME_OTHER) {
EditorColorsScheme parentScheme = ((AbstractColorsScheme)currentScheme).getParentScheme();
if (parentScheme != null) {
schemeName += " based on " + parentScheme.getName();