Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Alexander Kuppe2013-04-15 14:17:12 +0000
committerMarkus Alexander Kuppe2013-04-15 14:32:51 +0000
commit2dd5ff9ade3d7c62376704d486936f20b8ffc89b (patch)
treeb97cf93ba63ff541657e68ed094d16a05bf1032e
parentadf7198158722bcea3a899c8824a528990c72277 (diff)
downloadorg.eclipse.e4.tools-2dd5ff9ade3d7c62376704d486936f20b8ffc89b.tar.gz
org.eclipse.e4.tools-2dd5ff9ade3d7c62376704d486936f20b8ffc89b.tar.xz
org.eclipse.e4.tools-2dd5ff9ade3d7c62376704d486936f20b8ffc89b.zip
NEW - bug 405728: Add tooltips to model editor I20130416-2200I20130415-2200
https://bugs.eclipse.org/bugs/show_bug.cgi?id=405728
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java2
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties2
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java49
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/PartEditor.java5
4 files changed, 53 insertions, 5 deletions
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 6f8e3005..6b16dce3 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
@@ -34,6 +34,7 @@ public class Messages {
public String ModelTooling_UIElement_AccessibilityPhrase;
public String ModelTooling_Context_Variables;
+ public String ModelTooling_Context_Variables_Tooltip;
public String ModelTooling_Context_Properties;
public String ModelTooling_ApplicationElement_Tags;
@@ -189,6 +190,7 @@ public class Messages {
public String PartEditor_IconURI;
public String PartEditor_ClassURI;
public String PartEditor_Closeable;
+ public String PartEditor_Closeable_Tooltip;
public String PartEditor_Menus;
public String PartEditor_Handlers;
public String PartEditor_ContainerData;
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 f39ae0e7..7671cdb5 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
@@ -30,6 +30,7 @@ ModelTooling_UIElement_VisibleWhen=Visible-When Expression
ModelTooling_UIElement_AccessibilityPhrase=Accessibility Phrase
ModelTooling_Context_Variables=Variables
+ModelTooling_Context_Variables_Tooltip=Declares the following variables to be modifiable in the local IEclipseContext (non-modifiable context variables will cause an IllegalArgumentException to be thrown if a modification attempt by a descendant context is made).
ModelTooling_Context_Properties=Context Properties
ModelTooling_ApplicationElement_Tags=Tags
@@ -189,6 +190,7 @@ PartEditor_Tooltip=Tooltip
PartEditor_IconURI=Icon URI
PartEditor_ClassURI=Class URI
PartEditor_Closeable=Closeable
+PartEditor_Closeable_Tooltip=If checked, the part can be closed by the user
PartEditor_Menus=Menus
PartEditor_Handlers=Handlers
PartEditor_ContainerData=Container Data
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java
index faaf89f4..905fa66c 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java
@@ -172,8 +172,15 @@ public class ControlFactory {
}
public static void createMapProperties(Composite parent, final Messages Messages, final AbstractComponentEditor editor, String label, final EStructuralFeature feature, int vIndent) {
+ createMapProperties(parent, Messages, editor, label, null, feature, vIndent);
+ }
+
+ public static void createMapProperties(Composite parent, final Messages Messages, final AbstractComponentEditor editor, String label, String tooltip, final EStructuralFeature feature, int vIndent) {
Label l = new Label(parent, SWT.NONE);
l.setText(label);
+ if (tooltip != null) {
+ l.setToolTipText(tooltip);
+ }
GridData gd = new GridData(GridData.END, GridData.BEGINNING, false, false);
gd.verticalIndent = vIndent;
l.setLayoutData(gd);
@@ -326,8 +333,15 @@ public class ControlFactory {
}
public static void createTextField(Composite parent, String label, IObservableValue master, EMFDataBindingContext context, IWidgetValueProperty textProp, IEMFEditValueProperty modelProp) {
- createTextField(parent, label, master, context, textProp, modelProp, null);
+ createTextField(parent, label, null, master, context, textProp, modelProp, null);
+ }
+ public static void createTextField(Composite parent, String label, String tooltip, IObservableValue master, EMFDataBindingContext context, IWidgetValueProperty textProp, IEMFEditValueProperty modelProp) {
+ createTextField(parent, label, tooltip, master, context, textProp, modelProp, null);
+ }
+
+ public static void createTextField(Composite parent, String label, IObservableValue master, EMFDataBindingContext context, IWidgetValueProperty textProp, IEMFEditValueProperty modelProp, final String warningText) {
+ createTextField(parent, label, null, master, context, textProp, modelProp, warningText);
}
/**
@@ -342,9 +356,12 @@ public class ControlFactory {
* Non null warningText means that a warning with this non-null
* text will be shown when the field is left empty
*/
- public static void createTextField(Composite parent, String label, IObservableValue master, EMFDataBindingContext context, IWidgetValueProperty textProp, IEMFEditValueProperty modelProp, final String warningText) {
+ public static void createTextField(Composite parent, String label, String tooltip, IObservableValue master, EMFDataBindingContext context, IWidgetValueProperty textProp, IEMFEditValueProperty modelProp, final String warningText) {
Label l = new Label(parent, SWT.NONE);
l.setText(label);
+ if (tooltip != null) {
+ l.setToolTipText(tooltip);
+ }
l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
final Text t = new Text(parent, SWT.BORDER);
@@ -382,8 +399,15 @@ public class ControlFactory {
}
public static void createTranslatedTextField(Composite parent, String label, IObservableValue master, EMFDataBindingContext context, IWidgetValueProperty textProp, IEMFEditValueProperty modelProp, IResourcePool resourcePool, IProject project) {
+ createTranslatedTextField(parent, label, null, master, context, textProp, modelProp, resourcePool, project);
+ }
+
+ public static void createTranslatedTextField(Composite parent, String label, String tooltip, IObservableValue master, EMFDataBindingContext context, IWidgetValueProperty textProp, IEMFEditValueProperty modelProp, IResourcePool resourcePool, IProject project) {
Label l = new Label(parent, SWT.NONE);
l.setText(label);
+ if (tooltip != null) {
+ l.setToolTipText(tooltip);
+ }
l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
final Text t = new Text(parent, SWT.BORDER);
@@ -499,9 +523,16 @@ public class ControlFactory {
}
public static void createBindingContextWiget(Composite parent, final Messages Messages, final AbstractComponentEditor editor, String label) {
+ createBindingContextWiget(parent, Messages, editor, label, null);
+ }
+
+ public static void createBindingContextWiget(Composite parent, final Messages Messages, final AbstractComponentEditor editor, String label, String tooltip) {
{
Label l = new Label(parent, SWT.NONE);
l.setText(label);
+ if (tooltip != null) {
+ l.setToolTipText(tooltip);
+ }
l.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
final TableViewer viewer = new TableViewer(parent);
@@ -609,8 +640,15 @@ public class ControlFactory {
}
public static void createStringListWidget(Composite parent, Messages Messages, final AbstractComponentEditor editor, String label, final EStructuralFeature feature, int vIndent) {
+ createStringListWidget(parent, Messages, editor, label, null, feature, vIndent);
+ }
+
+ public static void createStringListWidget(Composite parent, Messages Messages, final AbstractComponentEditor editor, String label, String tooltip, final EStructuralFeature feature, int vIndent) {
Label l = new Label(parent, SWT.NONE);
l.setText(label);
+ if (tooltip != null) {
+ l.setToolTipText(tooltip);
+ }
GridData gd = new GridData(GridData.END, GridData.BEGINNING, false, false);
gd.verticalIndent = vIndent;
l.setLayoutData(gd);
@@ -759,8 +797,15 @@ public class ControlFactory {
}
public static void createCheckBox(Composite parent, String label, IObservableValue master, EMFDataBindingContext context, IWidgetValueProperty selectionProp, IEMFEditValueProperty modelProp) {
+ createCheckBox(parent, label, null, master, context, selectionProp, modelProp);
+ }
+
+ public static void createCheckBox(Composite parent, String label, String tooltip, IObservableValue master, EMFDataBindingContext context, IWidgetValueProperty selectionProp, IEMFEditValueProperty modelProp) {
Label l = new Label(parent, SWT.NONE);
l.setText(label);
+ if (tooltip != null) {
+ l.setToolTipText(tooltip);
+ }
l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Button t = new Button(parent, SWT.CHECK);
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/PartEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/PartEditor.java
index 77c80b6f..fe7b3479 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/PartEditor.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/PartEditor.java
@@ -289,13 +289,12 @@ public class PartEditor extends AbstractComponentEditor {
createSubformElements(parent, context, master);
- ControlFactory.createCheckBox(parent, Messages.PartEditor_Closeable, getMaster(), context, WidgetProperties.selection(), EMFEditProperties.value(getEditingDomain(), BasicPackageImpl.Literals.PART__CLOSEABLE));
+ ControlFactory.createCheckBox(parent, Messages.PartEditor_Closeable, Messages.PartEditor_Closeable_Tooltip, getMaster(), context, WidgetProperties.selection(), EMFEditProperties.value(getEditingDomain(), BasicPackageImpl.Literals.PART__CLOSEABLE));
// ------------------------------------------------------------
ControlFactory.createCheckBox(parent, Messages.ModelTooling_UIElement_ToBeRendered, getMaster(), context, WidgetProperties.selection(), EMFEditProperties.value(getEditingDomain(), UiPackageImpl.Literals.UI_ELEMENT__TO_BE_RENDERED));
ControlFactory.createCheckBox(parent, Messages.ModelTooling_UIElement_Visible, getMaster(), context, WidgetProperties.selection(), EMFEditProperties.value(getEditingDomain(), UiPackageImpl.Literals.UI_ELEMENT__VISIBLE));
- ControlFactory.createBindingContextWiget(parent, Messages, this, Messages.PartEditor_BindingContexts);
ControlFactory.createMapProperties(parent, Messages, this, Messages.ModelTooling_Contribution_PersistedState, ApplicationPackageImpl.Literals.APPLICATION_ELEMENT__PERSISTED_STATE, VERTICAL_LIST_WIDGET_INDENT);
ControlFactory.createMapProperties(parent, Messages, this, Messages.ModelTooling_Context_Properties, UiPackageImpl.Literals.CONTEXT__PROPERTIES, VERTICAL_LIST_WIDGET_INDENT);
@@ -305,7 +304,7 @@ public class PartEditor extends AbstractComponentEditor {
parent = createScrollableContainer(folder);
item.setControl(parent.getParent());
- ControlFactory.createStringListWidget(parent, Messages, this, Messages.ModelTooling_Context_Variables, UiPackageImpl.Literals.CONTEXT__VARIABLES, VERTICAL_LIST_WIDGET_INDENT);
+ ControlFactory.createStringListWidget(parent, Messages, this, Messages.ModelTooling_Context_Variables, Messages.ModelTooling_Context_Variables_Tooltip, UiPackageImpl.Literals.CONTEXT__VARIABLES, VERTICAL_LIST_WIDGET_INDENT);
ControlFactory.createStringListWidget(parent, Messages, this, Messages.CategoryEditor_Tags, ApplicationPackageImpl.Literals.APPLICATION_ELEMENT__TAGS, VERTICAL_LIST_WIDGET_INDENT);
if (project == null) {

Back to the top