From 3c501fe23d5decf421a2e76db68d745a6b5ab5c5 Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Fri, 4 Dec 2015 15:08:34 +0300 Subject: [PATCH] Make JBLabel copyable: JavaDoc --- .../src/com/intellij/ui/components/JBLabel.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/platform-api/src/com/intellij/ui/components/JBLabel.java b/platform/platform-api/src/com/intellij/ui/components/JBLabel.java index 6a78b6dd2057..0967345c3897 100644 --- a/platform/platform-api/src/com/intellij/ui/components/JBLabel.java +++ b/platform/platform-api/src/com/intellij/ui/components/JBLabel.java @@ -190,11 +190,20 @@ public class JBLabel extends JLabel implements AnchorableComponent { public void updateUI() { super.updateUI(); if (myEditorPane != null) { + //init inner components again (if any) to provide proper colors when LAF is being changed setCopyable(false); setCopyable(true); } } + /** + * + * In 'copyable' mode JBLabel has the same appearance but user can select text with mouse and copy it to clipboard with standard shortcut. + * @return 'this' (the same instance) + */ + // + // By default JBLabel is NOT copyable + // This method re public JBLabel setCopyable(boolean copyable) { if (copyable ^ myEditorPane != null) { if (myEditorPane == null) {