fixed: [RUBY-6630] Remove unused icon from the Test runner toolbar

This commit is contained in:
Roman Chernyatchik
2010-08-27 23:06:57 +04:00
parent 36e9ca5d0a
commit 7f174a2e6f
3 changed files with 12 additions and 0 deletions
@@ -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());
}
}
}
@@ -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);
}
@@ -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();