aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-03-26 10:13:55 (EDT)
committerOleg Besedin2012-03-26 10:14:30 (EDT)
commit1db853b1f3d85838a00b9f813e7a380bab388959 (patch)
treea01923f9c88de1f1da7c932fc8adefcf611dfdf0
parentdf1c03fce34e53b69b11d512acb76821b5b0f883 (diff)
downloadeclipse.platform.ui-1db853b1f3d85838a00b9f813e7a380bab388959.zip
eclipse.platform.ui-1db853b1f3d85838a00b9f813e7a380bab388959.tar.gz
eclipse.platform.ui-1db853b1f3d85838a00b9f813e7a380bab388959.tar.bz2
Bug 375264 - E4 Contacts Demo's theme toolbars and menus grow after each
execution
-rw-r--r--examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/MenuThemeProcessor.java22
-rw-r--r--examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/ToolbarThemeProcessor.java22
2 files changed, 42 insertions, 2 deletions
diff --git a/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/MenuThemeProcessor.java b/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/MenuThemeProcessor.java
index afec62a..1e5e352 100644
--- a/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/MenuThemeProcessor.java
+++ b/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/MenuThemeProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 BestSolution.at, Siemens AG and others.
+ * Copyright (c) 2010, 2012 BestSolution.at, Siemens AG and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -12,6 +12,9 @@
******************************************************************************/
package org.eclipse.e4.demo.contacts.processors;
+import java.util.List;
+import org.eclipse.e4.core.di.annotations.Execute;
+
import javax.inject.Inject;
import javax.inject.Named;
import org.eclipse.e4.ui.model.application.MApplication;
@@ -32,6 +35,23 @@ public class MenuThemeProcessor extends AbstractThemeProcessor {
@Named("menu:org.eclipse.ui.main.menu")
private MMenu menu;
private MMenu themesMenu;
+
+ private final static String PROCESSOR_ID = "org.eclipse.e4.demo.contacts.processor.menu";
+
+ @Execute
+ public void process() {
+
+ MApplication theApp = getApplication();
+ List<String> tags = theApp.getTags();
+ for(String tag : tags) {
+ if (PROCESSOR_ID.equals(tag))
+ return; // already processed
+ }
+ if (!check())
+ return;
+ tags.add(PROCESSOR_ID);
+ super.process();
+ }
@Override
protected boolean check() {
diff --git a/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/ToolbarThemeProcessor.java b/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/ToolbarThemeProcessor.java
index a9eeeed..9b4f6a5 100644
--- a/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/ToolbarThemeProcessor.java
+++ b/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/ToolbarThemeProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Siemens AG and others.
+ * Copyright (c) 2010, 2012 Siemens AG and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -12,6 +12,9 @@
package org.eclipse.e4.demo.contacts.processors;
+import java.util.List;
+import org.eclipse.e4.core.di.annotations.Execute;
+
import javax.inject.Inject;
import javax.inject.Named;
import org.eclipse.e4.ui.model.application.MApplication;
@@ -28,6 +31,23 @@ public class ToolbarThemeProcessor extends AbstractThemeProcessor {
@Named("toolbar:org.eclipse.ui.main.toolbar")
private MToolBar toolbar;
+ private final static String PROCESSOR_ID = "org.eclipse.e4.demo.contacts.processor.toolbar";
+
+ @Execute
+ public void process() {
+
+ MApplication theApp = getApplication();
+ List<String> tags = theApp.getTags();
+ for(String tag : tags) {
+ if (PROCESSOR_ID.equals(tag))
+ return; // already processed
+ }
+ if (!check())
+ return;
+ tags.add(PROCESSOR_ID);
+ super.process();
+ }
+
@Override
protected boolean check() {
return toolbar != null;