summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorSopot Cela2013-11-19 04:06:29 (EST)
committer Gerrit Code Review @ Eclipse.org2013-11-27 10:45:15 (EST)
commit2567dba51f81fdcf892197c4eca533f3ce5fa57e (patch)
tree3ec549c3c37a6939b144f689abad92034a74e466
parent3b3894f712dd09df69050b01fa492960a9705a96 (diff)
downloadeclipse.platform.ui-2567dba51f81fdcf892197c4eca533f3ce5fa57e.zip
eclipse.platform.ui-2567dba51f81fdcf892197c4eca533f3ce5fa57e.tar.gz
eclipse.platform.ui-2567dba51f81fdcf892197c4eca533f3ce5fa57e.tar.bz2
Bug 318435 - [Contributions] Changes in the application model for therefs/changes/18/18518/4
menu are not reflected in the user interface Change-Id: I8da9d3c4d0fa01ee7cad85f920cad923c455e6e8 Signed-off-by: Sopot Cela <sopotcela@gmail.com>
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java13
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/action/MenuManager.java16
2 files changed, 24 insertions, 5 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java
index e091e12..349c942 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java
@@ -7,7 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Marco Descher <marco@descher.at> - Bug 389063, Bug 398865, Bug 398866, Bug 405471
+ * Marco Descher <marco@descher.at> - Bug 389063, Bug 398865, Bug 398866, Bug 405471
+ * Sopot Cela <sopotcela@gmail.com>
*******************************************************************************/
package org.eclipse.e4.ui.workbench.renderers.swt;
@@ -59,6 +60,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.AbstractGroupMarker;
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
@@ -133,14 +135,15 @@ public class MenuManagerRenderer extends SWTPartRenderer {
.getProperty(UIEvents.EventTags.ATTNAME);
MMenu model = (MMenu) event.getProperty(UIEvents.EventTags.ELEMENT);
MenuManager manager = getManager(model);
- Menu menu = manager.getMenu();
- if ((menu == null) || (menu.getParentItem() == null))
+ if ((manager == null))
return;
if (UIEvents.UILabel.LABEL.equals(attName)) {
- menu.getParentItem().setText(getText(model));
+ manager.setMenuText(getText(model));
+ manager.update(IAction.TEXT);
}
if (UIEvents.UILabel.ICONURI.equals(attName)) {
- menu.getParentItem().setImage(getImage(model));
+ manager.setImageDescriptor(getImageDescriptor(model));
+ manager.update(IAction.IMAGE);
}
}
};
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/MenuManager.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/MenuManager.java
index 61838e4..57f7402 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/MenuManager.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/MenuManager.java
@@ -1010,4 +1010,20 @@ public class MenuManager extends ContributionManager implements IMenuManager {
}
return item.isVisible();
}
+
+ /**
+ * @param menuText The text (label) of the menu.
+ * @since 3.10
+ */
+ public void setMenuText(String menuText) {
+ this.menuText = menuText;
+ }
+
+ /**
+ * @param imageDescriptor The image descriptor to set.
+ * @since 3.10
+ */
+ public void setImageDescriptor(ImageDescriptor imageDescriptor) {
+ this.image = imageDescriptor;
+ }
}