diff options
| author | Simon Scholz | 2015-03-13 13:55:43 +0000 |
|---|---|---|
| committer | Lars Vogel | 2015-03-13 14:55:49 +0000 |
| commit | 1a8e2c9be826a222bef65fb84338c3c30fa9e183 (patch) | |
| tree | 95994dfe9c7023bd806314da579dca0163131786 | |
| parent | b45c3d8bb0985d131df54814b38ecdb060a0cfec (diff) | |
| download | eclipse.platform.ui-1a8e2c9be826a222bef65fb84338c3c30fa9e183.tar.gz eclipse.platform.ui-1a8e2c9be826a222bef65fb84338c3c30fa9e183.tar.xz eclipse.platform.ui-1a8e2c9be826a222bef65fb84338c3c30fa9e183.zip | |
Bug 462056 - [CSS] CSS for an editor is not applied any more
Change-Id: If9a285380b8304bfbc9bdfd83a7583ac93d9a1d0
Signed-off-by: Simon Scholz <simon.scholz@vogella.com>
| -rw-r--r-- | bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF | 3 | ||||
| -rw-r--r-- | bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java | 31 |
2 files changed, 26 insertions, 8 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF index 8f5f9a36740..fccafa57b86 100644 --- a/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF @@ -33,7 +33,8 @@ Require-Bundle: org.eclipse.equinox.registry;bundle-version="[3.5.0,4.0.0)", org.eclipse.equinox.ds, org.eclipse.equinox.event;resolution:=optional, org.eclipse.emf.ecore.xmi;bundle-version="2.7.0", - org.eclipse.e4.ui.model.workbench;bundle-version="1.0.0" + org.eclipse.e4.ui.model.workbench;bundle-version="1.0.0", + org.eclipse.e4.core.di.extensions Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: org.eclipse.e4.ui.internal.workbench.swt;x-friends:="org.eclipse.e4.ui.workbench.addons.swt,org.eclipse.e4.ui.workbench.renderers.swt,org.eclipse.ui.workbench", diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java index cb97865142c..6ef726a9af9 100644 --- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java +++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 IBM Corporation and others. + * Copyright (c) 2008, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Simon Scholz <simon.scholz@vogella.com> - Bug 462056 *******************************************************************************/ package org.eclipse.e4.ui.internal.workbench.swt; @@ -33,6 +34,7 @@ import org.eclipse.e4.core.contexts.EclipseContextFactory; import org.eclipse.e4.core.contexts.IEclipseContext; import org.eclipse.e4.core.di.InjectionException; import org.eclipse.e4.core.di.annotations.Optional; +import org.eclipse.e4.core.di.extensions.EventTopic; import org.eclipse.e4.core.services.contributions.IContributionFactory; import org.eclipse.e4.core.services.events.IEventBroker; import org.eclipse.e4.core.services.log.Logger; @@ -46,7 +48,6 @@ import org.eclipse.e4.ui.css.swt.theme.IThemeEngine; import org.eclipse.e4.ui.css.swt.theme.IThemeManager; import org.eclipse.e4.ui.di.Focus; import org.eclipse.e4.ui.di.PersistState; -import org.eclipse.e4.ui.di.UIEventTopic; import org.eclipse.e4.ui.internal.workbench.Activator; import org.eclipse.e4.ui.internal.workbench.E4Workbench; import org.eclipse.e4.ui.internal.workbench.Policy; @@ -112,7 +113,7 @@ public class PartRenderingEngine implements IPresentationEngine { @Inject @Optional - private void subscribeTopicToBeRendered(@UIEventTopic(UIEvents.UIElement.TOPIC_TOBERENDERED) Event event) { + private void subscribeTopicToBeRendered(@EventTopic(UIEvents.UIElement.TOPIC_TOBERENDERED) Event event) { MUIElement changedElement = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT); MElementContainer<?> parent = changedElement.getParent(); @@ -159,7 +160,7 @@ public class PartRenderingEngine implements IPresentationEngine { @Inject @Optional - private void subscribeVisibilityHandler(@UIEventTopic(UIEvents.UIElement.TOPIC_VISIBLE) Event event) { + private void subscribeVisibilityHandler(@EventTopic(UIEvents.UIElement.TOPIC_VISIBLE) Event event) { MUIElement changedElement = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT); MUIElement parent = changedElement.getParent(); @@ -211,7 +212,7 @@ public class PartRenderingEngine implements IPresentationEngine { @Inject @Optional - private void subscribeTrimHandler(@UIEventTopic(UIEvents.TrimmedWindow.TOPIC_TRIMBARS) Event event) { + private void subscribeTrimHandler(@EventTopic(UIEvents.TrimmedWindow.TOPIC_TRIMBARS) Event event) { Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT); if (!(changedObj instanceof MTrimmedWindow)) @@ -238,7 +239,7 @@ public class PartRenderingEngine implements IPresentationEngine { @Inject @Optional - private void subscribeChildrenHandler(@UIEventTopic(UIEvents.ElementContainer.TOPIC_CHILDREN) Event event) { + private void subscribeChildrenHandler(@EventTopic(UIEvents.ElementContainer.TOPIC_CHILDREN) Event event) { Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT); if (!(changedObj instanceof MElementContainer<?>)) @@ -319,11 +320,23 @@ public class PartRenderingEngine implements IPresentationEngine { @Inject @Optional - private void subscribeWindowsHandler(@UIEventTopic(UIEvents.Window.TOPIC_WINDOWS) Event event) { + private void subscribeWindowsHandler(@EventTopic(UIEvents.Window.TOPIC_WINDOWS) Event event) { subscribeChildrenHandler(event); } + @Inject + @Optional + private void subscribePerspectiveWindowsHandler(@EventTopic(UIEvents.Perspective.TOPIC_WINDOWS) Event event) { + subscribeChildrenHandler(event); + } + + @Inject + @Optional + private void subscribeCssThemeChanged(@EventTopic(IThemeEngine.Events.THEME_CHANGED) Event event) { + cssThemeChangedHandler.handleEvent(event); + } + private IEclipseContext appContext; protected Shell testShell; @@ -344,6 +357,8 @@ public class PartRenderingEngine implements IPresentationEngine { @Optional IEventBroker eventBroker; + private StylingPreferencesHandler cssThemeChangedHandler; + @Inject public PartRenderingEngine( @Named(E4Workbench.RENDERER_FACTORY_URI) @Optional String factoryUrl) { @@ -439,6 +454,8 @@ public class PartRenderingEngine implements IPresentationEngine { curFactory = factory; context.set(IRendererFactory.class, curFactory); + + cssThemeChangedHandler = new StylingPreferencesHandler(context.get(Display.class)); } private static void populateModelInterfaces(MContext contextModel, |
