|
Lines 8-13
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 java.lang.reflect.Array; |
| 12 |
|
| 13 |
import java.lang.reflect.Method; |
| 14 |
|
| 11 |
import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
15 |
import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
| 12 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
16 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
| 13 |
import org.eclipse.e4.ui.css.core.dom.properties.Gradient; |
17 |
import org.eclipse.e4.ui.css.core.dom.properties.Gradient; |
|
Lines 38-54
Link Here
|
| 38 |
folder.setBackground(colors, percents, true); |
42 |
folder.setBackground(colors, percents, true); |
| 39 |
|
43 |
|
| 40 |
CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); |
44 |
CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); |
| 41 |
Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); |
45 |
|
| 42 |
if (cssContext != null && cssContext instanceof IEclipseContext) { |
46 |
if (pseudo != null && pseudo.equals("selected")) { |
| 43 |
IEclipseContext context = (IEclipseContext) cssContext; |
47 |
Method m = renderer.getClass().getDeclaredMethod("setActiveToolbarGradient", new Class[]{Color[].class, int[].class}); |
| 44 |
if (pseudo != null && pseudo.equals("selected")) { |
48 |
m.invoke(renderer, colors, percents); |
| 45 |
context.set("activeToolbarColors", colors); |
49 |
} else { |
| 46 |
context.set("activeToolbarPercents", percents); |
50 |
Method m = renderer.getClass().getDeclaredMethod("setInactiveToolbarGradient", new Class[]{Color[].class, int[].class}); |
| 47 |
} else { |
51 |
m.invoke(renderer, colors, percents); |
| 48 |
context.set("inactiveToolbarColors", colors); |
|
|
| 49 |
context.set("inactiveToolbarPercents", percents); |
| 50 |
} |
| 51 |
ContextInjectionFactory.inject(renderer, context); |
| 52 |
} |
52 |
} |
| 53 |
} |
53 |
} |
| 54 |
} |
54 |
} |