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 173573 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]
go back to Method.invoke
patch-318798-just-call-the-method.txt (text/plain), 9.76 KB, created by
Boris Bokowski
on 2010-07-06 11:47:04 EDT
(
hide
)
Description:
go back to Method.invoke
Filename:
MIME Type:
Creator:
Boris Bokowski
Created:
2010-07-06 11:47:04 EDT
Size:
9.76 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.6 >diff -u -r1.6 CSSPropertyCornerRadiusSWTHandler.java >--- src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyCornerRadiusSWTHandler.java 30 Jun 2010 17:05:46 -0000 1.6 >+++ src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyCornerRadiusSWTHandler.java 5 Jul 2010 20:43:45 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.e4.ui.css.swt.properties.custom; > >+import java.lang.reflect.Method; >+ > import org.eclipse.e4.core.contexts.ContextInjectionFactory; > import org.eclipse.e4.core.contexts.IEclipseContext; > import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler; >@@ -33,13 +35,9 @@ > int radiusValue = (int) ((CSSPrimitiveValue) value).getFloatValue(CSSPrimitiveValue.CSS_NUMBER); > > CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); >- >- 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); >- } >+ >+ Method m = renderer.getClass().getDeclaredMethod("setRadius", new Class[]{Integer.class}); >+ m.invoke(renderer, Integer.valueOf(radiusValue)); > } > } > >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.5 >diff -u -r1.5 CSSPropertyInnerKeylineSWTHandler.java >--- src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyInnerKeylineSWTHandler.java 30 Jun 2010 17:05:46 -0000 1.5 >+++ src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyInnerKeylineSWTHandler.java 5 Jul 2010 20:43:45 -0000 >@@ -35,20 +35,9 @@ > Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay()); > > CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); >- 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++) { >- Method m = methods[i]; >- if (m.getName().toLowerCase().contains("setinnerkeyline")) { >- m.invoke(renderer, newColor); >- } >- } >- } >+ >+ Method m = renderer.getClass().getDeclaredMethod("setInnerKeyline", new Class[]{Color.class}); >+ m.invoke(renderer, newColor); > } > } > >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.5 >diff -u -r1.5 CSSPropertyOuterKeylineSWTHandler.java >--- src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyOuterKeylineSWTHandler.java 30 Jun 2010 17:05:46 -0000 1.5 >+++ src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyOuterKeylineSWTHandler.java 5 Jul 2010 20:43:45 -0000 >@@ -38,25 +38,9 @@ > Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay()); > > CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); >- 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 { >- Method[] methods = renderer.getClass().getMethods(); >- for (int i = 0; i < methods.length; i++) { >- Method m = methods[i]; >- if (m.getName().toLowerCase().contains("setouterkeyline")) { >- m.invoke(renderer, newColor); >- } >- } >- } >+ >+ Method m = renderer.getClass().getMethod("setOuterKeyline", new Class[]{Color.class}); >+ m.invoke(renderer, newColor); > } > } > >Index: src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyShadowVisibleSWTHandler.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/CSSPropertyShadowVisibleSWTHandler.java,v >retrieving revision 1.5 >diff -u -r1.5 CSSPropertyShadowVisibleSWTHandler.java >--- src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyShadowVisibleSWTHandler.java 28 May 2010 20:17:13 -0000 1.5 >+++ src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyShadowVisibleSWTHandler.java 5 Jul 2010 20:43:45 -0000 >@@ -10,6 +10,9 @@ > *******************************************************************************/ > package org.eclipse.e4.ui.css.swt.properties.custom; > >+import java.lang.reflect.Method; >+import org.eclipse.swt.graphics.Color; >+ > import org.eclipse.e4.core.contexts.ContextInjectionFactory; > import org.eclipse.e4.core.contexts.IEclipseContext; > import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler; >@@ -32,13 +35,9 @@ > > 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("shadowVisible", new Boolean(shadowVisible)); >- ContextInjectionFactory.inject(renderer, childContext); >- } >+ Method m = renderer.getClass().getDeclaredMethod("setShadowVisible", new Class[]{Boolean.class}); >+ m.invoke(renderer, Boolean.valueOf(shadowVisible)); >+ > } > > protected String retrieveCSSProperty(Control control, String property, >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.5 >diff -u -r1.5 CSSPropertyUnselectedTabsSWTHandler.java >--- src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java 30 Jun 2010 17:05:46 -0000 1.5 >+++ src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java 5 Jul 2010 20:43:45 -0000 >@@ -8,6 +8,10 @@ > *******************************************************************************/ > package org.eclipse.e4.ui.css.swt.properties.custom; > >+import java.lang.reflect.Array; >+ >+import java.lang.reflect.Method; >+ > import org.eclipse.e4.core.contexts.ContextInjectionFactory; > import org.eclipse.e4.core.contexts.IEclipseContext; > import org.eclipse.e4.ui.css.core.dom.properties.Gradient; >@@ -38,17 +42,13 @@ > folder.setBackground(colors, percents, true); > > CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer(); >- 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")) { >- context.set("activeToolbarColors", colors); >- context.set("activeToolbarPercents", percents); >- } else { >- context.set("inactiveToolbarColors", colors); >- context.set("inactiveToolbarPercents", percents); >- } >- ContextInjectionFactory.inject(renderer, context); >+ >+ if (pseudo != null && pseudo.equals("selected")) { >+ Method m = renderer.getClass().getDeclaredMethod("setActiveToolbarGradient", new Class[]{Color[].class, int[].class}); >+ m.invoke(renderer, colors, percents); >+ } else { >+ Method m = renderer.getClass().getDeclaredMethod("setInactiveToolbarGradient", new Class[]{Color[].class, int[].class}); >+ m.invoke(renderer, colors, percents); > } > } > } >#P org.eclipse.e4.ui.workbench.renderers.swt >Index: src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java,v >retrieving revision 1.5 >diff -u -r1.5 CTabRendering.java >--- src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java 27 Jun 2010 08:28:28 -0000 1.5 >+++ src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java 5 Jul 2010 20:43:45 -0000 >@@ -867,7 +867,7 @@ > > @Inject > @Optional >- public void setCornerRadius(@Named("radius") Integer radius) { >+ public void setRadius(@Named("radius") Integer radius) { > cornerSize = radius.intValue(); > parent.redraw(); > }
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