Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian de Alwis2012-04-30 11:03:55 -0400
committerBrian de Alwis2012-04-30 11:03:55 -0400
commit4d9f7931a662556f7d2c14cc072c7e24c8bb4e4d (patch)
treedf54d528e6a0d2ea976feb7786010aba3d7b5964
parentd6dedc87192c35a36f8a93a51ab497bc11f9d55e (diff)
downloadorg.eclipse.e4.tools-4d9f7931a662556f7d2c14cc072c7e24c8bb4e4d.tar.gz
org.eclipse.e4.tools-4d9f7931a662556f7d2c14cc072c7e24c8bb4e4d.tar.xz
org.eclipse.e4.tools-4d9f7931a662556f7d2c14cc072c7e24c8bb4e4d.zip
Bug 369443 - [CSS] Provide mechanism to listen for theme changesv20120430-1503
Remove unused references to CSS engine from ThemeEngine
-rw-r--r--bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/contentassist/CSSProposalProvider.java31
-rw-r--r--bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/preferences/CSSEditorPreferences.java2
2 files changed, 3 insertions, 30 deletions
diff --git a/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/contentassist/CSSProposalProvider.java b/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/contentassist/CSSProposalProvider.java
index f316eb24..b5eaf4a9 100644
--- a/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/contentassist/CSSProposalProvider.java
+++ b/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/contentassist/CSSProposalProvider.java
@@ -13,14 +13,12 @@ import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.RegistryFactory;
import org.eclipse.e4.cSS.selector;
import org.eclipse.e4.cSS.impl.RulesImpl;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.internal.theme.ThemeEngine;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext;
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor;
+
/**
* see http://www.eclipse.org/Xtext/documentation/latest/xtext.html#contentAssist on how to customize content assistant
*/
@@ -28,12 +26,11 @@ public class CSSProposalProvider extends AbstractCSSProposalProvider {
String[] completions;
boolean init = false;
- CSSEngine engine;
void init() {
IExtensionRegistry registry = RegistryFactory.getRegistry();
IExtensionPoint extPoint = registry
- .getExtensionPoint("org.eclipse.e4.ui.css.swt.property.handler");
+ .getExtensionPoint("org.eclipse.e4.ui.css.core.propertyHandler");
ArrayList<IConfigurationElement> matchingElements = new ArrayList<IConfigurationElement>();
ArrayList<IConfigurationElement> controlAdapters = new ArrayList<IConfigurationElement>();
for (IExtension e : extPoint.getExtensions()) {
@@ -56,29 +53,7 @@ public class CSSProposalProvider extends AbstractCSSProposalProvider {
counter++;
}
- Object themeEngine = Display.getCurrent().getData("org.eclipse.e4.ui.css.swt.theme");
- if (themeEngine instanceof ThemeEngine) {
- engine = ((ThemeEngine) themeEngine).getCSSEngine();
- }
-// Shell[] shells = Display.getCurrent().getShells();
-// if (shells.length > 0) {
-// //This is from AbstractPartRenderer, should be in IPresentationEngine
-// String OWNING_ME = "modelElement"; //$NON-NLS-1$
-// Object obj = null;
-// for (int i = 0; i < shells.length; i++) {
-// obj = shells[i].getData(OWNING_ME);
-// if (obj != null) break;
-// }
-// if (obj != null && obj instanceof MTrimmedWindow) {
-// MTrimmedWindow context = (MTrimmedWindow) obj;
-// IStylingEngine stylingengine = (IStylingEngine) context.getContext().get(IStylingEngine.SERVICE_NAME);
-// engine = (CSSEngine) stylingengine.getEngine();
-// }
-// }
-// IEclipseContext context = application.getContext();
-// IStylingEngine engine = (IStylingEngine) context
-// .get(IStylingEngine.SERVICE_NAME);
-//
+ // engine = WidgetElement.getEngine(Display.getCurrent());
init = true;
// for (IExtension e : extPoint.getExtensions()) {
// for (IConfigurationElement ce : getPlatformMatches(e
diff --git a/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/preferences/CSSEditorPreferences.java b/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/preferences/CSSEditorPreferences.java
index 4c1d12a2..7b068470 100644
--- a/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/preferences/CSSEditorPreferences.java
+++ b/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/preferences/CSSEditorPreferences.java
@@ -180,7 +180,6 @@ public class CSSEditorPreferences extends PreferencePageEnhancer {
if (ss.size() > 0) {
// For now just get the first element
String path = ss.get(0);
- ((ThemeEngine) engine).getCSSEngine().getResourcesLocatorManager();
try {
styleSheetURL = FileLocator.toFileURL(new URL(path));
} catch (MalformedURLException e) {
@@ -227,7 +226,6 @@ public class CSSEditorPreferences extends PreferencePageEnhancer {
// For now just get the first element
String path = mod.get(0);
- ((ThemeEngine) engine).getCSSEngine().getResourcesLocatorManager();
try {
URL styleSheetURL = FileLocator.toFileURL(new URL(path));

Back to the top