Bug 510341 - [ModelEditor] Should add tooltips on menuContribution
dialog

Change-Id: Ia0d397e1f81ebb9916866114003493614c88eaf5
Signed-off-by: Olivier Prouvost <olivier.prouvost@opcoach.com>
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java
index 5a8ca3e..6938dcd 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java
@@ -381,7 +381,9 @@
 	public String MenuContributionEditor_Menu;
 	public String MenuContributionEditor_DirectMenuItem;
 	public String MenuContributionEditor_ParentId;
+	public String MenuContributionEditor_ParentIdTooltip;
 	public String MenuContributionEditor_Position;
+	public String MenuContributionEditor_PositionTooltip;
 	public String MenuContributionEditor_TreeLabel;
 	public String MenuContributionEditor_TreeLabelDescription;
 
@@ -448,6 +450,10 @@
 
 	public String ToolBarContributionEditor_TreeLabel;
 	public String ToolBarContributionEditor_TreeLabelDescription;
+	public String ToolBarContributionEditor_ParentId;
+	public String ToolBarContributionEditor_ParentIdTooltip;
+	public String ToolBarContributionEditor_Position;
+	public String ToolBarContributionEditor_PositionTooltip;
 
 	public String ToolItemEditor_Type;
 	public String ToolItemEditor_Label;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
index de985ce..6dd52c1 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
@@ -349,7 +349,9 @@
 MenuContributionEditor_Menu=Menu
 MenuContributionEditor_DirectMenuItem=Direct Menu Item
 MenuContributionEditor_ParentId=Parent-ID
+MenuContributionEditor_ParentIdTooltip=This is the id of the menu or the part into which the contributions should be added. Use 'org.eclipse.ui.main.menu' to contribute to the main menu and use 'popup' to handle contributions which are candidates to appear on any (top level) context menu. 
 MenuContributionEditor_Position=Position
+MenuContributionEditor_PositionTooltip=This is the position of the contribution. It has the form "[placement]=[id]" where placement is one of "before", "after", or "endof" and the id is expected to be the id of something in the menu.
 MenuContributionEditor_TreeLabel=Menu Contribution
 MenuContributionEditor_TreeLabelDescription=Menu Contribution 
 
@@ -421,7 +423,12 @@
 RenderedToolBarEditor_TreeLabel=Rendered ToolBar
 
 ToolBarContributionEditor_TreeLabel=ToolBar Contribution
-ToolBarContributionEditor_TreeLabelDescription=ToolBar Contribution 
+ToolBarContributionEditor_TreeLabelDescription=ToolBar Contribution
+ToolBarContributionEditor_ParentId=Parent-ID
+ToolBarContributionEditor_ParentIdTooltip=This is the id of the toolbar or the part into which the contributions should be added. Use 'org.eclipse.ui.main.toolbar' to contribute to the main toolbar. 
+ToolBarContributionEditor_Position=Position
+ToolBarContributionEditor_PositionTooltip=This is the position of the contribution. It has the form "[placement]=[id]" where placement is one of "before", "after", or "endof" and the id is expected to be the id of something in the toolbar.
+
 
 ToolItemEditor_Type=Type
 ToolItemEditor_Label=Label
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/MenuContributionEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/MenuContributionEditor.java
index 3192a17..bae6a1c 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/MenuContributionEditor.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/MenuContributionEditor.java
@@ -209,6 +209,7 @@
 		{
 			final Label l = new Label(parent, SWT.NONE);
 			l.setText(Messages.MenuContributionEditor_ParentId);
+			l.setToolTipText(Messages.MenuContributionEditor_ParentIdTooltip);
 			l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
 
 			final Text t = new Text(parent, SWT.BORDER);
@@ -235,7 +236,8 @@
 		}
 
 		ControlFactory
-		.createTextField(parent, Messages.MenuContributionEditor_Position, master, context, textProp,
+				.createTextField(parent, Messages.MenuContributionEditor_Position,
+						Messages.MenuContributionEditor_PositionTooltip, master, context, textProp,
 				EMFEditProperties.value(getEditingDomain(),
 						MenuPackageImpl.Literals.MENU_CONTRIBUTION__POSITION_IN_PARENT));
 
@@ -276,8 +278,8 @@
 					defaultStruct,
 					new Struct(Messages.MenuContributionEditor_DirectMenuItem, MenuPackageImpl.Literals.DIRECT_MENU_ITEM,
 							false),
-							new Struct(Messages.MenuContributionEditor_DynamicMenuContribution,
-									MenuPackageImpl.Literals.DYNAMIC_MENU_CONTRIBUTION, false) });
+					new Struct(Messages.MenuContributionEditor_DynamicMenuContribution,
+							MenuPackageImpl.Literals.DYNAMIC_MENU_CONTRIBUTION, false) });
 			pickList.setSelection(new StructuredSelection(defaultStruct));
 
 		}
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ToolBarContributionEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ToolBarContributionEditor.java
index bf16bd6..9cddb17 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ToolBarContributionEditor.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ToolBarContributionEditor.java
@@ -211,7 +211,8 @@
 
 		{
 			final Label l = new Label(parent, SWT.NONE);
-			l.setText(Messages.MenuContributionEditor_ParentId);
+			l.setText(Messages.ToolBarContributionEditor_ParentId);
+			l.setToolTipText(Messages.ToolBarContributionEditor_ParentIdTooltip);
 			l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
 
 			final Text t = new Text(parent, SWT.BORDER);
@@ -236,7 +237,8 @@
 			});
 		}
 
-		ControlFactory.createTextField(parent, Messages.MenuContributionEditor_Position, master, context, textProp,
+		ControlFactory.createTextField(parent, Messages.ToolBarContributionEditor_Position,
+				Messages.ToolBarContributionEditor_PositionTooltip, master, context, textProp,
 				EMFEditProperties.value(getEditingDomain(),
 						MenuPackageImpl.Literals.TOOL_BAR_CONTRIBUTION__POSITION_IN_PARENT));