|
15 | 15 | package org.eclipse.ui.internal.themes; |
16 | 16 |
|
17 | 17 | import java.util.Hashtable; |
18 | | - |
19 | 18 | import org.eclipse.core.runtime.IConfigurationElement; |
20 | 19 | import org.eclipse.core.runtime.IExecutableExtension; |
21 | 20 | import org.eclipse.swt.graphics.RGB; |
|
31 | 30 | */ |
32 | 31 | public class LightColorFactory implements IColorFactory, IExecutableExtension { |
33 | 32 |
|
| 33 | + private static final String ACTIVE_NOFOCUS_TAB_BG_START = "org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START"; //$NON-NLS-1$ |
| 34 | + private static final String ACTIVE_TAB_TEXT_COLOR = "org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR"; //$NON-NLS-1$ |
| 35 | + private static final String ACTIVE_TAB_BG_END = "org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"; //$NON-NLS-1$ |
| 36 | + private static final String ACTIVE_TAB_BG_START = "org.eclipse.ui.workbench.ACTIVE_TAB_BG_START"; //$NON-NLS-1$ |
34 | 37 | protected static final RGB white = ColorUtil.getColorValue("COLOR_WHITE"); //$NON-NLS-1$ |
35 | 38 | protected static final RGB black = ColorUtil.getColorValue("COLOR_BLACK"); //$NON-NLS-1$ |
36 | 39 |
|
@@ -157,23 +160,30 @@ private RGB getActiveNofocusStartColor() { |
157 | 160 | return ColorUtil.blend(white, base, 40); |
158 | 161 | } |
159 | 162 |
|
| 163 | + static boolean isColorDefinitionIdPartOfLightColorFactory(String id) { |
| 164 | + if (ACTIVE_TAB_BG_START.equals(id) || ACTIVE_TAB_BG_END.equals(id) || ACTIVE_TAB_TEXT_COLOR.equals(id) |
| 165 | + || ACTIVE_NOFOCUS_TAB_BG_START.equals(id)) { |
| 166 | + return true; |
| 167 | + } |
| 168 | + return false; |
| 169 | + } |
| 170 | + |
160 | 171 | @Override |
161 | 172 | public RGB createColor() { |
162 | 173 | // should have base, otherwise error in the xml |
163 | 174 | if (baseColorName == null || definitionId == null) { |
164 | 175 | return white; |
165 | 176 | } |
166 | | - |
167 | | - if (definitionId.equals("org.eclipse.ui.workbench.ACTIVE_TAB_BG_START")) { //$NON-NLS-1$ |
| 177 | + if (definitionId.equals(ACTIVE_TAB_BG_START)) { |
168 | 178 | return getActiveFocusStartColor(); |
169 | 179 | } |
170 | | - if (definitionId.equals("org.eclipse.ui.workbench.ACTIVE_TAB_BG_END")) { //$NON-NLS-1$ |
| 180 | + if (definitionId.equals(ACTIVE_TAB_BG_END)) { |
171 | 181 | return getActiveFocusEndColor(); |
172 | 182 | } |
173 | | - if (definitionId.equals("org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR")) { //$NON-NLS-1$ |
| 183 | + if (definitionId.equals(ACTIVE_TAB_TEXT_COLOR)) { |
174 | 184 | return getActiveFocusTextColor(); |
175 | 185 | } |
176 | | - if (definitionId.equals("org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START")) { //$NON-NLS-1$ |
| 186 | + if (definitionId.equals(ACTIVE_NOFOCUS_TAB_BG_START)) { |
177 | 187 | return getActiveNofocusStartColor(); |
178 | 188 | } |
179 | 189 |
|
|
0 commit comments