|
Lines 8-31
Link Here
|
| 8 |
*******************************************************************************/ |
8 |
*******************************************************************************/ |
| 9 |
package org.eclipse.e4.ui.css.swt.properties.custom; |
9 |
package org.eclipse.e4.ui.css.swt.properties.custom; |
| 10 |
|
10 |
|
| 11 |
import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
|
|
| 12 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
11 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
| 13 |
|
|
|
| 14 |
import org.eclipse.swt.custom.CTabFolderRenderer; |
| 15 |
|
| 16 |
import org.eclipse.e4.ui.css.swt.helpers.CSSSWTColorHelper; |
| 17 |
import org.eclipse.swt.custom.CTabItem; |
| 18 |
|
| 19 |
import org.eclipse.e4.ui.css.core.resources.IResourcesRegistry; |
| 20 |
|
| 21 |
import java.util.Iterator; |
| 22 |
import org.eclipse.e4.ui.css.core.dom.properties.Gradient; |
12 |
import org.eclipse.e4.ui.css.core.dom.properties.Gradient; |
| 23 |
import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler; |
13 |
import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler; |
| 24 |
import org.eclipse.e4.ui.css.core.engine.CSSEngine; |
14 |
import org.eclipse.e4.ui.css.core.engine.CSSEngine; |
|
|
15 |
import org.eclipse.e4.ui.css.swt.helpers.CSSSWTColorHelper; |
| 25 |
import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler; |
16 |
import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler; |
| 26 |
import org.eclipse.swt.custom.CTabFolder; |
17 |
import org.eclipse.swt.custom.CTabFolder; |
| 27 |
import org.eclipse.swt.graphics.Color; |
18 |
import org.eclipse.swt.graphics.Color; |
| 28 |
import org.eclipse.swt.graphics.RGB; |
|
|
| 29 |
import org.eclipse.swt.widgets.Control; |
19 |
import org.eclipse.swt.widgets.Control; |
| 30 |
import org.w3c.dom.css.CSSValue; |
20 |
import org.w3c.dom.css.CSSValue; |
| 31 |
|
21 |
|
|
Lines 45-63
Link Here
|
| 45 |
int[] percents = CSSSWTColorHelper.getPercents(grad); |
35 |
int[] percents = CSSSWTColorHelper.getPercents(grad); |
| 46 |
folder.setBackground(colors, percents, true); |
36 |
folder.setBackground(colors, percents, true); |
| 47 |
|
37 |
|
| 48 |
CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); |
|
|
| 49 |
Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); |
38 |
Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); |
| 50 |
if (appContext != null && appContext instanceof IEclipseContext) { |
39 |
if (appContext != null && appContext instanceof IEclipseContext) { |
| 51 |
IEclipseContext context = (IEclipseContext) appContext; |
40 |
IEclipseContext context = (IEclipseContext) appContext; |
| 52 |
IEclipseContext childContext = context.createChild(); |
|
|
| 53 |
if (pseudo != null && pseudo.equals("selected")) { |
41 |
if (pseudo != null && pseudo.equals("selected")) { |
| 54 |
childContext.set("activeToolbarColors", colors); |
42 |
context.set("activeToolbarColors", colors); |
| 55 |
childContext.set("activeToolbarPercents", percents); |
43 |
context.set("activeToolbarPercents", percents); |
| 56 |
} else { |
44 |
} else { |
| 57 |
childContext.set("inactiveToolbarColors", colors); |
45 |
context.set("inactiveToolbarColors", colors); |
| 58 |
childContext.set("inactiveToolbarPercents", percents); |
46 |
context.set("inactiveToolbarPercents", percents); |
| 59 |
} |
47 |
} |
| 60 |
ContextInjectionFactory.inject(renderer, childContext); |
|
|
| 61 |
} |
48 |
} |
| 62 |
} |
49 |
} |
| 63 |
} |
50 |
} |