Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 313950 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyCornerRadiusSWTHandler.java (-6 / +5 lines)
Lines 34-45 Link Here
34
			
34
			
35
			CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer();
35
			CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer();
36
					
36
					
37
			Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context");
37
			Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context");
38
			if (appContext != null && appContext instanceof IEclipseContext) {
38
			if (cssContext != null && cssContext instanceof IEclipseContext) {
39
				IEclipseContext context = (IEclipseContext) appContext;
39
				IEclipseContext context = (IEclipseContext) cssContext;
40
				IEclipseContext childContext = context.createChild();
40
				context.set("radius", new Integer(radiusValue));
41
				childContext.set("radius", new Integer(radiusValue));
41
				ContextInjectionFactory.inject(renderer, context); 
42
				ContextInjectionFactory.inject(renderer, childContext); 
43
			}
42
			}
44
		}
43
		}
45
	}
44
	}
(-)src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyInnerKeylineSWTHandler.java (-6 / +5 lines)
Lines 35-46 Link Here
35
			Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay());
35
			Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay());
36
			
36
			
37
			CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer();
37
			CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer();
38
			Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context");
38
			Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context");
39
			if (appContext != null && appContext instanceof IEclipseContext) {
39
			if (cssContext != null && cssContext instanceof IEclipseContext) {
40
				IEclipseContext context = (IEclipseContext) appContext;
40
				IEclipseContext context = (IEclipseContext) cssContext;
41
				IEclipseContext childContext = context.createChild();
41
				context.set("innerKeyline", newColor);
42
				childContext.set("innerKeyline", newColor);
42
				ContextInjectionFactory.inject(renderer, context); 
43
				ContextInjectionFactory.inject(renderer, childContext); 
44
			} else {
43
			} else {
45
				Method[] methods = renderer.getClass().getMethods();
44
				Method[] methods = renderer.getClass().getMethods();
46
				for (int i = 0; i < methods.length; i++) {
45
				for (int i = 0; i < methods.length; i++) {
(-)src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyOuterKeylineSWTHandler.java (-4 / +11 lines)
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 {
(-)src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyTabRendererSWTHandler.java (-6 / +5 lines)
Lines 33-45 Link Here
33
			if (((CSSPrimitiveValue) value).getPrimitiveType() == CSSPrimitiveValue.CSS_URI) {
33
			if (((CSSPrimitiveValue) value).getPrimitiveType() == CSSPrimitiveValue.CSS_URI) {
34
				String rendURL = ((CSSPrimitiveValue) value).getStringValue();
34
				String rendURL = ((CSSPrimitiveValue) value).getStringValue();
35
			
35
			
36
				Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context");
36
				Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context");
37
				if (appContext != null && appContext instanceof IEclipseContext) {
37
				if (cssContext != null && cssContext instanceof IEclipseContext) {
38
					IEclipseContext context = (IEclipseContext) appContext;
38
					IEclipseContext context = (IEclipseContext) cssContext;
39
					IEclipseContext childContext = context.createChild();
39
					context.set(CTabFolder.class.getName(), control);
40
					childContext.set(CTabFolder.class.getName(), control);
41
					IContributionFactory factory = (IContributionFactory) context.get(IContributionFactory.class.getName());
40
					IContributionFactory factory = (IContributionFactory) context.get(IContributionFactory.class.getName());
42
					Object rend = factory.create(rendURL, childContext);
41
					Object rend = factory.create(rendURL, context);
43
					if (rend != null && rend instanceof CTabFolderRenderer){
42
					if (rend != null && rend instanceof CTabFolderRenderer){
44
						((CTabFolder) control).setRenderer((CTabFolderRenderer)rend);
43
						((CTabFolder) control).setRenderer((CTabFolderRenderer)rend);
45
					}
44
					}
(-)src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java (-9 / +8 lines)
Lines 38-55 Link Here
38
			folder.setBackground(colors, percents, true);
38
			folder.setBackground(colors, percents, true);
39
			
39
			
40
			CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer();
40
			CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer();
41
			Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context");
41
			Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context");
42
			if (appContext != null && appContext instanceof IEclipseContext) {
42
			if (cssContext != null && cssContext instanceof IEclipseContext) {
43
				IEclipseContext context = (IEclipseContext) appContext;
43
				IEclipseContext context = (IEclipseContext) cssContext;
44
				IEclipseContext childContext = context.createChild();
45
				if (pseudo != null && pseudo.equals("selected")) {
44
				if (pseudo != null && pseudo.equals("selected")) {
46
					childContext.set("activeToolbarColors", colors);
45
					context.set("activeToolbarColors", colors);
47
					childContext.set("activeToolbarPercents", percents);
46
					context.set("activeToolbarPercents", percents);
48
				} else {
47
				} else {
49
					childContext.set("inactiveToolbarColors", colors);
48
					context.set("inactiveToolbarColors", colors);
50
					childContext.set("inactiveToolbarPercents", percents);
49
					context.set("inactiveToolbarPercents", percents);
51
				}
50
				}
52
				ContextInjectionFactory.inject(renderer, childContext); 
51
				ContextInjectionFactory.inject(renderer, context); 
53
			}
52
			}
54
		}
53
		}
55
	}
54
	}
(-)src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java (-1 / +6 lines)
Lines 23-28 Link Here
23
import org.eclipse.core.databinding.observable.Realm;
23
import org.eclipse.core.databinding.observable.Realm;
24
import org.eclipse.core.runtime.FileLocator;
24
import org.eclipse.core.runtime.FileLocator;
25
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
25
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
26
import org.eclipse.e4.core.contexts.EclipseContextFactory;
26
import org.eclipse.e4.core.contexts.IContextConstants;
27
import org.eclipse.e4.core.contexts.IContextConstants;
27
import org.eclipse.e4.core.contexts.IEclipseContext;
28
import org.eclipse.e4.core.contexts.IEclipseContext;
28
import org.eclipse.e4.core.di.IDisposable;
29
import org.eclipse.e4.core.di.IDisposable;
Lines 763-769 Link Here
763
			final IThemeEngine engine = mgr.getEngineForDisplay(display);
764
			final IThemeEngine engine = mgr.getEngineForDisplay(display);
764
765
765
			// Store the app context
766
			// Store the app context
766
			display.setData("org.eclipse.e4.ui.css.context", appContext); //$NON-NLS-1$
767
			IContributionFactory contribution = (IContributionFactory) appContext
768
					.get(IContributionFactory.class.getName());
769
			IEclipseContext cssContext = EclipseContextFactory.create();
770
			cssContext.set(IContributionFactory.class.getName(), contribution);
771
			display.setData("org.eclipse.e4.ui.css.context", cssContext); //$NON-NLS-1$
767
772
768
			// Create the OSGi resource locator
773
			// Create the OSGi resource locator
769
			if (cssResourcesURI != null) {
774
			if (cssResourcesURI != null) {

Return to bug 313950