inspection settings: use grey color to display rename profile hint (IDEA-165091)

This commit is contained in:
Dmitry Batkovich
2017-04-24 14:58:06 +03:00
parent 7cdfaa4275
commit 36f17034f0
3 changed files with 15 additions and 11 deletions
@@ -124,8 +124,7 @@ public abstract class AbstractDescriptionAwareSchemesPanel<T extends Scheme> ext
@Override
public final void showMessage(@Nullable String message, @NotNull MessageType messageType) {
myWarningLabel.setText(message);
myWarningLabel.setForeground(messageType.getTitleForeground());
showMessage(message, messageType, myWarningLabel);
myLayout.show(myInfoComponent, ERROR_CARD);
}
@@ -56,9 +56,9 @@ public abstract class AbstractSchemesPanel<T extends Scheme, InfoComponent exten
// region Colors (probably should be standard for platform UI)
protected final Color HINT_FOREGROUND = JBColor.GRAY;
protected static final Color HINT_FOREGROUND = JBColor.GRAY;
@SuppressWarnings("UseJBColor")
protected final Color ERROR_MESSAGE_FOREGROUND = Color.RED;
protected static final Color ERROR_MESSAGE_FOREGROUND = Color.RED;
// endregion
@@ -235,4 +235,15 @@ public abstract class AbstractSchemesPanel<T extends Scheme, InfoComponent exten
actionGroupPopup.show(new RelativePoint(myParentComponent, new Point(JBUI.scale(2), myParentComponent.getHeight() - JBUI.scale(1))));
}
}
protected static void showMessage(@Nullable String message,
@NotNull MessageType messageType,
@NotNull JLabel infoComponent) {
infoComponent.setText(message);
Color foreground =
messageType == MessageType.INFO ? HINT_FOREGROUND :
messageType == MessageType.ERROR ? ERROR_MESSAGE_FOREGROUND :
messageType.getTitleForeground();
infoComponent.setForeground(foreground);
}
}
@@ -21,7 +21,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.*;
/**
* Basic implementation of {@link AbstractSchemesPanel} that provides simple informational label as right side of the panel.
@@ -38,12 +37,7 @@ public abstract class SimpleSchemesPanel<T extends Scheme> extends AbstractSchem
@Override
public final void showMessage(@Nullable String message, @NotNull MessageType messageType) {
myInfoComponent.setText(message);
Color foreground =
messageType == MessageType.INFO ? HINT_FOREGROUND :
messageType == MessageType.ERROR ? ERROR_MESSAGE_FOREGROUND :
messageType.getTitleForeground();
myInfoComponent.setForeground(foreground);
showMessage(message, messageType, myInfoComponent);
}
@Override