|
Lines 10-15
Link Here
|
| 10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.e4.ui.css.swt.properties.custom; |
11 |
package org.eclipse.e4.ui.css.swt.properties.custom; |
| 12 |
|
12 |
|
|
|
13 |
import java.util.HashMap; |
| 14 |
|
| 13 |
import java.lang.reflect.Method; |
15 |
import java.lang.reflect.Method; |
| 14 |
import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
16 |
import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
| 15 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
17 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
|
Lines 24-29
Link Here
|
| 24 |
|
26 |
|
| 25 |
public class CSSPropertyOuterKeylineSWTHandler extends AbstractCSSPropertySWTHandler { |
27 |
public class CSSPropertyOuterKeylineSWTHandler extends AbstractCSSPropertySWTHandler { |
| 26 |
|
28 |
|
|
|
29 |
HashMap contexts = new HashMap(); |
| 27 |
|
30 |
|
| 28 |
public static final ICSSPropertyHandler INSTANCE = new CSSPropertyOuterKeylineSWTHandler(); |
31 |
public static final ICSSPropertyHandler INSTANCE = new CSSPropertyOuterKeylineSWTHandler(); |
| 29 |
|
32 |
|
|
Lines 35-44
Link Here
|
| 35 |
Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay()); |
38 |
Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay()); |
| 36 |
|
39 |
|
| 37 |
CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); |
40 |
CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); |
| 38 |
Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); |
41 |
Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); |
| 39 |
if (appContext != null && appContext instanceof IEclipseContext) { |
42 |
if (cssContext != null && cssContext instanceof IEclipseContext) { |
| 40 |
IEclipseContext context = (IEclipseContext) appContext; |
43 |
IEclipseContext context = (IEclipseContext) cssContext; |
| 41 |
IEclipseContext childContext = context.createChild(); |
44 |
IEclipseContext childContext = (IEclipseContext) contexts.get(control); |
|
|
45 |
if (childContext == null) { |
| 46 |
childContext = context.createChild(); |
| 47 |
contexts.put(control, childContext); |
| 48 |
} |
| 42 |
childContext.set("outerKeyline", newColor); |
49 |
childContext.set("outerKeyline", newColor); |
| 43 |
ContextInjectionFactory.inject(renderer, childContext); |
50 |
ContextInjectionFactory.inject(renderer, childContext); |
| 44 |
} else { |
51 |
} else { |