hyperlink label: extract a common constructor
authorSergey Ignatov <sergey.ignatov@jetbrains.com>
Mon, 2 Nov 2015 21:12:43 +0000 (00:12 +0300)
committerSergey Ignatov <sergey.ignatov@jetbrains.com>
Tue, 3 Nov 2015 10:50:15 +0000 (13:50 +0300)
platform/platform-api/src/com/intellij/ui/EditorNotificationPanel.java
platform/platform-api/src/com/intellij/ui/HyperlinkLabel.java

index 732d021b78b1ab15936a5852359aa2af6eebb66e..f78d4f86aea142b88362eb0786a7d091d0a9ed81 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2015 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,7 +25,6 @@ import com.intellij.openapi.editor.colors.EditorColorsManager;
 import com.intellij.ui.components.panels.HorizontalLayout;
 import com.intellij.ui.components.panels.NonOpaquePanel;
 import com.intellij.util.ui.JBUI;
-import com.intellij.util.ui.PlatformColors;
 import com.intellij.util.ui.UIUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -86,7 +85,7 @@ public class EditorNotificationPanel extends JPanel {
   }
 
   public HyperlinkLabel createActionLabel(final String text, final Runnable action) {
-    HyperlinkLabel label = new HyperlinkLabel(text, PlatformColors.BLUE, getBackground(), PlatformColors.BLUE);
+    HyperlinkLabel label = new HyperlinkLabel(text, getBackground());
     label.addHyperlinkListener(new HyperlinkAdapter() {
       @Override
       protected void hyperlinkActivated(HyperlinkEvent e) {
index d9f44b41ddce5da25d0d7fd4a22177cb04073eff..8c920d6221bec6b8f495d620b6facf9fe1c98c4a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 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.
@@ -67,16 +67,11 @@ public class HyperlinkLabel extends HighlightableComponent {
   }
 
   public HyperlinkLabel(String text) {
-    this(text,
-         PlatformColors.BLUE,
-         new JBColor(new NotNullProducer<Color>() {
-           @NotNull
-           @Override
-           public Color produce() {
-             return UIUtil.getLabelBackground();
-           }
-         }),
-         PlatformColors.BLUE);
+    this(text, UIUtil.getLabelBackground());
+  }
+  
+  public HyperlinkLabel(String text, Color background) {
+    this(text, PlatformColors.BLUE, background, PlatformColors.BLUE);
   }
 
   public HyperlinkLabel(String text, final Color textForegroundColor, final Color textBackgroundColor, final Color textEffectColor) {