From 7f174a2e6fb5e886e498fcc87ff32408b9e2bfb4 Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Fri, 27 Aug 2010 20:48:56 +0400 Subject: [PATCH] fixed: [RUBY-6630] Remove unused icon from the Test runner toolbar --- .../src/com/intellij/util/config/ToggleBooleanProperty.java | 2 ++ .../intellij/execution/testframework/ToggleModelAction.java | 5 +++++ .../testframework/actions/ScrollToTestSourceAction.java | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/platform/platform-api/src/com/intellij/util/config/ToggleBooleanProperty.java b/platform/platform-api/src/com/intellij/util/config/ToggleBooleanProperty.java index bb2f934e1f4c..a3dab2fe22f2 100644 --- a/platform/platform-api/src/com/intellij/util/config/ToggleBooleanProperty.java +++ b/platform/platform-api/src/com/intellij/util/config/ToggleBooleanProperty.java @@ -49,10 +49,12 @@ public class ToggleBooleanProperty extends ToggleAction { } protected abstract boolean isEnabled(); + protected abstract boolean isVisible(); public void update(AnActionEvent e) { super.update(e); e.getPresentation().setEnabled(isEnabled()); + e.getPresentation().setVisible(isVisible()); } } } diff --git a/platform/testRunner/src/com/intellij/execution/testframework/ToggleModelAction.java b/platform/testRunner/src/com/intellij/execution/testframework/ToggleModelAction.java index e32181d46f60..143b90e0bef1 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/ToggleModelAction.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/ToggleModelAction.java @@ -32,6 +32,11 @@ public abstract class ToggleModelAction extends ToggleBooleanProperty.Disablable super(text, description, icon, properties, property); } + @Override + protected boolean isVisible() { + return true; + } + public abstract void setModel(TestFrameworkRunningModel model); } \ No newline at end of file diff --git a/platform/testRunner/src/com/intellij/execution/testframework/actions/ScrollToTestSourceAction.java b/platform/testRunner/src/com/intellij/execution/testframework/actions/ScrollToTestSourceAction.java index 601fadd6baa1..25453e88bfe0 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/actions/ScrollToTestSourceAction.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/actions/ScrollToTestSourceAction.java @@ -37,6 +37,11 @@ public class ScrollToTestSourceAction extends ToggleBooleanProperty.Disablable { return isEnabled(properties, model); } + @Override + protected boolean isVisible() { + return true; + } + private static boolean isEnabled(final AbstractProperty.AbstractPropertyContainer properties, final TestFrameworkRunningModel model) { if (!TestConsoleProperties.TRACK_RUNNING_TEST.value(properties)) return true; return model != null && !model.isRunning();