Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 173128 Details for
Bug 313950
CSS Engine creates unnecessary contexts and injections
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
313950_patch.txt (text/plain), 10.78 KB, created by
Bogdan Gheorghe
on 2010-06-30 13:05:18 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Bogdan Gheorghe
Created:
2010-06-30 13:05:18 EDT
Size:
10.78 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.e4.ui.css.swt >Index: src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyCornerRadiusSWTHandler.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyCornerRadiusSWTHandler.java,v >retrieving revision 1.5 >diff -u -r1.5 CSSPropertyCornerRadiusSWTHandler.java >--- src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyCornerRadiusSWTHandler.java 28 May 2010 20:17:13 -0000 1.5 >+++ src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyCornerRadiusSWTHandler.java 30 Jun 2010 17:04:53 -0000 >@@ -34,12 +34,11 @@ > > CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); > >- Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); >- if (appContext != null && appContext instanceof IEclipseContext) { >- IEclipseContext context = (IEclipseContext) appContext; >- IEclipseContext childContext = context.createChild(); >- childContext.set("radius", new Integer(radiusValue)); >- ContextInjectionFactory.inject(renderer, childContext); >+ Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); >+ if (cssContext != null && cssContext instanceof IEclipseContext) { >+ IEclipseContext context = (IEclipseContext) cssContext; >+ context.set("radius", new Integer(radiusValue)); >+ ContextInjectionFactory.inject(renderer, context); > } > } > } >Index: src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyInnerKeylineSWTHandler.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyInnerKeylineSWTHandler.java,v >retrieving revision 1.4 >diff -u -r1.4 CSSPropertyInnerKeylineSWTHandler.java >--- src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyInnerKeylineSWTHandler.java 28 May 2010 20:17:13 -0000 1.4 >+++ src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyInnerKeylineSWTHandler.java 30 Jun 2010 17:04:53 -0000 >@@ -35,12 +35,11 @@ > Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay()); > > CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); >- Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); >- if (appContext != null && appContext instanceof IEclipseContext) { >- IEclipseContext context = (IEclipseContext) appContext; >- IEclipseContext childContext = context.createChild(); >- childContext.set("innerKeyline", newColor); >- ContextInjectionFactory.inject(renderer, childContext); >+ Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); >+ if (cssContext != null && cssContext instanceof IEclipseContext) { >+ IEclipseContext context = (IEclipseContext) cssContext; >+ context.set("innerKeyline", newColor); >+ ContextInjectionFactory.inject(renderer, context); > } else { > Method[] methods = renderer.getClass().getMethods(); > for (int i = 0; i < methods.length; i++) { >Index: src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyOuterKeylineSWTHandler.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyOuterKeylineSWTHandler.java,v >retrieving revision 1.4 >diff -u -r1.4 CSSPropertyOuterKeylineSWTHandler.java >--- src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyOuterKeylineSWTHandler.java 28 May 2010 19:55:14 -0000 1.4 >+++ src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyOuterKeylineSWTHandler.java 30 Jun 2010 17:04:53 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.e4.ui.css.swt.properties.custom; > >+import java.util.HashMap; >+ > import java.lang.reflect.Method; > import org.eclipse.e4.core.contexts.ContextInjectionFactory; > import org.eclipse.e4.core.contexts.IEclipseContext; >@@ -24,6 +26,7 @@ > > public class CSSPropertyOuterKeylineSWTHandler extends AbstractCSSPropertySWTHandler { > >+ HashMap contexts = new HashMap(); > > public static final ICSSPropertyHandler INSTANCE = new CSSPropertyOuterKeylineSWTHandler(); > >@@ -35,10 +38,14 @@ > Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay()); > > CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); >- Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); >- if (appContext != null && appContext instanceof IEclipseContext) { >- IEclipseContext context = (IEclipseContext) appContext; >- IEclipseContext childContext = context.createChild(); >+ Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); >+ if (cssContext != null && cssContext instanceof IEclipseContext) { >+ IEclipseContext context = (IEclipseContext) cssContext; >+ IEclipseContext childContext = (IEclipseContext) contexts.get(control); >+ if (childContext == null) { >+ childContext = context.createChild(); >+ contexts.put(control, childContext); >+ } > childContext.set("outerKeyline", newColor); > ContextInjectionFactory.inject(renderer, childContext); > } else { >Index: src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyTabRendererSWTHandler.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyTabRendererSWTHandler.java,v >retrieving revision 1.6 >diff -u -r1.6 CSSPropertyTabRendererSWTHandler.java >--- src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyTabRendererSWTHandler.java 28 May 2010 20:17:13 -0000 1.6 >+++ src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyTabRendererSWTHandler.java 30 Jun 2010 17:04:53 -0000 >@@ -33,13 +33,12 @@ > if (((CSSPrimitiveValue) value).getPrimitiveType() == CSSPrimitiveValue.CSS_URI) { > String rendURL = ((CSSPrimitiveValue) value).getStringValue(); > >- Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); >- if (appContext != null && appContext instanceof IEclipseContext) { >- IEclipseContext context = (IEclipseContext) appContext; >- IEclipseContext childContext = context.createChild(); >- childContext.set(CTabFolder.class.getName(), control); >+ Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); >+ if (cssContext != null && cssContext instanceof IEclipseContext) { >+ IEclipseContext context = (IEclipseContext) cssContext; >+ context.set(CTabFolder.class.getName(), control); > IContributionFactory factory = (IContributionFactory) context.get(IContributionFactory.class.getName()); >- Object rend = factory.create(rendURL, childContext); >+ Object rend = factory.create(rendURL, context); > if (rend != null && rend instanceof CTabFolderRenderer){ > ((CTabFolder) control).setRenderer((CTabFolderRenderer)rend); > } >Index: src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java,v >retrieving revision 1.4 >diff -u -r1.4 CSSPropertyUnselectedTabsSWTHandler.java >--- src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java 28 May 2010 19:55:14 -0000 1.4 >+++ src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java 30 Jun 2010 17:04:53 -0000 >@@ -38,18 +38,17 @@ > folder.setBackground(colors, percents, true); > > CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); >- Object appContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); >- if (appContext != null && appContext instanceof IEclipseContext) { >- IEclipseContext context = (IEclipseContext) appContext; >- IEclipseContext childContext = context.createChild(); >+ Object cssContext = control.getDisplay().getData("org.eclipse.e4.ui.css.context"); >+ if (cssContext != null && cssContext instanceof IEclipseContext) { >+ IEclipseContext context = (IEclipseContext) cssContext; > if (pseudo != null && pseudo.equals("selected")) { >- childContext.set("activeToolbarColors", colors); >- childContext.set("activeToolbarPercents", percents); >+ context.set("activeToolbarColors", colors); >+ context.set("activeToolbarPercents", percents); > } else { >- childContext.set("inactiveToolbarColors", colors); >- childContext.set("inactiveToolbarPercents", percents); >+ context.set("inactiveToolbarColors", colors); >+ context.set("inactiveToolbarPercents", percents); > } >- ContextInjectionFactory.inject(renderer, childContext); >+ ContextInjectionFactory.inject(renderer, context); > } > } > } >#P org.eclipse.e4.ui.workbench.swt >Index: src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java,v >retrieving revision 1.25 >diff -u -r1.25 PartRenderingEngine.java >--- src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java 29 Jun 2010 19:22:43 -0000 1.25 >+++ src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java 30 Jun 2010 17:04:54 -0000 >@@ -23,6 +23,7 @@ > import org.eclipse.core.databinding.observable.Realm; > import org.eclipse.core.runtime.FileLocator; > import org.eclipse.e4.core.contexts.ContextInjectionFactory; >+import org.eclipse.e4.core.contexts.EclipseContextFactory; > import org.eclipse.e4.core.contexts.IContextConstants; > import org.eclipse.e4.core.contexts.IEclipseContext; > import org.eclipse.e4.core.di.IDisposable; >@@ -763,7 +764,11 @@ > final IThemeEngine engine = mgr.getEngineForDisplay(display); > > // Store the app context >- display.setData("org.eclipse.e4.ui.css.context", appContext); //$NON-NLS-1$ >+ IContributionFactory contribution = (IContributionFactory) appContext >+ .get(IContributionFactory.class.getName()); >+ IEclipseContext cssContext = EclipseContextFactory.create(); >+ cssContext.set(IContributionFactory.class.getName(), contribution); >+ display.setData("org.eclipse.e4.ui.css.context", cssContext); //$NON-NLS-1$ > > // Create the OSGi resource locator > if (cssResourcesURI != null) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 313950
:
169530
|
173128
|
173573
|
173721