From 8115a2e05018678ec9cda7c2982b97b8a49f236a Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 25 Jun 2018 17:04:21 +0200 Subject: [PATCH] Make it possible to access the color of a color icon (for rdserver) --- .../com/intellij/xml/util/ColorIconCache.java | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/xml/xml-psi-impl/src/com/intellij/xml/util/ColorIconCache.java b/xml/xml-psi-impl/src/com/intellij/xml/util/ColorIconCache.java index adcbee40097b..9a5aaf15f09b 100644 --- a/xml/xml-psi-impl/src/com/intellij/xml/util/ColorIconCache.java +++ b/xml/xml-psi-impl/src/com/intellij/xml/util/ColorIconCache.java @@ -1,21 +1,6 @@ -/* - * Copyright 2000-2014 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. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.xml.util; -import java.util.HashMap; import com.intellij.util.containers.SoftFactoryMap; import com.intellij.util.ui.EmptyIcon; import org.jetbrains.annotations.NotNull; @@ -23,6 +8,7 @@ import org.jetbrains.annotations.NotNull; import javax.swing.*; import java.awt.*; import java.util.Arrays; +import java.util.HashMap; import java.util.Map; /** @@ -74,6 +60,14 @@ public class ColorIconCache { return new ColorIcon(this); } + public Color getColor() { + return myColor; + } + + public Color[] getColours() { + return myColours; + } + @Override public void paintIcon(final Component component, final Graphics g, final int i, final int j) { final int iconWidth = getIconWidth();