diff --git a/images/src/org/intellij/images/options/GridOptions.java b/images/src/org/intellij/images/options/GridOptions.java index a33f2fd437ad..a428552be4a2 100644 --- a/images/src/org/intellij/images/options/GridOptions.java +++ b/images/src/org/intellij/images/options/GridOptions.java @@ -15,6 +15,7 @@ */ package org.intellij.images.options; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.NonNls; import java.awt.*; @@ -38,7 +39,7 @@ public interface GridOptions extends Cloneable { int DEFAULT_LINE_ZOOM_FACTOR = 3; int DEFAULT_LINE_SPAN = 1; - Color DEFAULT_LINE_COLOR = Color.DARK_GRAY; + Color DEFAULT_LINE_COLOR = JBColor.DARK_GRAY; boolean isShowDefault(); diff --git a/images/src/org/intellij/images/ui/ThumbnailComponentUI.java b/images/src/org/intellij/images/ui/ThumbnailComponentUI.java index 5a383aed3606..ddb4a663b2d5 100644 --- a/images/src/org/intellij/images/ui/ThumbnailComponentUI.java +++ b/images/src/org/intellij/images/ui/ThumbnailComponentUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -19,6 +19,7 @@ package org.intellij.images.ui; import com.intellij.openapi.ui.Messages; +import com.intellij.ui.JBColor; import com.intellij.util.ui.UIUtil; import icons.ImagesIcons; import org.intellij.images.ImagesBundle; @@ -256,7 +257,7 @@ public class ThumbnailComponentUI extends ComponentUI { // Error String error = getSubmnailComponentErrorString(); - g.setColor(Color.RED); + g.setColor(JBColor.RED); g.setFont(font); g.drawString(error, 8, 8 + fontMetrics.getAscent()); } diff --git a/java/compiler/impl/src/com/intellij/compiler/options/TargetOptionsComponent.java b/java/compiler/impl/src/com/intellij/compiler/options/TargetOptionsComponent.java index ec2579a648da..a4864c8f2235 100644 --- a/java/compiler/impl/src/com/intellij/compiler/options/TargetOptionsComponent.java +++ b/java/compiler/impl/src/com/intellij/compiler/options/TargetOptionsComponent.java @@ -21,10 +21,7 @@ import com.intellij.openapi.module.ModuleType; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; import com.intellij.openapi.ui.ComboBox; -import com.intellij.ui.AnActionButton; -import com.intellij.ui.AnActionButtonRunnable; -import com.intellij.ui.TableUtil; -import com.intellij.ui.ToolbarDecorator; +import com.intellij.ui.*; import com.intellij.ui.table.JBTable; import com.intellij.util.ui.ItemRemovable; import org.jetbrains.annotations.Nullable; @@ -350,7 +347,7 @@ public class TargetOptionsComponent extends JPanel { final JLabel comp = (JLabel)component; comp.setHorizontalAlignment(SwingConstants.CENTER); if ("".equals(value)) { - comp.setForeground(Color.gray); + comp.setForeground(JBColor.GRAY); comp.setText(COMPILER_DEFAULT); } else { @@ -381,7 +378,7 @@ public class TargetOptionsComponent extends JPanel { final Color oldColor = g.getColor(); final Font oldFont = g.getFont(); try { - g.setColor(Color.gray); + g.setColor(JBColor.GRAY); //g.setFont(oldFont.deriveFont(Font.ITALIC)); final FontMetrics metrics = g.getFontMetrics(); int x = Math.abs(getWidth() - metrics.charsWidth(myHint, 0, myHint.length)) / 2; diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/run/ArtifactChooser.java b/java/compiler/impl/src/com/intellij/packaging/impl/run/ArtifactChooser.java index f235dbb77bb7..c6e7aca3fdf3 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/run/ArtifactChooser.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/run/ArtifactChooser.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -19,6 +19,7 @@ import com.intellij.icons.AllIcons; import com.intellij.ide.util.ElementsChooser; import com.intellij.packaging.artifacts.Artifact; import com.intellij.packaging.artifacts.ArtifactPointer; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.NotNull; import javax.swing.*; @@ -41,7 +42,7 @@ public class ArtifactChooser extends ElementsChooser { } public Color getColor() { - return Color.RED; + return JBColor.RED; } }; diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/options/ExcludedEntriesConfigurable.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/options/ExcludedEntriesConfigurable.java index 4bdcc5349e9c..6a2cd877faf8 100644 --- a/java/compiler/openapi/src/com/intellij/openapi/compiler/options/ExcludedEntriesConfigurable.java +++ b/java/compiler/openapi/src/com/intellij/openapi/compiler/options/ExcludedEntriesConfigurable.java @@ -377,7 +377,7 @@ public class ExcludedEntriesConfigurable implements UnnamedConfigurable { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { final Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); final ExcludeEntryDescription description = myExcludeEntryDescriptions.get(row); - component.setForeground(!description.isValid() ? Color.RED : isSelected ? table.getSelectionForeground() : table.getForeground()); + component.setForeground(!description.isValid() ? JBColor.RED : isSelected ? table.getSelectionForeground() : table.getForeground()); component.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); return component; } diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/GetJPDADialog.java b/java/debugger/impl/src/com/intellij/debugger/ui/GetJPDADialog.java index f6504b525357..c88c008288ff 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/GetJPDADialog.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/GetJPDADialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -25,6 +25,7 @@ import com.intellij.debugger.DebuggerBundle; import com.intellij.ide.BrowserUtil; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.ui.DoubleClickListener; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.NonNls; import javax.swing.*; @@ -61,7 +62,7 @@ public class GetJPDADialog extends DialogWrapper { return true; } }.installOn(label2); - label2.setForeground(Color.blue.darker()); + label2.setForeground(JBColor.BLUE.darker()); label2.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); _panel2.add(new JLabel(DebuggerBundle.message("label.get.jpda.dialog.error.description")), BorderLayout.NORTH); _panel2.add(label1, BorderLayout.WEST); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/DebuggerTreeRenderer.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/DebuggerTreeRenderer.java index 0241205503e5..c1d439a85098 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/DebuggerTreeRenderer.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/DebuggerTreeRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -25,10 +25,7 @@ import com.intellij.openapi.editor.SyntaxHighlighterColors; import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.ui.ColoredTreeCellRenderer; -import com.intellij.ui.RowIcon; -import com.intellij.ui.SimpleColoredText; -import com.intellij.ui.SimpleTextAttributes; +import com.intellij.ui.*; import com.intellij.util.PlatformIcons; import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants; import com.intellij.xdebugger.impl.ui.tree.ValueMarkup; @@ -40,8 +37,8 @@ import java.awt.*; public class DebuggerTreeRenderer extends ColoredTreeCellRenderer { private static final SimpleTextAttributes DEFAULT_ATTRIBUTES = new SimpleTextAttributes(Font.PLAIN, null); - private static final SimpleTextAttributes SPECIAL_NODE_ATTRIBUTES = new SimpleTextAttributes(Font.PLAIN, Color.lightGray); - private static final SimpleTextAttributes OBJECT_ID_HIGHLIGHT_ATTRIBUTES = new SimpleTextAttributes(Font.PLAIN, Color.lightGray); + private static final SimpleTextAttributes SPECIAL_NODE_ATTRIBUTES = new SimpleTextAttributes(Font.PLAIN, JBColor.LIGHT_GRAY); + private static final SimpleTextAttributes OBJECT_ID_HIGHLIGHT_ATTRIBUTES = new SimpleTextAttributes(Font.PLAIN, JBColor.LIGHT_GRAY); public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { final DebuggerTreeNodeImpl node = (DebuggerTreeNodeImpl) value; @@ -256,7 +253,7 @@ public class DebuggerTreeRenderer extends ColoredTreeCellRenderer { escapeAttribs = SimpleTextAttributes.fromTextAttributes(fromHighlighter); } else { - escapeAttribs = DEFAULT_ATTRIBUTES.derive(SimpleTextAttributes.STYLE_BOLD, Color.gray, null, null); + escapeAttribs = DEFAULT_ATTRIBUTES.derive(SimpleTextAttributes.STYLE_BOLD, JBColor.GRAY, null, null); } } diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/FramesListRenderer.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/FramesListRenderer.java index ccacf43c595b..c6e62281b143 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/FramesListRenderer.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/FramesListRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -16,6 +16,7 @@ package com.intellij.debugger.ui.impl; import com.intellij.debugger.ui.impl.watch.StackFrameDescriptorImpl; +import com.intellij.ui.JBColor; import com.intellij.xdebugger.impl.ui.tree.ValueMarkup; import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.EditorColorsScheme; @@ -75,7 +76,7 @@ class FramesListRenderer extends ColoredListCellRenderer { } if (needSeparator) { - final MatteBorder border = BorderFactory.createMatteBorder(1, 0, 0, 0, Color.GRAY); + final MatteBorder border = BorderFactory.createMatteBorder(1, 0, 0, 0, JBColor.GRAY); setBorder(border); } else { diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/OrderEntryAppearanceServiceImpl.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/OrderEntryAppearanceServiceImpl.java index 58ba508f16ca..154a03534105 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/OrderEntryAppearanceServiceImpl.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/OrderEntryAppearanceServiceImpl.java @@ -36,6 +36,7 @@ import com.intellij.openapi.vfs.JarFileSystem; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileManager; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.PathUtil; import com.intellij.util.PlatformIcons; @@ -179,7 +180,7 @@ public class OrderEntryAppearanceServiceImpl extends OrderEntryAppearanceService @NotNull private static CellAppearanceEx normalOrRedWaved(@NotNull final String text, @Nullable final Icon icon, final boolean waved) { - return waved ? new SimpleTextCellAppearance(text, icon, new SimpleTextAttributes(SimpleTextAttributes.STYLE_WAVED, null, Color.RED)) + return waved ? new SimpleTextCellAppearance(text, icon, new SimpleTextAttributes(SimpleTextAttributes.STYLE_WAVED, null, JBColor.RED)) : SimpleTextCellAppearance.regular(text, icon); } diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/nodes/PackagingElementNode.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/nodes/PackagingElementNode.java index e4e49aa18b0e..064ec573b096 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/nodes/PackagingElementNode.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/nodes/PackagingElementNode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -25,6 +25,7 @@ import com.intellij.openapi.util.MultiValuesMap; import com.intellij.packaging.elements.CompositePackagingElement; import com.intellij.packaging.elements.PackagingElement; import com.intellij.packaging.ui.ArtifactEditorContext; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import com.intellij.ui.treeStructure.SimpleNode; import com.intellij.util.ArrayUtil; @@ -33,9 +34,7 @@ import com.intellij.util.StringBuilderSpinAllocator; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.awt.*; import java.util.*; -import java.util.List; /** * @author nik @@ -126,7 +125,7 @@ public class PackagingElementNode> extends Artifac private static SimpleTextAttributes addErrorHighlighting(boolean error, SimpleTextAttributes attributes) { final TextAttributes textAttributes = attributes.toTextAttributes(); textAttributes.setEffectType(EffectType.WAVE_UNDERSCORE); - textAttributes.setEffectColor(error ? Color.RED : Color.GRAY); + textAttributes.setEffectColor(error ? JBColor.RED : JBColor.GRAY); return SimpleTextAttributes.fromTextAttributes(textAttributes); } diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectStructureElementRenderer.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectStructureElementRenderer.java index 02fd7be143a0..f90888d8daaa 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectStructureElementRenderer.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectStructureElementRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -22,6 +22,7 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStr import com.intellij.openapi.ui.MasterDetailsComponent; import com.intellij.openapi.ui.NamedConfigurable; import com.intellij.ui.ColoredTreeCellRenderer; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.ui.UIUtil; @@ -70,7 +71,7 @@ class ProjectStructureElementRenderer extends ColoredTreeCellRenderer { final boolean haveErrors = problemsHolder.containsProblems(ProjectStructureProblemType.Severity.ERROR); Color foreground = isUnused ? UIUtil.getInactiveTextColor() : null; final int style = haveWarnings || haveErrors ? SimpleTextAttributes.STYLE_WAVED : -1; - final Color waveColor = haveErrors ? Color.RED : haveWarnings ? Color.GRAY : null; + final Color waveColor = haveErrors ? JBColor.RED : haveWarnings ? JBColor.GRAY : null; textAttributes = textAttributes.derive(style, foreground, null, waveColor); setToolTipText(problemsHolder.composeTooltipMessage()); } diff --git a/java/java-impl/src/com/intellij/codeInsight/intention/impl/ColorChooserIntentionAction.java b/java/java-impl/src/com/intellij/codeInsight/intention/impl/ColorChooserIntentionAction.java index 3f1c3b6f6f81..b14a8d03b7d5 100644 --- a/java/java-impl/src/com/intellij/codeInsight/intention/impl/ColorChooserIntentionAction.java +++ b/java/java-impl/src/com/intellij/codeInsight/intention/impl/ColorChooserIntentionAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -24,7 +24,6 @@ package com.intellij.codeInsight.intention.impl; import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.codeInsight.CodeInsightUtilBase; -import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; @@ -34,14 +33,13 @@ import com.intellij.psi.*; import com.intellij.psi.codeStyle.CodeStyleManager; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.ui.ColorChooser; +import com.intellij.ui.JBColor; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; import javax.swing.*; import java.awt.*; -import static com.intellij.patterns.PlatformPatterns.psiElement; - /** * @author spleaner * @author Konstantin Bulenkov @@ -105,7 +103,7 @@ public class ColorChooserIntentionAction extends BaseColorIntentionAction { oldColor = Color.decode(text); } catch (NumberFormatException e) { - oldColor = Color.GRAY; + oldColor = JBColor.GRAY; } Color color = ColorChooser.chooseColor(editorComponent, getText(), oldColor, true); if (color == null) return; @@ -178,11 +176,11 @@ public class ColorChooserIntentionAction extends BaseColorIntentionAction { } } catch (Exception e) { - c = Color.GRAY; + c = JBColor.GRAY; } } - c = (c == null) ? Color.GRAY : c; + c = (c == null) ? JBColor.GRAY : c; replaceColor(editorComponent, expression, c); } diff --git a/java/java-impl/src/com/intellij/refactoring/changeSignature/inCallers/JavaMethodNode.java b/java/java-impl/src/com/intellij/refactoring/changeSignature/inCallers/JavaMethodNode.java index 159c848a9acc..1b203e59dcd0 100644 --- a/java/java-impl/src/com/intellij/refactoring/changeSignature/inCallers/JavaMethodNode.java +++ b/java/java-impl/src/com/intellij/refactoring/changeSignature/inCallers/JavaMethodNode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -24,11 +24,11 @@ import com.intellij.psi.util.PsiFormatUtil; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.refactoring.changeSignature.MethodNodeBase; import com.intellij.ui.ColoredTreeCellRenderer; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.Nullable; -import java.awt.*; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -91,7 +91,7 @@ public class JavaMethodNode extends MethodNodeBase { if (containingClass != null) { final String packageName = getPackageName(containingClass); - renderer.append(" (" + packageName + ")", new SimpleTextAttributes(SimpleTextAttributes.STYLE_ITALIC, Color.GRAY)); + renderer.append(" (" + packageName + ")", new SimpleTextAttributes(SimpleTextAttributes.STYLE_ITALIC, JBColor.GRAY)); } } diff --git a/java/java-impl/src/com/intellij/refactoring/encapsulateFields/EncapsulateFieldsDialog.java b/java/java-impl/src/com/intellij/refactoring/encapsulateFields/EncapsulateFieldsDialog.java index 1d76e668a8c6..9943d48fc8d6 100644 --- a/java/java-impl/src/com/intellij/refactoring/encapsulateFields/EncapsulateFieldsDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/encapsulateFields/EncapsulateFieldsDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -669,7 +669,7 @@ public String getAccessorsVisibility() { } } } else { - MyTableRenderer.this.setForeground(Color.red); + MyTableRenderer.this.setForeground(JBColor.RED); } RowIcon icon = new RowIcon(2); diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterPopup.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterPopup.java index 82b0c44bbe1e..7a376d15f7e6 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterPopup.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterPopup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -36,6 +36,7 @@ import com.intellij.psi.util.PsiUtil; import com.intellij.refactoring.JavaRefactoringSettings; import com.intellij.refactoring.RefactoringActionHandler; import com.intellij.refactoring.ui.TypeSelectorManagerImpl; +import com.intellij.ui.JBColor; import com.intellij.usageView.UsageInfo; import gnu.trove.TIntArrayList; import gnu.trove.TIntProcedure; @@ -283,7 +284,7 @@ public class InplaceIntroduceParameterPopup extends AbstractJavaInplaceIntroduce private static TextAttributes getTextAttributesForAdd() { final TextAttributes textAttributes = new TextAttributes(); textAttributes.setEffectType(EffectType.ROUNDED_BOX); - textAttributes.setEffectColor(Color.RED); + textAttributes.setEffectColor(JBColor.RED); return textAttributes; } diff --git a/java/java-impl/src/com/intellij/slicer/SliceTooComplexDFAUsage.java b/java/java-impl/src/com/intellij/slicer/SliceTooComplexDFAUsage.java index e32c9cf16730..89360c028f74 100644 --- a/java/java-impl/src/com/intellij/slicer/SliceTooComplexDFAUsage.java +++ b/java/java-impl/src/com/intellij/slicer/SliceTooComplexDFAUsage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -19,6 +19,7 @@ import com.intellij.openapi.editor.markup.EffectType; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiSubstitutor; +import com.intellij.ui.JBColor; import com.intellij.usages.TextChunk; import com.intellij.usages.UsagePresentation; import com.intellij.util.Processor; @@ -49,7 +50,7 @@ public class SliceTooComplexDFAUsage extends SliceUsage { @NotNull public TextChunk[] getText() { return new TextChunk[]{ - new TextChunk(new TextAttributes(Color.RED, null, null, EffectType.WAVE_UNDERSCORE, Font.PLAIN), getTooltipText()) + new TextChunk(new TextAttributes(JBColor.RED, null, null, EffectType.WAVE_UNDERSCORE, Font.PLAIN), getTooltipText()) }; } diff --git a/java/java-impl/src/com/intellij/unscramble/ThreadDumpPanel.java b/java/java-impl/src/com/intellij/unscramble/ThreadDumpPanel.java index 677c964b763f..4fc26a0e826a 100644 --- a/java/java-impl/src/com/intellij/unscramble/ThreadDumpPanel.java +++ b/java/java-impl/src/com/intellij/unscramble/ThreadDumpPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -155,7 +155,7 @@ public class ThreadDumpPanel extends JPanel { setBackground(LightColors.RED); } else if (selectedThread != null && threadState.isAwaitedBy(selectedThread)) { - setBackground(Color.YELLOW); + setBackground(JBColor.YELLOW); } else { setBackground(UIUtil.getListBackground()); diff --git a/platform/lang-impl/src/com/intellij/codeEditor/printing/HTMLTextPainter.java b/platform/lang-impl/src/com/intellij/codeEditor/printing/HTMLTextPainter.java index 53195281d4e5..4ad135f737b6 100644 --- a/platform/lang-impl/src/com/intellij/codeEditor/printing/HTMLTextPainter.java +++ b/platform/lang-impl/src/com/intellij/codeEditor/printing/HTMLTextPainter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -36,6 +36,7 @@ import com.intellij.psi.PsiReference; import com.intellij.psi.codeStyle.CodeStyleSettingsManager; import com.intellij.psi.impl.file.PsiDirectoryFactory; import com.intellij.psi.util.PsiUtilBase; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.NonNls; import java.awt.*; @@ -323,7 +324,7 @@ class HTMLTextPainter { writeStyles(writer); writer.write("\r\n"); Color color = scheme.getDefaultBackground(); - if (color==null) color = Color.gray; + if (color==null) color = JBColor.GRAY; writer.write("\r\n"); writer.write("\r\n"); writer.write("
\r\n"); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/CompletionPreview.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/CompletionPreview.java index 889e10756dec..79669c641453 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/CompletionPreview.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/CompletionPreview.java @@ -27,6 +27,7 @@ import com.intellij.openapi.editor.markup.HighlighterTargetArea; import com.intellij.openapi.editor.markup.RangeHighlighter; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.util.Disposer; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.Nullable; import java.awt.*; @@ -65,7 +66,7 @@ public class CompletionPreview { }, "preview"); final RangeHighlighter highlighter = myLookup.getEditor().getMarkupModel() .addRangeHighlighter(caret, previewEnd, HighlighterLayer.LAST, - new TextAttributes(Color.GRAY, null, null, null, Font.PLAIN), + new TextAttributes(JBColor.GRAY, null, null, null, Font.PLAIN), HighlighterTargetArea.EXACT_RANGE); myUninstaller = new Disposable() { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java index 70a6e6c3dc28..b9eae5413443 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -41,6 +41,7 @@ import com.intellij.openapi.fileEditor.ex.IdeDocumentHistory; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Key; import com.intellij.ui.HintHint; +import com.intellij.ui.JBColor; import com.intellij.ui.LightweightHint; import com.intellij.util.text.StringSearcher; import com.intellij.util.ui.UIUtil; @@ -292,10 +293,10 @@ public class IncrementalSearchHandler { data.segmentHighlighter = null; } if (index < 0) { - data.label.setForeground(Color.red); + data.label.setForeground(JBColor.RED); } else { - data.label.setForeground(Color.black); + data.label.setForeground(JBColor.foreground); if (matchLength > 0) { TextAttributes attributes = editor.getColorsScheme().getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES); data.segmentHighlighter = editor.getMarkupModel() @@ -326,7 +327,7 @@ public class IncrementalSearchHandler { public MyLabel(String text) { super(text); this.setBackground(HintUtil.INFORMATION_COLOR); - this.setForeground(Color.black); + this.setForeground(JBColor.foreground); this.setOpaque(true); } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateSettingsEditor.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateSettingsEditor.java index 0640e7c8c806..c1bb55091ae5 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateSettingsEditor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateSettingsEditor.java @@ -330,7 +330,7 @@ public class LiveTemplateSettingsEditor extends JPanel { } final boolean noContexts = sb.length() == 0; ctxLabel.setText((noContexts ? "No applicable contexts" + (allowNoContexts ? "" : " yet") : "Applicable in " + sb.toString()) + ". "); - ctxLabel.setForeground(noContexts ? allowNoContexts ? Color.GRAY : Color.RED : UIUtil.getLabelForeground()); + ctxLabel.setForeground(noContexts ? allowNoContexts ? JBColor.GRAY : JBColor.RED : UIUtil.getLabelForeground()); change.setText(noContexts ? "Define" : "Change"); } }; diff --git a/platform/lang-impl/src/com/intellij/codeInspection/actions/InspectionListCellRenderer.java b/platform/lang-impl/src/com/intellij/codeInspection/actions/InspectionListCellRenderer.java index 36417036642d..a55828bb0720 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/actions/InspectionListCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/actions/InspectionListCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -21,6 +21,7 @@ import com.intellij.ide.util.gotoByName.ChooseByNameBase; import com.intellij.lang.Language; import com.intellij.openapi.fileTypes.LanguageFileType; import com.intellij.openapi.fileTypes.UnknownFileType; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleColoredComponent; import com.intellij.ui.SimpleTextAttributes; import com.intellij.ui.speedSearch.SpeedSearchUtil; @@ -46,11 +47,11 @@ public class InspectionListCellRenderer extends DefaultListCellRenderer implemen public InspectionListCellRenderer() { SELECTED = new SimpleTextAttributes(UIUtil.getListSelectionBackground(), UIUtil.getListSelectionForeground(), - Color.RED, + JBColor.RED, SimpleTextAttributes.STYLE_PLAIN); PLAIN = new SimpleTextAttributes(UIUtil.getListBackground(), UIUtil.getListForeground(), - Color.RED, + JBColor.RED, SimpleTextAttributes.STYLE_PLAIN); } diff --git a/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreview.java b/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreview.java index 198ee67d27d5..294dc7667874 100644 --- a/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreview.java +++ b/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreview.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -37,6 +37,7 @@ import com.intellij.openapi.ui.popup.BalloonBuilder; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.TextRange; +import com.intellij.ui.JBColor; import com.intellij.ui.awt.RelativePoint; import com.intellij.util.Processor; import com.intellij.util.ui.PositionTracker; @@ -103,7 +104,7 @@ public class LivePreview extends DocumentAdapter implements ReplacementView.Dele return textAttributes; } - private static final TextAttributes OTHER_TARGETS_ATTRIBUTES = new TextAttributes(Color.BLACK, Color.GREEN, null, null, 0); + private static final TextAttributes OTHER_TARGETS_ATTRIBUTES = new TextAttributes(Color.BLACK, JBColor.GREEN, null, null, 0); private Delegate myDelegate; diff --git a/platform/lang-impl/src/com/intellij/find/impl/livePreview/ReplacementView.java b/platform/lang-impl/src/com/intellij/find/impl/livePreview/ReplacementView.java index a4b9b686c844..731fc435cd0d 100644 --- a/platform/lang-impl/src/com/intellij/find/impl/livePreview/ReplacementView.java +++ b/platform/lang-impl/src/com/intellij/find/impl/livePreview/ReplacementView.java @@ -1,5 +1,22 @@ +/* + * Copyright 2000-2012 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.find.impl.livePreview; +import com.intellij.ui.JBColor; + import javax.swing.*; import java.awt.*; @@ -39,7 +56,7 @@ public class ReplacementView extends JPanel { textToShow = MALFORMED_REPLACEMENT_STRING; } JLabel jLabel = new JLabel(textToShow); - jLabel.setForeground(myReplacement != null ? Color.WHITE : Color.RED); + jLabel.setForeground(myReplacement != null ? Color.WHITE : JBColor.RED); add(jLabel); } } diff --git a/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedFileAction.java b/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedFileAction.java index 8cb5b19d5af7..13f40b0fe953 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedFileAction.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedFileAction.java @@ -30,11 +30,13 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.ui.ColoredListCellRenderer; +import com.intellij.ui.JBColor; import com.intellij.ui.SeparatorWithText; import com.intellij.ui.SimpleTextAttributes; import com.intellij.ui.popup.list.ListPopupImpl; import com.intellij.ui.popup.list.PopupListElementRenderer; import com.intellij.util.Processor; +import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -230,7 +232,7 @@ public class GotoRelatedFileAction extends AnAction { final SeparatorWithText sep = new SeparatorWithText() { @Override protected void paintComponent(Graphics g) { - g.setColor(Color.WHITE); + g.setColor(new JBColor(Color.WHITE, UIUtil.getSeparatorColor())); g.fillRect(0,0,getWidth(), getHeight()); super.paintComponent(g); } diff --git a/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java b/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java index 152c5b74528e..6750746fbe91 100644 --- a/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java +++ b/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -40,6 +40,7 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiManager; +import com.intellij.ui.JBColor; import com.intellij.ui.LightColors; import com.intellij.util.PlatformIcons; import com.intellij.util.Processor; @@ -236,7 +237,7 @@ public class Bookmark { g.setColor(LightColors.YELLOW); g.fillRect(x, y, getIconWidth(), getIconHeight()); - g.setColor(Color.gray); + g.setColor(JBColor.GRAY); g.drawRect(x, y, getIconWidth(), getIconHeight()); g.setColor(Color.black); diff --git a/platform/lang-impl/src/com/intellij/ide/hierarchy/HierarchyTreeStructure.java b/platform/lang-impl/src/com/intellij/ide/hierarchy/HierarchyTreeStructure.java index 34582645d816..d3ab11c3e3e0 100644 --- a/platform/lang-impl/src/com/intellij/ide/hierarchy/HierarchyTreeStructure.java +++ b/platform/lang-impl/src/com/intellij/ide/hierarchy/HierarchyTreeStructure.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -34,11 +34,10 @@ import com.intellij.psi.search.scope.packageSet.NamedScopeManager; import com.intellij.psi.search.scope.packageSet.NamedScopesHolder; import com.intellij.psi.search.scope.packageSet.PackageSet; import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.ui.JBColor; import com.intellij.util.ArrayUtil; import org.jetbrains.annotations.NotNull; -import java.awt.*; - public abstract class HierarchyTreeStructure extends AbstractTreeStructure { protected HierarchyNodeDescriptor myBaseDescriptor; private HierarchyNodeDescriptor myRoot; @@ -193,7 +192,7 @@ public abstract class HierarchyTreeStructure extends AbstractTreeStructure { public TextInfoNodeDescriptor(final NodeDescriptor parentDescriptor, final String text, final Project project) { super(project, parentDescriptor); myName = text; - myColor = Color.red; + myColor = JBColor.RED; } @Override diff --git a/platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarListCellRenderer.java b/platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarListCellRenderer.java index 9a23eee09bc5..0d112ef663ac 100644 --- a/platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarListCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarListCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -27,6 +27,7 @@ import com.intellij.problems.WolfTheProblemSolver; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.ui.ColoredListCellRenderer; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.ui.UIUtil; @@ -83,7 +84,7 @@ public class NavBarListCellRenderer extends ColoredListCellRenderer { } final SimpleTextAttributes nameAttributes; if (isProblemFile) { - TextAttributes attributes = new TextAttributes(color, null, Color.red, EffectType.WAVE_UNDERSCORE, Font.PLAIN); + TextAttributes attributes = new TextAttributes(color, null, JBColor.RED, EffectType.WAVE_UNDERSCORE, Font.PLAIN); nameAttributes = SimpleTextAttributes.fromTextAttributes(attributes); } else { diff --git a/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoConfigurable.java b/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoConfigurable.java index 45163380248e..a788930f6039 100644 --- a/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoConfigurable.java +++ b/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoConfigurable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -409,7 +409,7 @@ public class TodoConfigurable extends BaseConfigurable implements SearchableConf } else { if (filter.isEmpty()) { - setForeground(Color.RED); + setForeground(JBColor.RED); } else { setForeground(UIUtil.getTableForeground()); diff --git a/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoPatternTableCellRenderer.java b/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoPatternTableCellRenderer.java index c33eb284ff81..00c494466cef 100644 --- a/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoPatternTableCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoPatternTableCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -17,12 +17,12 @@ package com.intellij.ide.todo.configurable; import com.intellij.psi.search.TodoPattern; +import com.intellij.ui.JBColor; import com.intellij.util.ui.UIUtil; import javax.swing.*; import javax.swing.table.DefaultTableCellRenderer; import java.awt.*; -import java.util.*; import java.util.List; final class TodoPatternTableCellRenderer extends DefaultTableCellRenderer{ @@ -46,7 +46,7 @@ final class TodoPatternTableCellRenderer extends DefaultTableCellRenderer{ setForeground(UIUtil.getTableSelectionForeground()); }else{ if(pattern.getPattern()==null){ - setForeground(Color.RED); + setForeground(JBColor.RED); }else{ setForeground(UIUtil.getTableForeground()); } diff --git a/platform/lang-impl/src/com/intellij/ide/util/NavigationItemListCellRenderer.java b/platform/lang-impl/src/com/intellij/ide/util/NavigationItemListCellRenderer.java index 60f82651e3e1..856bea808f13 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/NavigationItemListCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/util/NavigationItemListCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -34,6 +34,7 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.util.PsiUtilBase; import com.intellij.ui.ColoredListCellRenderer; import com.intellij.ui.FileColorManager; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import com.intellij.ui.components.panels.NonOpaquePanel; import com.intellij.ui.components.panels.OpaquePanel; @@ -185,7 +186,7 @@ public class NavigationItemListCellRenderer extends OpaquePanel implements ListC String containerText = presentation.getLocationString(); if (containerText != null && containerText.length() > 0) { - append(" " + containerText, new SimpleTextAttributes(Font.PLAIN, Color.GRAY)); + append(" " + containerText, new SimpleTextAttributes(Font.PLAIN, JBColor.GRAY)); } } } diff --git a/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java b/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java index d80183136ffd..ebbbb5bddb88 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -32,10 +32,7 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.problems.WolfTheProblemSolver; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; -import com.intellij.ui.ColoredListCellRenderer; -import com.intellij.ui.FileColorManager; -import com.intellij.ui.ListSpeedSearch; -import com.intellij.ui.SimpleTextAttributes; +import com.intellij.ui.*; import com.intellij.ui.speedSearch.SpeedSearchUtil; import com.intellij.util.Function; import com.intellij.util.IconUtil; @@ -120,7 +117,7 @@ public abstract class PsiElementListCellRenderer extends J TextAttributes attributes = getNavigationItemAttributes(value); if (isProblemFile) { - attributes = TextAttributes.merge(new TextAttributes(color, null, Color.red, EffectType.WAVE_UNDERSCORE, Font.PLAIN), attributes); + attributes = TextAttributes.merge(new TextAttributes(color, null, JBColor.RED, EffectType.WAVE_UNDERSCORE, Font.PLAIN), attributes); } SimpleTextAttributes nameAttributes = attributes != null ? SimpleTextAttributes.fromTextAttributes(attributes) : null; @@ -137,7 +134,7 @@ public abstract class PsiElementListCellRenderer extends J String containerText = getContainerText(element, name + (myModuleName != null ? myModuleName + " " : "")); if (containerText != null) { - append(" " + containerText, new SimpleTextAttributes(Font.PLAIN, Color.GRAY)); + append(" " + containerText, new SimpleTextAttributes(Font.PLAIN, JBColor.GRAY)); } } else if (!customizeNonPsiElementLeftRenderer(this, list, value, index, selected, hasFocus)) { diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java index ed530cdff082..08e84da01b57 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -31,6 +31,7 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiFile; import com.intellij.ui.ColoredListCellRenderer; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.ui.FilePathSplittingPolicy; import org.jetbrains.annotations.Nullable; @@ -125,7 +126,7 @@ public class GotoFileCellRenderer extends PsiElementListCellRenderer { assert itemPresentation != null; renderer.setIcon(itemPresentation.getIcon(true)); - renderer.append(itemPresentation.getLocationString(), new SimpleTextAttributes(Font.PLAIN, Color.GRAY)); + renderer.append(itemPresentation.getLocationString(), new SimpleTextAttributes(Font.PLAIN, JBColor.GRAY)); return true; } diff --git a/platform/lang-impl/src/com/intellij/internal/psiView/PsiViewerDialog.java b/platform/lang-impl/src/com/intellij/internal/psiView/PsiViewerDialog.java index 9544fb454a90..cba6aabbd551 100644 --- a/platform/lang-impl/src/com/intellij/internal/psiView/PsiViewerDialog.java +++ b/platform/lang-impl/src/com/intellij/internal/psiView/PsiViewerDialog.java @@ -289,7 +289,7 @@ public class PsiViewerDialog extends DialogWrapper implements DataProvider, Disp public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { final Component comp = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (resolve(index) == null) { - comp.setForeground(Color.red); + comp.setForeground(JBColor.RED); } return comp; } @@ -1126,7 +1126,7 @@ public class PsiViewerDialog extends DialogWrapper implements DataProvider, Disp private class GoToListener implements KeyListener, MouseListener, ListSelectionListener { private RangeHighlighter myListenerHighlighter; private final TextAttributes myAttributes = - new TextAttributes(Color.white, SELECTION_BG_COLOR, Color.red, EffectType.BOXED, Font.PLAIN); + new TextAttributes(Color.white, SELECTION_BG_COLOR, JBColor.RED, EffectType.BOXED, Font.PLAIN); private void navigate() { final Object value = myRefs.getSelectedValue(); diff --git a/platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubProjectGeneratorPeer.java b/platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubProjectGeneratorPeer.java index a57bd7c97c81..5294cc657a60 100644 --- a/platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubProjectGeneratorPeer.java +++ b/platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubProjectGeneratorPeer.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2012 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.lang.javascript.boilerplate; import com.google.common.collect.ImmutableCollection; @@ -13,6 +28,7 @@ import com.intellij.openapi.ui.ValidationInfo; import com.intellij.openapi.util.text.StringUtil; import com.intellij.platform.WebProjectGenerator; import com.intellij.platform.templates.github.GithubTagInfo; +import com.intellij.ui.JBColor; import com.intellij.ui.ListCellRendererWrapper; import com.intellij.util.ObjectUtils; import com.intellij.util.containers.ContainerUtil; @@ -51,7 +67,7 @@ public class GithubProjectGeneratorPeer implements WebProjectGenerator.Generator private UpdateStatus myUpdateStatus; public GithubProjectGeneratorPeer(@NotNull AbstractGithubTagDownloadedProjectGenerator generator) { - myErrorMessage.setForeground(Color.RED); + myErrorMessage.setForeground(JBColor.RED); String ghUserName = generator.getGithubUserName(); String ghRepoName = generator.getGithubRepositoryName(); myMasterTag = new GithubTagInfo( diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeCellRenderer.java b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeCellRenderer.java index f69746814374..267755b7948c 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeCellRenderer.java @@ -25,6 +25,7 @@ import com.intellij.openapi.roots.ExcludeFolder; import com.intellij.openapi.roots.SourceFolder; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import org.jetbrains.annotations.NotNull; @@ -55,7 +56,7 @@ public class ContentEntryTreeCellRenderer extends NodeRenderer { if (contentEntry != null) { final String prefix = getPrefix(contentEntry, file); if (!prefix.isEmpty()) { - append(" (" + prefix + ")", new SimpleTextAttributes(Font.PLAIN, Color.GRAY)); + append(" (" + prefix + ")", new SimpleTextAttributes(Font.PLAIN, JBColor.GRAY)); } setIcon(updateIcon(contentEntry, file, getIcon())); } diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentRootPanel.java b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentRootPanel.java index a9ec517fd47d..be14b1e28bb9 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentRootPanel.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentRootPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -30,6 +30,7 @@ import com.intellij.openapi.vfs.VirtualFileManager; import com.intellij.ui.DarculaColors; import com.intellij.ui.Gray; import com.intellij.ui.HoverHyperlinkLabel; +import com.intellij.ui.JBColor; import com.intellij.ui.roots.FilePathClipper; import com.intellij.ui.roots.IconActionComponent; import com.intellij.ui.roots.ResizingWrapper; @@ -54,14 +55,14 @@ import java.util.Map; * Date: Jan 19, 2004 */ public abstract class ContentRootPanel extends JPanel { - protected static final Color SOURCES_COLOR = UIUtil.isUnderDarcula() ? DarculaColors.BLUE : new Color(0x0A50A1); + protected static final Color SOURCES_COLOR = new JBColor(new Color(0x0A50A1), DarculaColors.BLUE); protected static final Color TESTS_COLOR = new Color(0x008C2E); - protected static final Color EXCLUDED_COLOR = UIUtil.isUnderDarcula() ? DarculaColors.RED : new Color(0x992E00); - private static final Color SELECTED_HEADER_COLOR = UIUtil.isUnderDarcula() ? UIUtil.getPanelBackground().darker() : new Color(0xDEF2FF); - private static final Color HEADER_COLOR = UIUtil.isUnderDarcula() ? Gray._82 : new Color(0xF5F5F5); + protected static final Color EXCLUDED_COLOR = new JBColor(new Color(0x992E00), DarculaColors.RED); + private static final Color SELECTED_HEADER_COLOR = new JBColor(new Color(0xDEF2FF), UIUtil.getPanelBackground().darker()); + private static final Color HEADER_COLOR = new JBColor(new Color(0xF5F5F5), Gray._82); private static final Color SELECTED_CONTENT_COLOR = new Color(0xF0F9FF); - private static final Color CONTENT_COLOR = UIUtil.isUnderDarcula() ? UIUtil.getPanelBackground() : Color.WHITE; - private static final Color UNSELECTED_TEXT_COLOR = new Color(0x333333); + private static final Color CONTENT_COLOR = new JBColor(Color.WHITE, UIUtil.getPanelBackground()); + private static final Color UNSELECTED_TEXT_COLOR = Gray._51; protected final ActionCallback myCallback; private JComponent myHeader; @@ -346,7 +347,7 @@ public abstract class ContentRootPanel extends JPanel { private static class UnderlinedPathLabel extends ResizingWrapper { private static final float[] DASH = {0, 2, 0, 2}; - private static final Color DASH_LINE_COLOR = UIUtil.isUnderDarcula() ? Gray._100 : new Color(0xC9C9C9); + private static final Color DASH_LINE_COLOR = new JBColor(Gray._201, Gray._100); public UnderlinedPathLabel(JLabel wrappedComponent) { super(wrappedComponent); diff --git a/platform/lang-impl/src/com/intellij/openapi/util/objectTree/DisposerDebugger.java b/platform/lang-impl/src/com/intellij/openapi/util/objectTree/DisposerDebugger.java index 388d8cbc8f58..c098cf1cdd7b 100644 --- a/platform/lang-impl/src/com/intellij/openapi/util/objectTree/DisposerDebugger.java +++ b/platform/lang-impl/src/com/intellij/openapi/util/objectTree/DisposerDebugger.java @@ -29,6 +29,7 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.ide.CopyPasteManager; import com.intellij.openapi.ui.Splitter; import com.intellij.openapi.util.Disposer; +import com.intellij.ui.JBColor; import com.intellij.util.ui.TextTransferrable; import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.debugger.UiDebuggerExtension; @@ -393,7 +394,7 @@ public class DisposerDebugger implements UiDebuggerExtension, Disposable { presentation.setPresentableText(objectString); if (getValue().getOwnModification() < myTree.myModificationToFilter) { - presentation.setForcedTextForeground(Color.gray); + presentation.setForcedTextForeground(JBColor.GRAY); } if (objectString != null) { diff --git a/platform/lang-impl/src/com/intellij/openapi/vcs/changes/ui/WolfChangesFileNameDecorator.java b/platform/lang-impl/src/com/intellij/openapi/vcs/changes/ui/WolfChangesFileNameDecorator.java index eb08dbb6f784..95a1fa7f131f 100644 --- a/platform/lang-impl/src/com/intellij/openapi/vcs/changes/ui/WolfChangesFileNameDecorator.java +++ b/platform/lang-impl/src/com/intellij/openapi/vcs/changes/ui/WolfChangesFileNameDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -18,6 +18,7 @@ package com.intellij.openapi.vcs.changes.ui; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.problems.WolfTheProblemSolver; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import java.awt.*; @@ -37,7 +38,7 @@ public class WolfChangesFileNameDecorator extends ChangesFileNameDecorator { int style = SimpleTextAttributes.STYLE_PLAIN; Color underlineColor = null; if (highlightProblems && vFile != null && !vFile.isDirectory() && myProblemSolver.isProblemFile(vFile)) { - underlineColor = Color.red; + underlineColor = JBColor.RED; style = SimpleTextAttributes.STYLE_WAVED; } renderer.append(fileName, new SimpleTextAttributes(style, color, underlineColor)); diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java index 4f49e2305343..74a35076e48b 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java @@ -27,6 +27,7 @@ import com.intellij.codeInspection.ex.GlobalInspectionToolWrapper; import com.intellij.codeInspection.ex.LocalInspectionToolWrapper; import com.intellij.ide.ui.search.SearchUtil; import com.intellij.ui.CheckboxTree; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.ui.PlatformColors; import com.intellij.util.ui.UIUtil; @@ -73,7 +74,7 @@ abstract class InspectionsConfigTreeRenderer extends CheckboxTree.CheckboxTreeCe else { text = "In scope \'" + scopeName + "\'"; if (node.getScope() == null) { - foreground = Color.RED; + foreground = JBColor.RED; } } } else { diff --git a/platform/lang-impl/src/com/intellij/refactoring/ui/AbstractMemberSelectionTable.java b/platform/lang-impl/src/com/intellij/refactoring/ui/AbstractMemberSelectionTable.java index c470967c1a66..edc2266388b9 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/ui/AbstractMemberSelectionTable.java +++ b/platform/lang-impl/src/com/intellij/refactoring/ui/AbstractMemberSelectionTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -364,10 +364,10 @@ public abstract class AbstractMemberSelectionTable required = myDependentToRequiredListMap.get(pluginId); if (required != null && required.size() > 0) { - myNameLabel.setForeground(Color.RED); + myNameLabel.setForeground(JBColor.RED); final StringBuilder s = new StringBuilder(); if (myEnabled.get(pluginId) == null) { @@ -621,7 +622,7 @@ public class InstalledPluginsTableModel extends PluginTableModel { if (PluginManager.isIncompatible(myPluginDescriptor)) { myPanel.setToolTipText( IdeBundle.message("plugin.manager.incompatible.tooltip.warning", ApplicationNamesInfo.getInstance().getFullProductName())); - myNameLabel.setForeground(Color.red); + myNameLabel.setForeground(JBColor.RED); } } diff --git a/platform/platform-impl/src/com/intellij/ide/ui/search/SearchUtil.java b/platform/platform-impl/src/com/intellij/ide/ui/search/SearchUtil.java index 93160c5af232..337f3975483b 100644 --- a/platform/platform-impl/src/com/intellij/ide/ui/search/SearchUtil.java +++ b/platform/platform-impl/src/com/intellij/ide/ui/search/SearchUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -421,7 +421,7 @@ public class SearchUtil { final SimpleColoredComponent textRenderer) { if (text == null) return; if (filter == null || filter.length() == 0) { - textRenderer.append(text, new SimpleTextAttributes(background, foreground, Color.RED, style)); + textRenderer.append(text, new SimpleTextAttributes(background, foreground, JBColor.RED, style)); } else { //markup final HashSet quoted = new HashSet(); diff --git a/platform/platform-impl/src/com/intellij/internal/focus/FocusDebuggerAction.java b/platform/platform-impl/src/com/intellij/internal/focus/FocusDebuggerAction.java index 2fb19fadea97..22fdd346d80c 100644 --- a/platform/platform-impl/src/com/intellij/internal/focus/FocusDebuggerAction.java +++ b/platform/platform-impl/src/com/intellij/internal/focus/FocusDebuggerAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -20,6 +20,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.DumbAware; +import com.intellij.ui.JBColor; import com.intellij.util.ui.UIUtil; import java.awt.*; @@ -93,7 +94,7 @@ public class FocusDebuggerAction extends AnAction implements DumbAware { myCurrent.repaint(); } } else { - currentFocusGraphics.setColor(myTemporary ? Color.ORANGE : Color.GREEN); + currentFocusGraphics.setColor(myTemporary ? JBColor.ORANGE : JBColor.GREEN); UIUtil.drawDottedRectangle(currentFocusGraphics, 1, 1, myCurrent.getSize().width - 2, myCurrent.getSize().height - 2); } } @@ -107,7 +108,7 @@ public class FocusDebuggerAction extends AnAction implements DumbAware { myPrevious.repaint(); } } else { - previousFocusGraphics.setColor(Color.RED); + previousFocusGraphics.setColor(JBColor.RED); UIUtil.drawDottedRectangle(previousFocusGraphics, 1, 1, myPrevious.getSize().width - 2, myPrevious.getSize().height - 2); } } diff --git a/platform/platform-impl/src/com/intellij/internal/focus/FocusTracesDialog.java b/platform/platform-impl/src/com/intellij/internal/focus/FocusTracesDialog.java index b44576067612..2e676d0edd6c 100644 --- a/platform/platform-impl/src/com/intellij/internal/focus/FocusTracesDialog.java +++ b/platform/platform-impl/src/com/intellij/internal/focus/FocusTracesDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -19,6 +19,7 @@ import com.intellij.openapi.ide.CopyPasteManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.wm.impl.FocusRequestInfo; +import com.intellij.ui.JBColor; import com.intellij.ui.table.JBTable; import com.intellij.util.ui.UIUtil; @@ -145,7 +146,7 @@ public class FocusTracesDialog extends DialogWrapper { prev = info.getComponent(); if (prev != null && prev.isDisplayable()) { final Graphics g = prev.getGraphics(); - g.setColor(Color.RED); + g.setColor(JBColor.RED); final Dimension sz = prev.getSize(); UIUtil.drawDottedRectangle(g, 1, 1, sz.width - 2, sz.height - 2); } diff --git a/platform/platform-impl/src/com/intellij/notification/EventLogConsole.java b/platform/platform-impl/src/com/intellij/notification/EventLogConsole.java index 2648ff15f076..272f80f164ef 100644 --- a/platform/platform-impl/src/com/intellij/notification/EventLogConsole.java +++ b/platform/platform-impl/src/com/intellij/notification/EventLogConsole.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -17,7 +17,6 @@ package com.intellij.notification; import com.intellij.execution.filters.HyperlinkInfo; import com.intellij.execution.impl.ConsoleViewUtil; -import com.intellij.execution.impl.EditorCopyAction; import com.intellij.execution.impl.EditorHyperlinkSupport; import com.intellij.execution.ui.ConsoleViewContentType; import com.intellij.notification.impl.NotificationsManagerImpl; @@ -39,6 +38,7 @@ import com.intellij.openapi.util.NotNullLazyValue; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.TextRange; import com.intellij.openapi.util.text.StringUtil; +import com.intellij.ui.JBColor; import com.intellij.ui.awt.RelativePoint; import com.intellij.util.EditorPopupHandler; import com.intellij.util.text.DateFormatUtil; @@ -48,7 +48,7 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; import java.awt.event.MouseEvent; -import java.util.*; +import java.util.ArrayList; import java.util.List; /** @@ -172,8 +172,8 @@ class EventLogConsole { for (int line = line1; line < line2; line++) { final RangeHighlighter lineHighlighter = markupModel.addLineHighlighter(line, HighlighterLayer.CARET_ROW + 1, bold); Color color = notification.getType() == NotificationType.ERROR - ? Color.red - : notification.getType() == NotificationType.WARNING ? Color.yellow : Color.green; + ? JBColor.RED + : notification.getType() == NotificationType.WARNING ? JBColor.YELLOW : JBColor.GREEN; lineHighlighter.setErrorStripeMarkColor(color); lineHighlighter.setErrorStripeTooltip(message); lineColors.add(lineHighlighter); diff --git a/platform/platform-impl/src/com/intellij/openapi/diff/impl/CaptionIcon.java b/platform/platform-impl/src/com/intellij/openapi/diff/impl/CaptionIcon.java index 5a027799a2be..388341394c47 100644 --- a/platform/platform-impl/src/com/intellij/openapi/diff/impl/CaptionIcon.java +++ b/platform/platform-impl/src/com/intellij/openapi/diff/impl/CaptionIcon.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -16,6 +16,7 @@ package com.intellij.openapi.diff.impl; import com.intellij.openapi.ui.GraphicsConfig; +import com.intellij.ui.JBColor; import com.intellij.util.ui.GraphicsUtil; import com.intellij.util.ui.UIUtil; @@ -102,7 +103,7 @@ public class CaptionIcon implements Icon { @Override public void draw(Component c, Graphics2D g, int width, int height, int x, int y, boolean withPlus, boolean emphasize) { g.fillRect(x + 2, y, width, height); - g.setColor(UIUtil.isUnderDarcula() ? Color.gray.darker() : Color.gray); + g.setColor(new JBColor(Color.gray, Color.gray.darker())); g.drawRect(x + 2, y, width, height - 1); } }, @@ -112,7 +113,7 @@ public class CaptionIcon implements Icon { g.fillRoundRect(x + 2, y, width, height, 5, 5); final BasicStroke stroke = new BasicStroke(1); - g.setColor(UIUtil.isUnderDarcula() ? Color.gray.darker() : Color.gray); + g.setColor(new JBColor(Color.gray, Color.gray.darker())); g.setStroke(stroke); g.drawRoundRect(x + 2, y, width, height - 1, 5, 5); } diff --git a/platform/platform-impl/src/com/intellij/openapi/diff/impl/DiffPanelImpl.java b/platform/platform-impl/src/com/intellij/openapi/diff/impl/DiffPanelImpl.java index c6aa8bfb3522..1a0d573c32ae 100644 --- a/platform/platform-impl/src/com/intellij/openapi/diff/impl/DiffPanelImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/diff/impl/DiffPanelImpl.java @@ -58,6 +58,7 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.pom.Navigatable; import com.intellij.ui.EditorNotificationPanel; +import com.intellij.ui.JBColor; import com.intellij.ui.PopupHandler; import com.intellij.ui.border.CustomLineBorder; import com.intellij.ui.components.JBLabel; @@ -545,7 +546,7 @@ public class DiffPanelImpl implements DiffPanelEx, ContentChangeListener, TwoSid static JComponent createComponentForTitle(@Nullable String title, @NotNull final LineSeparator separator, boolean left) { JPanel bottomPanel = new JPanel(new BorderLayout()); JLabel sepLabel = new JLabel(separator.name()); - sepLabel.setForeground(separator.equals(LineSeparator.CRLF) ? Color.RED : PlatformColors.BLUE); + sepLabel.setForeground(separator.equals(LineSeparator.CRLF) ? JBColor.RED : PlatformColors.BLUE); bottomPanel.add(sepLabel, left ? BorderLayout.EAST : BorderLayout.WEST); JPanel panel = new JPanel(new BorderLayout()); diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java index 5647af2f72e3..284647a5d455 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java @@ -29,10 +29,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.ui.ColoredTreeCellRenderer; -import com.intellij.ui.Gray; -import com.intellij.ui.LayeredIcon; -import com.intellij.ui.ScrollPaneFactory; +import com.intellij.ui.*; import com.intellij.ui.treeStructure.Tree; import com.intellij.ui.treeStructure.treetable.TreeTableModel; import com.intellij.util.ui.EmptyIcon; @@ -512,7 +509,7 @@ public class ActionsTree { } if (bound) { - foreground = Color.MAGENTA; + foreground = JBColor.MAGENTA; } } SearchUtil.appendFragments(myFilter, text, Font.PLAIN, foreground, diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeyboardShortcutDialog.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeyboardShortcutDialog.java index 6c29c5f795d7..de4f4900bf38 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeyboardShortcutDialog.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeyboardShortcutDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -28,6 +28,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; import com.intellij.ui.IdeBorderFactory; +import com.intellij.ui.JBColor; import com.intellij.ui.ScrollPaneFactory; import com.intellij.util.ArrayUtil; import com.intellij.util.ui.UIUtil; @@ -207,7 +208,7 @@ public class KeyboardShortcutDialog extends DialogWrapper { myConflictInfoArea.setText(KeyMapBundle.message("no.conflict.info.message")); } else { - myConflictInfoArea.setForeground(Color.red); + myConflictInfoArea.setForeground(JBColor.RED); if (loaded) { myConflictInfoArea.setText(KeyMapBundle.message("assigned.to.info.message", buffer.toString())); } else { diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/MouseShortcutDialog.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/MouseShortcutDialog.java index 3f09ea6ce5dc..91e7878b8cd5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/MouseShortcutDialog.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/MouseShortcutDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -23,6 +23,7 @@ import com.intellij.openapi.keymap.Keymap; import com.intellij.openapi.keymap.KeymapUtil; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.ui.IdeBorderFactory; +import com.intellij.ui.JBColor; import com.intellij.ui.ScrollPaneFactory; import com.intellij.util.ui.UIUtil; import org.intellij.lang.annotations.JdkConstants; @@ -258,7 +259,7 @@ class MouseShortcutDialog extends DialogWrapper{ myTarConflicts.setText(KeyMapBundle.message("mouse.shortcut.dialog.no.conflicts.area")); } else { - myTarConflicts.setForeground(Color.red); + myTarConflicts.setForeground(JBColor.RED); myTarConflicts.setText(KeyMapBundle.message("mouse.shortcut.dialog.assigned.to.area", buffer.toString())); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/FloatingDecorator.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/FloatingDecorator.java index 35d20e2b4732..9e8e9e7b5512 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/FloatingDecorator.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/FloatingDecorator.java @@ -323,7 +323,7 @@ public final class FloatingDecorator extends JDialog{ g.setColor(lightGray); UIUtil.drawLine(g, 0, 0, getWidth() - 1, 0); UIUtil.drawLine(g, 0, 0, 0, getHeight() - 1); - g.setColor(Color.gray); + g.setColor(JBColor.GRAY); UIUtil.drawLine(g, getWidth() - 1, 0, getWidth() - 1, getHeight() - 1); } else if(ANCHOR_LEFT==myAnchor){ g.setColor(lightGray); diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeRootPane.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeRootPane.java index 91f14a96817b..50a0e0cce665 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeRootPane.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeRootPane.java @@ -37,10 +37,10 @@ import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.wm.*; import com.intellij.openapi.wm.impl.status.IdeStatusBarImpl; import com.intellij.openapi.wm.impl.status.MemoryUsagePanel; +import com.intellij.ui.JBColor; import com.intellij.ui.PopupHandler; import com.intellij.ui.components.JBPanel; import com.intellij.util.IconUtil; -import com.intellij.util.PlatformUtils; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; @@ -169,7 +169,7 @@ public class IdeRootPane extends JRootPane implements UISettingsListener { if (UIUtil.isUnderDarcula()) { myContentPane.setBackgroundImage(BG); } - myContentPane.setBackground(Color.GRAY); + myContentPane.setBackground(JBColor.GRAY); return myContentPane; } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/StatusPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/StatusPanel.java index 9a403bc24c09..da086cb56d32 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/StatusPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/StatusPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -27,6 +27,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.wm.IdeFrame; import com.intellij.openapi.wm.WindowManager; import com.intellij.ui.ClickListener; +import com.intellij.ui.JBColor; import com.intellij.util.Alarm; import com.intellij.util.text.DateFormatUtil; import org.jetbrains.annotations.Nullable; @@ -118,7 +119,7 @@ class StatusPanel extends JPanel { JPanel panel = new JPanel(); panel.setOpaque(isOpaque()); JLabel label = new JLabel("aaa"); - label.setBackground(Color.yellow); + label.setBackground(JBColor.YELLOW); add(panel, BorderLayout.CENTER); } diff --git a/platform/util/src/com/intellij/util/ui/PlatformColors.java b/platform/util/src/com/intellij/util/ui/PlatformColors.java index c76c437e7429..2515a79151cf 100644 --- a/platform/util/src/com/intellij/util/ui/PlatformColors.java +++ b/platform/util/src/com/intellij/util/ui/PlatformColors.java @@ -15,7 +15,7 @@ */ package com.intellij.util.ui; -import com.intellij.ui.DarculaColors; +import com.intellij.ui.JBColor; import java.awt.*; @@ -23,5 +23,5 @@ import java.awt.*; * @author Konstantin Bulenkov */ public class PlatformColors { - public static final Color BLUE = UIUtil.isUnderDarcula() ? DarculaColors.BLUE : Color.BLUE; + public static final Color BLUE = JBColor.BLUE; } diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index 05154578cd06..862abad23f79 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -188,7 +188,7 @@ public class UIUtil { public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics g2 = g.create(); try { - g2.setColor(Color.RED); + g2.setColor(JBColor.RED); drawDottedRectangle(g2, x, y, x + width - 1, y + height - 1); } finally { diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/AbstractValueHint.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/AbstractValueHint.java index 86a1c5b4b95d..fc7d5af71490 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/AbstractValueHint.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/AbstractValueHint.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -61,8 +61,8 @@ public abstract class AbstractValueHint { }; private static final TextAttributes ourReferenceAttributes = new TextAttributes(); static { - ourReferenceAttributes.setForegroundColor(Color.blue); - ourReferenceAttributes.setEffectColor(Color.blue); + ourReferenceAttributes.setForegroundColor(JBColor.BLUE); + ourReferenceAttributes.setEffectColor(JBColor.BLUE); ourReferenceAttributes.setEffectType(EffectType.LINE_UNDERSCORE); } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/ValueMarkerPresentationDialogBase.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/ValueMarkerPresentationDialogBase.java index 3633c553e57e..8bb4327e36ff 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/ValueMarkerPresentationDialogBase.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/ValueMarkerPresentationDialogBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -17,10 +17,7 @@ package com.intellij.xdebugger.impl.ui.tree; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.ui.FixedSizeButton; -import com.intellij.ui.ColorChooser; -import com.intellij.ui.DocumentAdapter; -import com.intellij.ui.SimpleColoredComponent; -import com.intellij.ui.SimpleTextAttributes; +import com.intellij.ui.*; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -33,7 +30,7 @@ import java.awt.event.ActionListener; * @author nik */ public abstract class ValueMarkerPresentationDialogBase extends DialogWrapper { - private static final Color DEFAULT_COLOR = Color.RED; + private static final Color DEFAULT_COLOR = JBColor.RED; private SimpleColoredComponent myColorSample; private Color myColor; private JPanel myMainPanel; diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/telemetry/TelemetryToolWindow.java b/plugins/InspectionGadgets/src/com/siyeh/ig/telemetry/TelemetryToolWindow.java index e479011f60b1..e91c34897eb4 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/telemetry/TelemetryToolWindow.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/telemetry/TelemetryToolWindow.java @@ -22,6 +22,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.wm.ToolWindow; import com.intellij.openapi.wm.ToolWindowAnchor; import com.intellij.openapi.wm.ToolWindowManager; +import com.intellij.ui.JBColor; import com.intellij.ui.content.Content; import com.intellij.ui.content.ContentFactory; import com.intellij.ui.content.ContentManager; @@ -50,7 +51,7 @@ public class TelemetryToolWindow { actionManager.createActionToolbar(TOOL_WINDOW_ID, toolbarGroup, true); contentPanel = new JPanel(new BorderLayout()); - contentPanel.setBackground(Color.gray); + contentPanel.setBackground(JBColor.GRAY); final JComponent toolbarComponent = toolbar.getComponent(); contentPanel.add(toolbarComponent, BorderLayout.NORTH); final JComponent displayContentPane = telemetryDisplay.getContentPane(); diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/AndroidDesignerEditorPanel.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/AndroidDesignerEditorPanel.java index d4c58e8b4a1e..3b273397f790 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/AndroidDesignerEditorPanel.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/AndroidDesignerEditorPanel.java @@ -62,7 +62,6 @@ import com.intellij.util.Alarm; import com.intellij.util.PsiNavigateUtil; import com.intellij.util.ThrowableConsumer; import com.intellij.util.ThrowableRunnable; -import com.intellij.util.ui.UIUtil; import org.jetbrains.android.actions.RunAndroidAvdManagerAction; import org.jetbrains.android.facet.AndroidFacet; import org.jetbrains.android.maven.AndroidMavenUtil; @@ -240,7 +239,7 @@ public final class AndroidDesignerEditorPanel extends DesignerEditorPanel { propertyParser.loadRecursive(newRootComponent); JPanel rootPanel = new JPanel(null); - rootPanel.setBackground(new JBColor(Color.WHITE, UIUtil.getListBackground())); + rootPanel.setBackground(JBColor.WHITE); rootPanel.add(rootView); removeNativeRoot(); diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/DropToOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/DropToOperation.java index 8d0f9bafa479..9380af5457ae 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/DropToOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/DropToOperation.java @@ -19,9 +19,9 @@ import com.intellij.designer.designSurface.FeedbackLayer; import com.intellij.designer.designSurface.OperationContext; import com.intellij.designer.designSurface.feedbacks.AlphaFeedback; import com.intellij.designer.model.RadComponent; +import com.intellij.ui.JBColor; import javax.swing.*; -import java.awt.*; /** * @author Alexander Lobas @@ -38,7 +38,7 @@ public class DropToOperation extends AbstractEditOperation { FeedbackLayer layer = myContext.getArea().getFeedbackLayer(); if (myFeedback == null) { - myFeedback = new AlphaFeedback(Color.green); + myFeedback = new AlphaFeedback(JBColor.GREEN); layer.add(myFeedback); myFeedback.setBounds(myContainer.getBounds(layer)); layer.repaint(); diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/FrameLayoutOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/FrameLayoutOperation.java index 98f0268c94cf..33f33f87db05 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/FrameLayoutOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/FrameLayoutOperation.java @@ -27,6 +27,7 @@ import com.intellij.designer.model.RadComponent; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.Pair; import com.intellij.ui.IdeBorderFactory; +import com.intellij.ui.JBColor; import com.intellij.ui.LightColors; import com.intellij.util.containers.hash.HashSet; import org.jetbrains.annotations.Nullable; @@ -199,7 +200,7 @@ public class FrameLayoutOperation extends AbstractEditOperation { private Gravity myVertical; public GravityFeedback() { - super(Color.green); + super(JBColor.GREEN); } public void setGravity(Gravity horizontal, Gravity vertical) { diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LinearLayoutOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LinearLayoutOperation.java index e15c82f140b5..4aef0d13b75d 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LinearLayoutOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LinearLayoutOperation.java @@ -30,6 +30,7 @@ import com.intellij.openapi.util.Pair; import com.intellij.psi.xml.XmlAttribute; import com.intellij.psi.xml.XmlTag; import com.intellij.ui.IdeBorderFactory; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -223,7 +224,7 @@ public class LinearLayoutOperation extends FlowBaseOperation { protected void paintComponent(Graphics g) { super.paintComponent(g); - g.setColor(Color.magenta); + g.setColor(JBColor.MAGENTA); if (myHorizontal) { paintHorizontalCell(g); diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/RelativeLayoutOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/RelativeLayoutOperation.java index 02593e5c40be..24a0e2f91213 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/RelativeLayoutOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/RelativeLayoutOperation.java @@ -29,6 +29,7 @@ import com.intellij.designer.model.RadComponent; import com.intellij.openapi.application.ApplicationManager; import com.intellij.psi.xml.XmlTag; import com.intellij.ui.IdeBorderFactory; +import com.intellij.ui.JBColor; import java.awt.*; import java.awt.image.BufferedImage; @@ -84,7 +85,7 @@ public class RelativeLayoutOperation extends AbstractEditOperation { if (myContext.isCreate() || myContext.isPaste()) { myBounds = new Rectangle(0, 0, 64, 32); - myBoundsFeedback = new AlphaFeedback(myComponents.size() == 1 ? Color.green : Color.orange); + myBoundsFeedback = new AlphaFeedback(myComponents.size() == 1 ? JBColor.GREEN : JBColor.ORANGE); // XXX } else { @@ -117,7 +118,7 @@ public class RelativeLayoutOperation extends AbstractEditOperation { }; } else { - myBoundsFeedback = new AlphaFeedback(Color.orange); + myBoundsFeedback = new AlphaFeedback(JBColor.ORANGE); } } diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutMarginOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutMarginOperation.java index 9a3e405cfc80..cdfeeec95bc4 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutMarginOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutMarginOperation.java @@ -34,6 +34,7 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.xml.XmlAttribute; import com.intellij.psi.xml.XmlTag; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.Nullable; import java.awt.*; @@ -83,7 +84,7 @@ public class LayoutMarginOperation implements EditOperation { } protected Color getFeedbackColor() { - return Color.orange; + return JBColor.ORANGE; } @Override @@ -195,7 +196,7 @@ public class LayoutMarginOperation implements EditOperation { public static void points(ResizeSelectionDecorator decorator) { pointFeedback(decorator); - decorator.addPoint(new DirectionResizePoint(Color.orange, Color.black, Position.WEST, TYPE, "Change layout:margin.left") { // left + decorator.addPoint(new DirectionResizePoint(JBColor.ORANGE, Color.black, Position.WEST, TYPE, "Change layout:margin.left") { // left @Override protected Point getLocation(DecorationLayer layer, RadComponent component) { Point location = super.getLocation(layer, component); @@ -204,9 +205,9 @@ public class LayoutMarginOperation implements EditOperation { } }); - pointRight(decorator, Color.orange, 0.25, TYPE, "Change layout:margin.right"); + pointRight(decorator, JBColor.ORANGE, 0.25, TYPE, "Change layout:margin.right"); - decorator.addPoint(new DirectionResizePoint(Color.orange, Color.black, Position.NORTH, TYPE, "Change layout:margin.top") { // top + decorator.addPoint(new DirectionResizePoint(JBColor.ORANGE, Color.black, Position.NORTH, TYPE, "Change layout:margin.top") { // top @Override protected Point getLocation(DecorationLayer layer, RadComponent component) { Point location = super.getLocation(layer, component); @@ -215,7 +216,7 @@ public class LayoutMarginOperation implements EditOperation { } }); - pointBottom(decorator, Color.orange, 0.25, TYPE, "Change layout:margin.bottom"); + pointBottom(decorator, JBColor.ORANGE, 0.25, TYPE, "Change layout:margin.bottom"); } public static final BasicStroke STROKE = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{1, 2}, 0); @@ -228,7 +229,7 @@ public class LayoutMarginOperation implements EditOperation { applyMargins(bounds, ((RadViewComponent)component).getMargins()); g.setStroke(STROKE); - g.setColor(Color.red); + g.setColor(JBColor.RED); g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height); } }); diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutSpanOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutSpanOperation.java index fab78f3b1d80..d7fa388229db 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutSpanOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutSpanOperation.java @@ -34,6 +34,7 @@ import com.intellij.designer.model.RadComponent; import com.intellij.designer.utils.Position; import com.intellij.openapi.application.ApplicationManager; import com.intellij.psi.xml.XmlTag; +import com.intellij.ui.JBColor; import com.intellij.util.containers.IntArrayList; import org.jetbrains.annotations.Nullable; @@ -46,7 +47,7 @@ import java.util.List; public abstract class LayoutSpanOperation implements EditOperation { public static final String TYPE = "layout_span"; - protected static final Color COLOR = Color.green.darker(); + protected static final Color COLOR = JBColor.GREEN.darker(); protected final OperationContext myContext; private final GridSelectionDecorator myDecorator; @@ -424,7 +425,7 @@ public abstract class LayoutSpanOperation implements EditOperation { private static class ErrorFeedback extends AlphaFeedback { public ErrorFeedback() { - super(Color.pink); + super(JBColor.PINK); } @Override diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutWeightOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutWeightOperation.java index 207cde3ace2c..0ae721cd9546 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutWeightOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutWeightOperation.java @@ -22,6 +22,7 @@ import com.intellij.designer.designSurface.selection.ResizeSelectionDecorator; import com.intellij.designer.model.RadComponent; import com.intellij.designer.utils.Position; import com.intellij.openapi.application.ApplicationManager; +import com.intellij.ui.JBColor; import java.awt.*; import java.text.DecimalFormat; @@ -52,7 +53,7 @@ public class LayoutWeightOperation extends LayoutMarginOperation { @Override protected Color getFeedbackColor() { - return Color.cyan; + return JBColor.CYAN; } @Override @@ -114,7 +115,7 @@ public class LayoutWeightOperation extends LayoutMarginOperation { public static void point(ResizeSelectionDecorator decorator) { pointFeedback(decorator); - pointRight(decorator, Color.cyan, 0.75, TYPE, "Change layout:weight"); - pointBottom(decorator, Color.cyan, 0.75, TYPE, "Change layout:weight"); + pointRight(decorator, JBColor.CYAN, 0.75, TYPE, "Change layout:weight"); + pointBottom(decorator, JBColor.CYAN, 0.75, TYPE, "Change layout:weight"); } } \ No newline at end of file diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/RelativeLayoutResizeOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/RelativeLayoutResizeOperation.java index d772ea6f8823..3006297bd5f3 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/RelativeLayoutResizeOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/RelativeLayoutResizeOperation.java @@ -30,6 +30,7 @@ import com.intellij.designer.model.RadComponent; import com.intellij.designer.utils.Position; import com.intellij.openapi.util.Pair; import com.intellij.ui.IdeBorderFactory; +import com.intellij.ui.JBColor; import java.awt.*; import java.util.ArrayList; @@ -94,7 +95,7 @@ public class RelativeLayoutResizeOperation implements EditOperation { myVerticalTextFeedback.setBorder(IdeBorderFactory.createEmptyBorder(0, 3, 2, 0)); layer.add(myVerticalTextFeedback); - myBoundsFeedback = new RectangleFeedback(Color.blue, 2); + myBoundsFeedback = new RectangleFeedback(JBColor.BLUE, 2); layer.add(myBoundsFeedback); int direction = myContext.getResizeDirection(); @@ -121,7 +122,7 @@ public class RelativeLayoutResizeOperation implements EditOperation { wrapBounds = new Rectangle(bounds.getLocation(), myWrapSize); } - myWrapFeedback = new RectangleFeedback(Color.green, 1); + myWrapFeedback = new RectangleFeedback(JBColor.GREEN, 1); myWrapFeedback.setBounds(wrapBounds); layer.add(myWrapFeedback); } diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java index b5317c1c9ab0..94fff68e5253 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java @@ -30,6 +30,7 @@ import com.intellij.designer.model.RadComponent; import com.intellij.designer.utils.Position; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.Pair; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.ArrayUtil; @@ -42,7 +43,7 @@ import java.util.List; public class ResizeOperation implements EditOperation { public static final String TYPE = "resize_children"; - public final static Color blue = new Color(0, 50, 255); + public final static Color blue = new JBColor(new Color(0, 50, 255), new Color(92, 132, 255)); private static final int SNAP_DELTA = 4; private final OperationContext myContext; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/caption/HorizontalCaptionFlowBaseOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/caption/HorizontalCaptionFlowBaseOperation.java index 133570f9c8de..5acd3c0fca4d 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/caption/HorizontalCaptionFlowBaseOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/caption/HorizontalCaptionFlowBaseOperation.java @@ -22,6 +22,7 @@ import com.intellij.designer.designSurface.FlowBaseOperation; import com.intellij.designer.designSurface.OperationContext; import com.intellij.designer.designSurface.feedbacks.LineInsertFeedback; import com.intellij.designer.model.RadComponent; +import com.intellij.ui.JBColor; import javax.swing.*; import java.awt.*; @@ -55,7 +56,7 @@ public abstract class HorizontalCaptionFlowBaseOperation selection) { diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionComponent.java b/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionComponent.java index e6c9c56b78fa..424f7cf542cc 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionComponent.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionComponent.java @@ -22,9 +22,9 @@ import com.intellij.designer.designSurface.StaticDecorator; import com.intellij.designer.model.RadComponent; import com.intellij.designer.model.RadComponentVisitor; import com.intellij.designer.model.RadVisualComponent; +import com.intellij.ui.JBColor; import com.intellij.util.containers.hash.HashSet; -import java.awt.*; import java.util.List; import java.util.Set; @@ -47,7 +47,7 @@ public abstract class RadCaptionComponent extends Ra myWidth = width; if (empty) { - myDecorator = new CaptionStaticDecorator(this, Color.PINK); + myDecorator = new CaptionStaticDecorator(this, JBColor.PINK); } else { myDecorator = new CaptionStaticDecorator(this); diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadAbsoluteLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadAbsoluteLayout.java index 5c710364f13c..5f7f5b267f4b 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadAbsoluteLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadAbsoluteLayout.java @@ -25,9 +25,9 @@ import com.intellij.designer.designSurface.EditOperation; import com.intellij.designer.designSurface.OperationContext; import com.intellij.designer.designSurface.selection.ResizeSelectionDecorator; import com.intellij.designer.model.RadComponent; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.NotNull; -import java.awt.*; import java.util.List; /** @@ -64,7 +64,7 @@ public class RadAbsoluteLayout extends RadViewLayoutWithData { @Override public ComponentDecorator getChildSelectionDecorator(RadComponent component, List selection) { if (mySelectionDecorator == null) { - mySelectionDecorator = new ResizeSelectionDecorator(Color.red, 1); + mySelectionDecorator = new ResizeSelectionDecorator(JBColor.RED, 1); ResizeOperation.points(mySelectionDecorator); } return mySelectionDecorator; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadFrameLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadFrameLayout.java index f33da339c57a..b6c4d174a72b 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadFrameLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadFrameLayout.java @@ -36,10 +36,10 @@ import com.intellij.designer.utils.Position; import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.util.Pair; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.NotNull; import javax.swing.*; -import java.awt.*; import java.util.Arrays; import java.util.List; @@ -80,7 +80,7 @@ public class RadFrameLayout extends RadViewLayoutWithData { @Override public ComponentDecorator getChildSelectionDecorator(RadComponent component, List selection) { if (mySelectionDecorator == null) { - mySelectionDecorator = new ResizeSelectionDecorator(Color.red, 1) { + mySelectionDecorator = new ResizeSelectionDecorator(JBColor.RED, 1) { @Override protected boolean visible(RadComponent component, ResizePoint point) { if (point.getType() == LayoutMarginOperation.TYPE) { diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadLinearLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadLinearLayout.java index b3534496d07f..9ffd87ffa0b1 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadLinearLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadLinearLayout.java @@ -38,6 +38,7 @@ import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.Pair; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.NotNull; import javax.swing.*; @@ -123,7 +124,7 @@ public class RadLinearLayout extends RadViewLayoutWithData implements ILayoutDec @Override public ComponentDecorator getChildSelectionDecorator(RadComponent component, List selection) { if (mySelectionDecorator == null) { - mySelectionDecorator = new ResizeSelectionDecorator(Color.red, 1) { + mySelectionDecorator = new ResizeSelectionDecorator(JBColor.RED, 1) { @Override protected boolean visible(RadComponent component, ResizePoint point) { if (point.getType() == LayoutMarginOperation.TYPE) { diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadGridLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadGridLayout.java index 545abb49f5bc..ba0362bba325 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadGridLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadGridLayout.java @@ -34,6 +34,7 @@ import com.intellij.designer.designSurface.*; import com.intellij.designer.model.RadComponent; import com.intellij.designer.model.RadLayout; import com.intellij.openapi.actionSystem.DefaultActionGroup; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.NotNull; import javax.swing.*; @@ -106,7 +107,7 @@ public class RadGridLayout extends RadViewLayoutWithData implements ILayoutDecor @Override public ComponentDecorator getChildSelectionDecorator(RadComponent component, List selection) { if (mySelectionDecorator == null) { - mySelectionDecorator = new GridSelectionDecorator(Color.red, 1) { + mySelectionDecorator = new GridSelectionDecorator(JBColor.RED, 1) { @Override public Rectangle getCellBounds(Component layer, RadComponent component) { try { diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/relative/RadRelativeLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/relative/RadRelativeLayout.java index eaa0a26c1cdd..9ed7cb488a64 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/layout/relative/RadRelativeLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/relative/RadRelativeLayout.java @@ -33,10 +33,10 @@ import com.intellij.designer.model.Property; import com.intellij.designer.model.RadComponent; import com.intellij.designer.propertyTable.PropertyTable; import com.intellij.openapi.actionSystem.DefaultActionGroup; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.NotNull; import javax.swing.*; -import java.awt.*; import java.util.Arrays; import java.util.List; @@ -135,7 +135,7 @@ public class RadRelativeLayout extends RadViewLayoutWithData implements ILayoutD @Override public ComponentDecorator getChildSelectionDecorator(RadComponent component, List selection) { if (mySelectionDecorator == null) { - mySelectionDecorator = new ResizeSelectionDecorator(Color.red, 1); + mySelectionDecorator = new ResizeSelectionDecorator(JBColor.RED, 1); RelativeLayoutResizeOperation.points(mySelectionDecorator); } return mySelectionDecorator; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableLayout.java index 863d64d97033..2cf2c80899d5 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableLayout.java @@ -30,9 +30,9 @@ import com.intellij.designer.designSurface.*; import com.intellij.designer.designSurface.selection.ResizeSelectionDecorator; import com.intellij.designer.model.RadComponent; import com.intellij.designer.model.RadLayout; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.NotNull; -import java.awt.*; import java.util.ArrayList; import java.util.List; @@ -101,7 +101,7 @@ public class RadTableLayout extends RadViewLayoutWithData implements ILayoutDeco } if (mySelectionDecorator == null) { - mySelectionDecorator = new ResizeSelectionDecorator(Color.red, 1); + mySelectionDecorator = new ResizeSelectionDecorator(JBColor.RED, 1); ResizeOperation.height(mySelectionDecorator); } return mySelectionDecorator; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableRowLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableRowLayout.java index d360e1283bf2..e3581ac861d3 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableRowLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableRowLayout.java @@ -24,6 +24,7 @@ import com.intellij.android.designer.model.layout.actions.AllGravityAction; import com.intellij.designer.designSurface.*; import com.intellij.designer.model.RadComponent; import com.intellij.openapi.actionSystem.DefaultActionGroup; +import com.intellij.ui.JBColor; import com.intellij.util.ArrayUtil; import org.jetbrains.annotations.NotNull; @@ -80,7 +81,7 @@ public class RadTableRowLayout extends RadLinearLayout { public ComponentDecorator getChildSelectionDecorator(RadComponent component, List selection) { if (isTableParent()) { if (mySelectionDecorator == null) { - mySelectionDecorator = new GridSelectionDecorator(Color.red, 1) { + mySelectionDecorator = new GridSelectionDecorator(JBColor.RED, 1) { @Override public Rectangle getCellBounds(Component layer, RadComponent component) { try { diff --git a/plugins/android/src/org/jetbrains/android/newProject/AndroidAppPropertiesEditor.java b/plugins/android/src/org/jetbrains/android/newProject/AndroidAppPropertiesEditor.java index ad513ea0a2a1..3972a846d021 100644 --- a/plugins/android/src/org/jetbrains/android/newProject/AndroidAppPropertiesEditor.java +++ b/plugins/android/src/org/jetbrains/android/newProject/AndroidAppPropertiesEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -19,6 +19,7 @@ import com.intellij.openapi.module.Module; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.roots.ui.configuration.ModulesProvider; import com.intellij.ui.DocumentAdapter; +import com.intellij.ui.JBColor; import com.intellij.util.ui.UIUtil; import org.jetbrains.android.dom.manifest.Manifest; import org.jetbrains.android.facet.AndroidFacet; @@ -30,7 +31,6 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import javax.swing.event.DocumentEvent; -import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -117,7 +117,7 @@ public class AndroidAppPropertiesEditor { } public void updateActivityPanel() { - myErrorLabel.setForeground(Color.RED); + myErrorLabel.setForeground(JBColor.RED); UIUtil.setEnabled(myActivtiyPanel, myHelloAndroidCheckBox.isSelected(), true); } diff --git a/plugins/android/src/org/jetbrains/android/uipreview/AndroidLayoutPreviewPanel.java b/plugins/android/src/org/jetbrains/android/uipreview/AndroidLayoutPreviewPanel.java index 6627f9335fc6..7cf118bb072c 100644 --- a/plugins/android/src/org/jetbrains/android/uipreview/AndroidLayoutPreviewPanel.java +++ b/plugins/android/src/org/jetbrains/android/uipreview/AndroidLayoutPreviewPanel.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2012 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.jetbrains.android.uipreview; import com.intellij.openapi.Disposable; @@ -11,7 +26,6 @@ import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.JBColor; import com.intellij.ui.components.JBLabel; import com.intellij.util.ui.AsyncProcessIcon; -import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -71,9 +85,9 @@ public class AndroidLayoutPreviewPanel extends JPanel implements Disposable { public AndroidLayoutPreviewPanel() { super(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, true)); - setBackground(new JBColor(Color.WHITE, UIUtil.getListBackground())); + setBackground(JBColor.WHITE); setOpaque(true); - myImagePanel.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.GRAY)); + myImagePanel.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, JBColor.GRAY)); myFileNameLabel.setHorizontalAlignment(SwingConstants.CENTER); myFileNameLabel.setBorder(new EmptyBorder(5, 0, 5, 0)); diff --git a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntTargetNodeDescriptor.java b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntTargetNodeDescriptor.java index 03fceb5c1095..31cbeeb4ceaf 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntTargetNodeDescriptor.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntTargetNodeDescriptor.java @@ -35,6 +35,7 @@ import com.intellij.openapi.roots.ui.util.CompositeAppearance; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.ui.HtmlListCellRenderer; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleColoredComponent; import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.ui.UIUtil; @@ -44,7 +45,7 @@ import java.awt.*; import java.util.ArrayList; final class AntTargetNodeDescriptor extends AntNodeDescriptor { - private static final TextAttributes ourPostfixAttributes = new TextAttributes(new Color(128, 0, 0), null, null, EffectType.BOXED, Font.PLAIN); + private static final TextAttributes ourPostfixAttributes = new TextAttributes(new JBColor(new Color(128, 0, 0), JBColor.RED), null, null, EffectType.BOXED, Font.PLAIN); private final AntBuildTargetBase myTarget; private CompositeAppearance myHighlightedText; diff --git a/plugins/copyright/src/com/maddyhome/idea/copyright/ui/ProjectSettingsPanel.java b/plugins/copyright/src/com/maddyhome/idea/copyright/ui/ProjectSettingsPanel.java index 837092380c60..591109577b26 100644 --- a/plugins/copyright/src/com/maddyhome/idea/copyright/ui/ProjectSettingsPanel.java +++ b/plugins/copyright/src/com/maddyhome/idea/copyright/ui/ProjectSettingsPanel.java @@ -17,6 +17,7 @@ package com.maddyhome.idea.copyright.ui; import com.intellij.ide.DataManager; import com.intellij.psi.search.scope.packageSet.CustomScopesProviderEx; +import com.intellij.ui.JBColor; import com.intellij.ui.ListCellRendererWrapper; import com.intellij.ide.util.scopeChooser.PackageSetChooserCombo; import com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable; @@ -262,7 +263,7 @@ public class ProjectSettingsPanel { final Component rendererComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (!isSelected) { final CopyrightProfile profile = myProfilesModel.getAllProfiles().get(scopeSetting.getProfileName()); - setForeground(profile == null ? Color.RED : UIUtil.getTableForeground()); + setForeground(profile == null ? JBColor.RED : UIUtil.getTableForeground()); } setText(scopeSetting.getProfileName()); return rendererComponent; @@ -327,7 +328,7 @@ public class ProjectSettingsPanel { final String scopeName = ((NamedScope)value).getName(); if (!isSelected) { final NamedScope scope = NamedScopesHolder.getScope(myProject, scopeName); - if (scope == null) setForeground(Color.RED); + if (scope == null) setForeground(JBColor.RED); } setText(scopeName); } diff --git a/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java b/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java index 73c8499adbf6..f24049e758d6 100644 --- a/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java +++ b/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java @@ -1,9 +1,12 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2012 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. * You may obtain a copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -1775,10 +1778,10 @@ public class GitLogUI implements Disposable { } interface Colors { - Color tag = UIUtil.isUnderDarcula() ? new Color(0x7D7B12) : new Color(0xf1ef9e); - Color remote = UIUtil.isUnderDarcula() ? new Color(0xbcbcfc).darker().darker() : new Color(0xbcbcfc); - Color local = UIUtil.isUnderDarcula() ? new Color(0x0D6D4F) : new Color(0x75eec7); - Color highlighted = UIUtil.isUnderDarcula() ? UIUtil.getTableBackground() : new Color(210,255,233); + Color tag = new JBColor(new Color(0xf1ef9e), new Color(0x7D7B12)); + Color remote = new JBColor(new Color(0xbcbcfc), new Color(0xbcbcfc).darker().darker()); + Color local = new JBColor(new Color(0x75eec7), new Color(0x0D6D4F)); + Color highlighted = new JBColor(new Color(210,255,233), UIUtil.getTableBackground()); } private void updateMoreVisibility() { diff --git a/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java b/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java index a561ddec475d..4f0e86cae110 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java +++ b/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -29,6 +29,7 @@ import com.intellij.openapi.ui.popup.ListPopup; import com.intellij.openapi.ui.popup.PopupStep; import com.intellij.openapi.util.Condition; import com.intellij.ui.ErrorLabel; +import com.intellij.ui.JBColor; import com.intellij.ui.components.panels.OpaquePanel; import com.intellij.ui.popup.PopupFactoryImpl; import com.intellij.ui.popup.WizardPopup; @@ -333,7 +334,7 @@ class GitBranchPopup { } else { myBranchLabel.setBackground(getBackground()); - myBranchLabel.setForeground(Color.gray); // different foreground than for other elements + myBranchLabel.setForeground(JBColor.GRAY); // different foreground than for other elements } adjustOpacity(myBranchLabel, isSelected); diff --git a/plugins/git4idea/src/git4idea/update/GitSkippedCommits.java b/plugins/git4idea/src/git4idea/update/GitSkippedCommits.java index 0257832ed4c8..da6a60d8d332 100644 --- a/plugins/git4idea/src/git4idea/update/GitSkippedCommits.java +++ b/plugins/git4idea/src/git4idea/update/GitSkippedCommits.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -27,6 +27,7 @@ import com.intellij.openapi.vcs.ex.ProjectLevelVcsManagerEx; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.wm.ToolWindowId; import com.intellij.openapi.wm.ToolWindowManager; +import com.intellij.ui.JBColor; import com.intellij.ui.components.JBScrollPane; import com.intellij.ui.content.Content; import com.intellij.ui.content.ContentFactory; @@ -123,7 +124,7 @@ public class GitSkippedCommits extends PanelWithActionsAndCloseButton { r.setForeground(sel ? textSelectionColor : textNonSelectionColor); } else if (o instanceof String) { - r.setForeground(sel ? textSelectionColor : Color.RED); + r.setForeground(sel ? textSelectionColor : JBColor.RED); r.setFont(tree.getFont()); } else { diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleColorAndFontPreviewPanel.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleColorAndFontPreviewPanel.java index 2fd8f39c4090..3856f64138e7 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleColorAndFontPreviewPanel.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleColorAndFontPreviewPanel.java @@ -13,6 +13,7 @@ import com.intellij.openapi.editor.colors.TextAttributesKey; import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.Ref; +import com.intellij.ui.JBColor; import com.intellij.ui.components.JBScrollPane; import com.intellij.ui.treeStructure.Tree; import com.intellij.util.containers.ContainerUtil; @@ -292,7 +293,7 @@ public class GradleColorAndFontPreviewPanel implements PreviewPanel { return; } Graphics2D g2 = (Graphics2D)g; - g.setColor(Color.RED); + g.setColor(JBColor.RED); RenderingHints renderHints = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); renderHints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2.setRenderingHints(renderHints); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/DefaultHighlighter.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/DefaultHighlighter.java index 8f508fd0e669..85134718d550 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/DefaultHighlighter.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/DefaultHighlighter.java @@ -23,6 +23,7 @@ import com.intellij.openapi.editor.colors.CodeInsightColors; import com.intellij.openapi.editor.colors.TextAttributesKey; import com.intellij.openapi.editor.markup.EffectType; import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.ui.JBColor; import com.intellij.util.ui.PlatformColors; import org.jetbrains.annotations.NonNls; @@ -189,7 +190,7 @@ public class DefaultHighlighter { public static final TextAttributes UNRESOLVED_ACCESS_ATTRIBUTES = HighlighterColors.TEXT.getDefaultAttributes().clone(); static { UNRESOLVED_ACCESS_ATTRIBUTES.setForegroundColor(Color.BLACK); - UNRESOLVED_ACCESS_ATTRIBUTES.setEffectColor(Color.GRAY); + UNRESOLVED_ACCESS_ATTRIBUTES.setEffectColor(JBColor.GRAY); UNRESOLVED_ACCESS_ATTRIBUTES.setEffectType(EffectType.LINE_UNDERSCORE); } diff --git a/plugins/junit/src/com/intellij/execution/junit2/ui/TestColumnInfo.java b/plugins/junit/src/com/intellij/execution/junit2/ui/TestColumnInfo.java index b1d3612c3537..76c0209df3d9 100644 --- a/plugins/junit/src/com/intellij/execution/junit2/ui/TestColumnInfo.java +++ b/plugins/junit/src/com/intellij/execution/junit2/ui/TestColumnInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -23,10 +23,7 @@ import com.intellij.execution.junit2.states.TestState; import com.intellij.execution.testframework.Filter; import com.intellij.execution.testframework.TestsUIUtil; import com.intellij.rt.execution.junit.states.PoolOfTestStates; -import com.intellij.ui.ColoredTableCellRenderer; -import com.intellij.ui.SimpleColoredRenderer; -import com.intellij.ui.SimpleTextAttributes; -import com.intellij.ui.TableCellState; +import com.intellij.ui.*; import com.intellij.util.ui.ColumnInfo; import javax.swing.*; @@ -170,12 +167,13 @@ public abstract class TestColumnInfo extends ColumnInfo implements Comparator { private static class CountDefectsRenderer extends JPanel implements TableCellRenderer { private static final SimpleTextAttributes RUNNING_COLOR = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, Color.BLACK); - private static final SimpleTextAttributes DEFECT_ATTRIBUTE = new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, Color.RED); + private static final SimpleTextAttributes DEFECT_ATTRIBUTE = new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, JBColor.RED); private final SimpleColoredRenderer myCounters = new SimpleColoredRenderer(); private final SimpleColoredRenderer myProgressIndicator = new SimpleColoredRenderer(); private final TableCellState myCellState = new TableCellState(); - private static final SimpleTextAttributes TERMINATED_ATTRIBUTE = new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, Color.ORANGE); + private static final SimpleTextAttributes TERMINATED_ATTRIBUTE = new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, + JBColor.ORANGE); public CountDefectsRenderer() { super(new BorderLayout()); diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenRepositoriesConfigurable.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenRepositoriesConfigurable.java index 3f3269fe0ee0..b9cbfb1a2415 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenRepositoriesConfigurable.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenRepositoriesConfigurable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -26,6 +26,7 @@ import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.CollectionListModel; +import com.intellij.ui.JBColor; import com.intellij.ui.ListUtil; import com.intellij.ui.components.JBList; import com.intellij.ui.table.JBTable; @@ -339,10 +340,10 @@ public class MavenRepositoriesConfigurable extends BaseConfigurable implements S MavenIndex index = getIndexAt(row); if (index.getFailureMessage() != null) { if (isSelected) { - setForeground(Color.PINK); + setForeground(JBColor.PINK); } else { - setBackground(Color.PINK); + setBackground(JBColor.PINK); } } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsStructure.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsStructure.java index ba4974065ebb..142e4f7c5290 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsStructure.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsStructure.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -23,6 +23,7 @@ import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.pom.Navigatable; +import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; import com.intellij.ui.treeStructure.*; import com.intellij.util.containers.ContainerUtil; @@ -442,7 +443,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure { private SimpleTextAttributes prepareAttribs(SimpleTextAttributes from) { ErrorLevel level = getTotalErrorLevel(); - Color waveColor = level == ErrorLevel.NONE ? null : Color.RED; + Color waveColor = level == ErrorLevel.NONE ? null : JBColor.RED; int style = from.getStyle(); if (waveColor != null) style |= SimpleTextAttributes.STYLE_WAVED; return new SimpleTextAttributes(from.getBgColor(), from.getFgColor(), waveColor, style); @@ -719,7 +720,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure { @Override protected SimpleTextAttributes getPlainAttributes() { if (myProjectsManager.isIgnored(myMavenProject)) { - return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, Color.GRAY); + return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.GRAY); } return super.getPlainAttributes(); } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGroovyConsoleFilter.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGroovyConsoleFilter.java index 017c888695e7..ae3003d556a4 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGroovyConsoleFilter.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGroovyConsoleFilter.java @@ -25,6 +25,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.ui.JBColor; import org.jetbrains.annotations.Nullable; import java.awt.*; @@ -79,8 +80,8 @@ public class MavenGroovyConsoleFilter implements Filter { private static TextAttributes createCompilationErrorAttr() { TextAttributes attr = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.HYPERLINK_ATTRIBUTES).clone(); - attr.setForegroundColor(Color.RED); - attr.setEffectColor(Color.RED); + attr.setForegroundColor(JBColor.RED); + attr.setEffectColor(JBColor.RED); attr.setEffectType(EffectType.LINE_UNDERSCORE); attr.setFontType(Font.PLAIN); return attr; diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/AbstractTableView.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/AbstractTableView.java index fe8c445ecfc3..4b2f1d58b893 100644 --- a/xml/dom-openapi/src/com/intellij/util/xml/ui/AbstractTableView.java +++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/AbstractTableView.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -19,6 +19,7 @@ import com.intellij.ide.actions.ContextHelpAction; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; +import com.intellij.ui.JBColor; import com.intellij.ui.PopupHandler; import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.table.TableView; @@ -129,7 +130,7 @@ public abstract class AbstractTableView extends JPanel implements TypeSafeDat final ActionToolbar myActionToolbar = actionManager.createActionToolbar(ActionPlaces.PROJECT_VIEW_TOOLBAR, actionGroup, position == ToolbarPosition.TOP || position == ToolbarPosition.BOTTOM); myActionToolbar.setTargetComponent(myTable); final JComponent toolbarComponent = myActionToolbar.getComponent(); - final MatteBorder matteBorder = BorderFactory.createMatteBorder(0, 0, position == ToolbarPosition.TOP ? 1 : 0, 0, Color.darkGray); + final MatteBorder matteBorder = BorderFactory.createMatteBorder(0, 0, position == ToolbarPosition.TOP ? 1 : 0, 0, JBColor.DARK_GRAY); toolbarComponent.setBorder(BorderFactory.createCompoundBorder(matteBorder, toolbarComponent.getBorder())); getTable().getSelectionModel().addListSelectionListener(new ListSelectionListener() { diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/ComboControl.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/ComboControl.java index 3e84f88a93e6..db9c5eda4625 100644 --- a/xml/dom-openapi/src/com/intellij/util/xml/ui/ComboControl.java +++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/ComboControl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -22,6 +22,7 @@ import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.Factory; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.text.StringUtil; +import com.intellij.ui.JBColor; import com.intellij.util.Function; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.xml.*; @@ -200,7 +201,7 @@ public class ComboControl extends BaseModifiableControl { final Dimension dimension = getPreferredSize(); if (!validity.value(text)) { setFont(getFont().deriveFont(Font.ITALIC)); - setForeground(Color.RED); + setForeground(JBColor.RED); } setIcon(pair == null ? null : pair.second); setPreferredSize(new Dimension(-1, dimension.height)); diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java index e1e504b78c19..7ce604e475db 100644 --- a/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java +++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -18,6 +18,7 @@ package com.intellij.util.xml.ui; import com.intellij.icons.AllIcons; import com.intellij.lang.annotation.HighlightSeverity; +import com.intellij.ui.JBColor; import com.intellij.util.xml.DomElement; import com.intellij.util.xml.DomUtil; import com.intellij.util.xml.highlighting.DomElementAnnotationsManager; @@ -61,7 +62,7 @@ public class ErrorableTableCellRenderer extends DefaultTab final boolean hasErrors = errorProblems.size() > 0; if (hasErrors) { - component.setForeground(Color.RED); + component.setForeground(JBColor.RED); if (component instanceof JComponent) { ((JComponent)component).setToolTipText(TooltipUtils.getTooltipText(errorProblems)); } @@ -79,7 +80,7 @@ public class ErrorableTableCellRenderer extends DefaultTab } else if (warningProblems.size() > 0) { component.setBackground(BaseControl.WARNING_BACKGROUND); - if(isSelected) component.setForeground(Color.BLACK); + if(isSelected) component.setForeground(JBColor.foreground); } final List errorDescriptors = diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java index 2854163540ed..33d75610bbe5 100644 --- a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java +++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -27,6 +27,7 @@ import com.intellij.psi.PsiManager; import com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider; import com.intellij.psi.xml.XmlFile; import com.intellij.psi.xml.XmlTag; +import com.intellij.ui.JBColor; import com.intellij.util.ArrayUtil; import com.intellij.xml.XmlBundle; import com.intellij.xml.XmlElementDescriptor; @@ -36,7 +37,6 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; @@ -138,7 +138,7 @@ public class GenerateInstanceDocumentFromSchemaDialog extends DialogWrapper { String msg = doValidateWithData(); setOKActionEnabled(msg == null); status.setText(msg == null ? "" : msg); - status.setForeground(Color.RED); + status.setForeground(JBColor.RED); } public static void configureComboBox(JComboBox combo, List lastValues) { // without -editor.selectAll- no focus diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentDialog.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentDialog.java index b76f638c485b..e57a7532295a 100644 --- a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentDialog.java +++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -20,6 +20,7 @@ import com.intellij.openapi.ui.ComboBox; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.ui.TextFieldWithBrowseButton; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.ui.JBColor; import com.intellij.util.ArrayUtil; import com.intellij.xml.XmlBundle; import org.jetbrains.annotations.NotNull; @@ -27,7 +28,6 @@ import org.jetbrains.annotations.NotNull; import javax.swing.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; @@ -100,7 +100,7 @@ public class GenerateSchemaFromInstanceDocumentDialog extends DialogWrapper { String msg = doValidateWithData(); setOKActionEnabled(msg == null); status.setText(msg == null ? "" : msg); - status.setForeground(Color.RED); + status.setForeground(JBColor.RED); } public static void configureComboBox(JComboBox combo, List lastValues) {