Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane Bégaudeau2016-02-22 09:14:42 -0500
committerStéphane Bégaudeau2016-02-22 09:31:52 -0500
commit315b65564a8e76ccc591ca5b61a1e0c39cbdb212 (patch)
tree69b91da48ed5c00c41560e126b7bd1519914f809
parent3e60da48465b513b5c1b7dc92d6fe4f03762384a (diff)
downloadorg.eclipse.eef-315b65564a8e76ccc591ca5b61a1e0c39cbdb212.tar.gz
org.eclipse.eef-315b65564a8e76ccc591ca5b61a1e0c39cbdb212.tar.xz
org.eclipse.eef-315b65564a8e76ccc591ca5b61a1e0c39cbdb212.zip
Adds support for help tooltips
Change-Id: Ic62933c13710a826111be6f75e162b5837dd0de4 Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFWidgetController.java13
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/AbstractEEFWidgetController.java37
-rw-r--r--plugins/org.eclipse.eef.edit/plugin.properties1
-rw-r--r--plugins/org.eclipse.eef.edit/src-gen/org/eclipse/eef/provider/EEFWidgetDescriptionItemProvider.java16
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/properties/EEFSection.java6
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/AbstractEEFWidgetLifecycleManager.java23
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFButtonLifecycleManager.java11
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFCheckboxLifecycleManager.java11
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java11
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFRadioLifecycleManager.java11
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java11
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java11
-rw-r--r--plugins/org.eclipse.eef/model/eef.ecore5
-rw-r--r--plugins/org.eclipse.eef/src-gen/org/eclipse/eef/EEFWidgetDescription.java24
-rw-r--r--plugins/org.eclipse.eef/src-gen/org/eclipse/eef/EefPackage.java77
-rw-r--r--plugins/org.eclipse.eef/src-gen/org/eclipse/eef/impl/EEFWidgetDescriptionImpl.java59
-rw-r--r--plugins/org.eclipse.eef/src-gen/org/eclipse/eef/impl/EefPackageImpl.java15
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java14
18 files changed, 345 insertions, 11 deletions
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFWidgetController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFWidgetController.java
index c10f0ea7a..0b79f428d 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFWidgetController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFWidgetController.java
@@ -32,6 +32,19 @@ public interface IEEFWidgetController {
void removeNewLabelConsumer();
/**
+ * Registers a consumer which will be called with the new value of the help.
+ *
+ * @param consumer
+ * The consumer of the new value of the help
+ */
+ void onNewHelp(IConsumer<String> consumer);
+
+ /**
+ * Removes the consumer of the new value of the help.
+ */
+ void removeNewHelpConsumer();
+
+ /**
* Registers a consumer which will be called with the validation status.
*
* @param consumer
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/AbstractEEFWidgetController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/AbstractEEFWidgetController.java
index 8efc97c5c..064f632f2 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/AbstractEEFWidgetController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/AbstractEEFWidgetController.java
@@ -40,6 +40,11 @@ public abstract class AbstractEEFWidgetController extends AbstractEEFController
protected IConsumer<String> newLabelConsumer;
/**
+ * The consumer of the new value of the help.
+ */
+ protected IConsumer<String> newHelpConsumer;
+
+ /**
* The consumer of the validation messages.
*/
protected IConsumer<List<IValidationMessage>> validationConsumer;
@@ -86,6 +91,26 @@ public abstract class AbstractEEFWidgetController extends AbstractEEFController
/**
* {@inheritDoc}
*
+ * @see org.eclipse.eef.core.api.controllers.IEEFWidgetController#onNewHelp(org.eclipse.eef.core.api.controllers.IConsumer)
+ */
+ @Override
+ public void onNewHelp(IConsumer<String> consumer) {
+ this.newHelpConsumer = consumer;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.eef.core.api.controllers.IEEFWidgetController#removeNewHelpConsumer()
+ */
+ @Override
+ public void removeNewHelpConsumer() {
+ this.newHelpConsumer = null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.eef.core.api.controllers.IEEFWidgetController#onValidation(org.eclipse.eef.core.api.controllers.IConsumer)
*/
@Override
@@ -111,15 +136,23 @@ public abstract class AbstractEEFWidgetController extends AbstractEEFController
@Override
public void refresh() {
String labelExpression = this.getDescription().getLabelExpression();
- EAttribute eAttribute = EefPackage.Literals.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION;
+ EAttribute labelEAttribute = EefPackage.Literals.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION;
- this.newEval().call(eAttribute, labelExpression, String.class, new ISuccessfulResultConsumer<String>() {
+ this.newEval().call(labelEAttribute, labelExpression, String.class, new ISuccessfulResultConsumer<String>() {
@Override
public void apply(String value) {
AbstractEEFWidgetController.this.newLabelConsumer.apply(value);
}
});
+ String helpExpression = this.getDescription().getHelpExpression();
+ this.newEval().call(helpExpression, String.class, new ISuccessfulResultConsumer<String>() {
+ @Override
+ public void apply(String value) {
+ AbstractEEFWidgetController.this.newHelpConsumer.apply(value);
+ }
+ });
+
// TODO [SBE][Validation] TO BE REMOVED FOR REAL VALIDATION RULES
Object self = this.variableManager.getVariables().get(EEFExpressionUtils.SELF);
diff --git a/plugins/org.eclipse.eef.edit/plugin.properties b/plugins/org.eclipse.eef.edit/plugin.properties
index 8ec9bb415..812333b72 100644
--- a/plugins/org.eclipse.eef.edit/plugin.properties
+++ b/plugins/org.eclipse.eef.edit/plugin.properties
@@ -74,3 +74,4 @@ _UI_EEFDynamicMappingFor_ifs_feature = Ifs
_UI_EEFDynamicMappingIf_predicateExpression_feature = Predicate Expression
_UI_EEFDynamicMappingIf_widget_feature = Widget
_UI_EEFLabelDescription_bodyExpression_feature = Body Expression
+_UI_EEFWidgetDescription_helpExpression_feature = Help Expression
diff --git a/plugins/org.eclipse.eef.edit/src-gen/org/eclipse/eef/provider/EEFWidgetDescriptionItemProvider.java b/plugins/org.eclipse.eef.edit/src-gen/org/eclipse/eef/provider/EEFWidgetDescriptionItemProvider.java
index 660db65e8..c0c7815d1 100644
--- a/plugins/org.eclipse.eef.edit/src-gen/org/eclipse/eef/provider/EEFWidgetDescriptionItemProvider.java
+++ b/plugins/org.eclipse.eef.edit/src-gen/org/eclipse/eef/provider/EEFWidgetDescriptionItemProvider.java
@@ -56,6 +56,7 @@ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
addIdentifierPropertyDescriptor(object);
addLabelExpressionPropertyDescriptor(object);
+ addHelpExpressionPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -87,6 +88,20 @@ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
}
/**
+ * This adds a property descriptor for the Help Expression feature. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addHelpExpressionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_EEFWidgetDescription_helpExpression_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_EEFWidgetDescription_helpExpression_feature", "_UI_EEFWidgetDescription_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ EefPackage.Literals.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null,
+ null));
+ }
+
+ /**
* This returns EEFWidgetDescription.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -132,6 +147,7 @@ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
switch (notification.getFeatureID(EEFWidgetDescription.class)) {
case EefPackage.EEF_WIDGET_DESCRIPTION__IDENTIFIER:
case EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION:
+ case EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/properties/EEFSection.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/properties/EEFSection.java
index 223fccdeb..f375ed194 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/properties/EEFSection.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/properties/EEFSection.java
@@ -189,8 +189,10 @@ public class EEFSection implements IEEFSection {
InputDescriptor input = Platform.getAdapterManager().getAdapter(object, InputDescriptor.class);
- // TODO we should create a whole context with the current selection etc for the context
- this.eefSectionDescriptor.getEEFPage().getView().setInput(input);
+ if (input != null) {
+ // TODO we should create a whole context with the current selection etc for the context
+ this.eefSectionDescriptor.getEEFPage().getView().setInput(input);
+ }
}
}
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/AbstractEEFWidgetLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/AbstractEEFWidgetLifecycleManager.java
index 3cac98f98..eceefe099 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/AbstractEEFWidgetLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/AbstractEEFWidgetLifecycleManager.java
@@ -11,8 +11,9 @@
package org.eclipse.eef.ide.ui.internal.widgets;
import java.util.List;
-import java.util.Random;
+import org.eclipse.eef.EEFWidgetDescription;
+import org.eclipse.eef.common.api.utils.Util;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.core.api.controllers.IValidationMessage;
@@ -128,7 +129,7 @@ public abstract class AbstractEEFWidgetLifecycleManager implements ILifecycleMan
Control control = this.getValidationControl();
- boolean hasHelp = new Random().nextBoolean(); // [SBE] yes, I know, to be removed :)
+ boolean hasHelp = !Util.isBlank(this.getWidgetDescription().getHelpExpression());
int gap = GAP_WITHOUT_HELP;
if (hasHelp) {
@@ -149,11 +150,18 @@ public abstract class AbstractEEFWidgetLifecycleManager implements ILifecycleMan
helpFormData.left = new FormAttachment(this.label);
this.help.setLayoutData(helpFormData);
this.help.setImage(EEFIdeUiPlugin.getPlugin().getImageRegistry().get(Icons.HELP));
- this.help.setToolTipText("There should be some help in this tooltip..."); //$NON-NLS-1$
+ this.help.setToolTipText(""); //$NON-NLS-1$
}
}
/**
+ * Returns the description of the widget.
+ *
+ * @return The description of the widget
+ */
+ protected abstract EEFWidgetDescription getWidgetDescription();
+
+ /**
* Create the main control.
*
* @param parent
@@ -186,6 +194,15 @@ public abstract class AbstractEEFWidgetLifecycleManager implements ILifecycleMan
}
});
+ this.getController().onNewHelp(new IConsumer<String>() {
+ @Override
+ public void apply(String value) {
+ if (help != null && !help.isDisposed() && !(help.getText() != null && help.getText().equals(value))) {
+ help.setToolTipText(value);
+ }
+ }
+ });
+
this.getController().onValidation(new IConsumer<List<IValidationMessage>>() {
@Override
public void apply(List<IValidationMessage> messages) {
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFButtonLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFButtonLifecycleManager.java
index a4c48d560..237eb7ef4 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFButtonLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFButtonLifecycleManager.java
@@ -11,6 +11,7 @@
package org.eclipse.eef.ide.ui.internal.widgets;
import org.eclipse.eef.EEFButtonDescription;
+import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFButtonController;
@@ -109,6 +110,16 @@ public class EEFButtonLifecycleManager extends AbstractEEFWidgetLifecycleManager
return this.controller;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.eef.ide.ui.internal.widgets.AbstractEEFWidgetLifecycleManager#getWidgetDescription()
+ */
+ @Override
+ protected EEFWidgetDescription getWidgetDescription() {
+ return this.description;
+ }
+
@Override
public void aboutToBeShown() {
super.aboutToBeShown();
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFCheckboxLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFCheckboxLifecycleManager.java
index d6e293036..d34ecf599 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFCheckboxLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFCheckboxLifecycleManager.java
@@ -11,6 +11,7 @@
package org.eclipse.eef.ide.ui.internal.widgets;
import org.eclipse.eef.EEFCheckboxDescription;
+import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFCheckboxController;
@@ -116,6 +117,16 @@ public class EEFCheckboxLifecycleManager extends AbstractEEFWidgetLifecycleManag
/**
* {@inheritDoc}
*
+ * @see org.eclipse.eef.ide.ui.internal.widgets.AbstractEEFWidgetLifecycleManager#getWidgetDescription()
+ */
+ @Override
+ protected EEFWidgetDescription getWidgetDescription() {
+ return this.description;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.eef.ide.ui.internal.widgets.ILifecycleManager#aboutToBeShown()
*/
@Override
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java
index 71cf17a22..0a1ef7273 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java
@@ -11,6 +11,7 @@
package org.eclipse.eef.ide.ui.internal.widgets;
import org.eclipse.eef.EEFLabelDescription;
+import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFLabelController;
@@ -128,6 +129,16 @@ public class EEFLabelLifecycleManager extends AbstractEEFWidgetLifecycleManager
/**
* {@inheritDoc}
*
+ * @see org.eclipse.eef.ide.ui.internal.widgets.AbstractEEFWidgetLifecycleManager#getWidgetDescription()
+ */
+ @Override
+ protected EEFWidgetDescription getWidgetDescription() {
+ return this.description;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.eef.ide.ui.internal.widgets.AbstractEEFWidgetLifecycleManager#getValidationControl()
*/
@Override
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFRadioLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFRadioLifecycleManager.java
index 869fb21b3..e6da80274 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFRadioLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFRadioLifecycleManager.java
@@ -15,6 +15,7 @@ import java.util.List;
import java.util.Map;
import org.eclipse.eef.EEFRadioDescription;
+import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EEFExpressionUtils.EEFSelect;
@@ -131,6 +132,16 @@ public class EEFRadioLifecycleManager extends AbstractEEFWidgetLifecycleManager
/**
* {@inheritDoc}
*
+ * @see org.eclipse.eef.ide.ui.internal.widgets.AbstractEEFWidgetLifecycleManager#getWidgetDescription()
+ */
+ @Override
+ protected EEFWidgetDescription getWidgetDescription() {
+ return this.description;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.eef.ide.ui.internal.widgets.AbstractEEFWidgetLifecycleManager#getValidationControl()
*/
@Override
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java
index 816514b01..463a795fa 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java
@@ -15,6 +15,7 @@ import java.util.List;
import java.util.Map;
import org.eclipse.eef.EEFSelectDescription;
+import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EEFExpressionUtils.EEFSelect;
@@ -134,6 +135,16 @@ public class EEFSelectLifecycleManager extends AbstractEEFWidgetLifecycleManager
/**
* {@inheritDoc}
*
+ * @see org.eclipse.eef.ide.ui.internal.widgets.AbstractEEFWidgetLifecycleManager#getWidgetDescription()
+ */
+ @Override
+ protected EEFWidgetDescription getWidgetDescription() {
+ return this.description;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.eef.ide.ui.internal.widgets.AbstractEEFWidgetLifecycleManager#getValidationControl()
*/
@Override
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java
index 97fbfb093..ddc045c2c 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java
@@ -11,6 +11,7 @@
package org.eclipse.eef.ide.ui.internal.widgets;
import org.eclipse.eef.EEFTextDescription;
+import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFTextController;
@@ -121,6 +122,16 @@ public class EEFTextLifecycleManager extends AbstractEEFWidgetLifecycleManager {
/**
* {@inheritDoc}
*
+ * @see org.eclipse.eef.ide.ui.internal.widgets.AbstractEEFWidgetLifecycleManager#getWidgetDescription()
+ */
+ @Override
+ protected EEFWidgetDescription getWidgetDescription() {
+ return this.description;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.eef.ide.ui.internal.widgets.ILifecycleManager#aboutToBeShown()
*/
@Override
diff --git a/plugins/org.eclipse.eef/model/eef.ecore b/plugins/org.eclipse.eef/model/eef.ecore
index d9cdd8845..a9d05b490 100644
--- a/plugins/org.eclipse.eef/model/eef.ecore
+++ b/plugins/org.eclipse.eef/model/eef.ecore
@@ -113,6 +113,11 @@
<details key="documentation" value="The label of the Widget visible by the end-users."/>
</eAnnotations>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="helpExpression" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="The tooltip of the help icon visible by the end-users"/>
+ </eAnnotations>
+ </eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="EEFTextDescription" eSuperTypes="#//EEFWidgetDescription">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
diff --git a/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/EEFWidgetDescription.java b/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/EEFWidgetDescription.java
index 2dd8accc7..faff10af9 100644
--- a/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/EEFWidgetDescription.java
+++ b/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/EEFWidgetDescription.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
* <ul>
* <li>{@link org.eclipse.eef.EEFWidgetDescription#getIdentifier <em>Identifier</em>}</li>
* <li>{@link org.eclipse.eef.EEFWidgetDescription#getLabelExpression <em>Label Expression</em>}</li>
+ * <li>{@link org.eclipse.eef.EEFWidgetDescription#getHelpExpression <em>Help Expression</em>}</li>
* </ul>
* </p>
*
@@ -75,4 +76,27 @@ public interface EEFWidgetDescription extends EObject {
*/
void setLabelExpression(String value);
+ /**
+ * Returns the value of the '<em><b>Help Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * --> <!-- begin-model-doc --> The tooltip of the help icon visible by the end-users <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Help Expression</em>' attribute.
+ * @see #setHelpExpression(String)
+ * @see org.eclipse.eef.EefPackage#getEEFWidgetDescription_HelpExpression()
+ * @model
+ * @generated
+ */
+ String getHelpExpression();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.eef.EEFWidgetDescription#getHelpExpression <em>Help Expression</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Help Expression</em>' attribute.
+ * @see #getHelpExpression()
+ * @generated
+ */
+ void setHelpExpression(String value);
+
} // EEFWidgetDescription
diff --git a/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/EefPackage.java b/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/EefPackage.java
index 9a6c813c5..e0db17712 100644
--- a/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/EefPackage.java
+++ b/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/EefPackage.java
@@ -298,13 +298,21 @@ public interface EefPackage extends EPackage {
int EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION = 1;
/**
+ * The feature id for the '<em><b>Help Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION = 2;
+
+ /**
* The number of structural features of the '<em>EEF Widget Description</em>' class. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
* @ordered
*/
- int EEF_WIDGET_DESCRIPTION_FEATURE_COUNT = 2;
+ int EEF_WIDGET_DESCRIPTION_FEATURE_COUNT = 3;
/**
* The meta object id for the '{@link org.eclipse.eef.impl.EEFTextDescriptionImpl <em>EEF Text Description</em>}'
@@ -334,6 +342,14 @@ public interface EefPackage extends EPackage {
int EEF_TEXT_DESCRIPTION__LABEL_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION;
/**
+ * The feature id for the '<em><b>Help Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EEF_TEXT_DESCRIPTION__HELP_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION;
+
+ /**
* The feature id for the '<em><b>Value Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
@@ -395,6 +411,14 @@ public interface EefPackage extends EPackage {
int EEF_LABEL_DESCRIPTION__LABEL_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION;
/**
+ * The feature id for the '<em><b>Help Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EEF_LABEL_DESCRIPTION__HELP_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION;
+
+ /**
* The feature id for the '<em><b>Body Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -439,6 +463,14 @@ public interface EefPackage extends EPackage {
int EEF_BUTTON_DESCRIPTION__LABEL_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION;
/**
+ * The feature id for the '<em><b>Help Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EEF_BUTTON_DESCRIPTION__HELP_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION;
+
+ /**
* The feature id for the '<em><b>Button Label Expression</b></em>' attribute. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
@@ -492,6 +524,14 @@ public interface EefPackage extends EPackage {
int EEF_CHECKBOX_DESCRIPTION__LABEL_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION;
/**
+ * The feature id for the '<em><b>Help Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EEF_CHECKBOX_DESCRIPTION__HELP_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION;
+
+ /**
* The feature id for the '<em><b>Value Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
@@ -545,6 +585,14 @@ public interface EefPackage extends EPackage {
int EEF_SELECT_DESCRIPTION__LABEL_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION;
/**
+ * The feature id for the '<em><b>Help Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EEF_SELECT_DESCRIPTION__HELP_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION;
+
+ /**
* The feature id for the '<em><b>Value Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
@@ -616,6 +664,14 @@ public interface EefPackage extends EPackage {
int EEF_RADIO_DESCRIPTION__LABEL_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION;
/**
+ * The feature id for the '<em><b>Help Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EEF_RADIO_DESCRIPTION__HELP_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION;
+
+ /**
* The feature id for the '<em><b>Value Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
@@ -994,6 +1050,17 @@ public interface EefPackage extends EPackage {
EAttribute getEEFWidgetDescription_LabelExpression();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.eef.EEFWidgetDescription#getHelpExpression
+ * <em>Help Expression</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Help Expression</em>'.
+ * @see org.eclipse.eef.EEFWidgetDescription#getHelpExpression()
+ * @see #getEEFWidgetDescription()
+ * @generated
+ */
+ EAttribute getEEFWidgetDescription_HelpExpression();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.eef.EEFTextDescription <em>EEF Text Description</em>}'.
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -1522,6 +1589,14 @@ public interface EefPackage extends EPackage {
EAttribute EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION = EefPackage.eINSTANCE.getEEFWidgetDescription_LabelExpression();
/**
+ * The meta object literal for the '<em><b>Help Expression</b></em>' attribute feature. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION = EefPackage.eINSTANCE.getEEFWidgetDescription_HelpExpression();
+
+ /**
* The meta object literal for the '{@link org.eclipse.eef.impl.EEFTextDescriptionImpl
* <em>EEF Text Description</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
diff --git a/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/impl/EEFWidgetDescriptionImpl.java b/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/impl/EEFWidgetDescriptionImpl.java
index 2f09bcb63..5fc658302 100644
--- a/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/impl/EEFWidgetDescriptionImpl.java
+++ b/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/impl/EEFWidgetDescriptionImpl.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
* <ul>
* <li>{@link org.eclipse.eef.impl.EEFWidgetDescriptionImpl#getIdentifier <em>Identifier</em>}</li>
* <li>{@link org.eclipse.eef.impl.EEFWidgetDescriptionImpl#getLabelExpression <em>Label Expression</em>}</li>
+ * <li>{@link org.eclipse.eef.impl.EEFWidgetDescriptionImpl#getHelpExpression <em>Help Expression</em>}</li>
* </ul>
* </p>
*
@@ -70,6 +71,26 @@ public abstract class EEFWidgetDescriptionImpl extends MinimalEObjectImpl.Contai
protected String labelExpression = EEFWidgetDescriptionImpl.LABEL_EXPRESSION_EDEFAULT;
/**
+ * The default value of the '{@link #getHelpExpression() <em>Help Expression</em>}' attribute. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #getHelpExpression()
+ * @generated
+ * @ordered
+ */
+ protected static final String HELP_EXPRESSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getHelpExpression() <em>Help Expression</em>}' attribute. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #getHelpExpression()
+ * @generated
+ * @ordered
+ */
+ protected String helpExpression = EEFWidgetDescriptionImpl.HELP_EXPRESSION_EDEFAULT;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -143,12 +164,39 @@ public abstract class EEFWidgetDescriptionImpl extends MinimalEObjectImpl.Contai
* @generated
*/
@Override
+ public String getHelpExpression() {
+ return helpExpression;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void setHelpExpression(String newHelpExpression) {
+ String oldHelpExpression = helpExpression;
+ helpExpression = newHelpExpression;
+ if (eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION, oldHelpExpression,
+ helpExpression));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EefPackage.EEF_WIDGET_DESCRIPTION__IDENTIFIER:
return getIdentifier();
case EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION:
return getLabelExpression();
+ case EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION:
+ return getHelpExpression();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -167,6 +215,9 @@ public abstract class EEFWidgetDescriptionImpl extends MinimalEObjectImpl.Contai
case EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION:
setLabelExpression((String) newValue);
return;
+ case EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION:
+ setHelpExpression((String) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -185,6 +236,9 @@ public abstract class EEFWidgetDescriptionImpl extends MinimalEObjectImpl.Contai
case EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION:
setLabelExpression(EEFWidgetDescriptionImpl.LABEL_EXPRESSION_EDEFAULT);
return;
+ case EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION:
+ setHelpExpression(EEFWidgetDescriptionImpl.HELP_EXPRESSION_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -203,6 +257,9 @@ public abstract class EEFWidgetDescriptionImpl extends MinimalEObjectImpl.Contai
case EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION:
return EEFWidgetDescriptionImpl.LABEL_EXPRESSION_EDEFAULT == null ? labelExpression != null
: !EEFWidgetDescriptionImpl.LABEL_EXPRESSION_EDEFAULT.equals(labelExpression);
+ case EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION:
+ return EEFWidgetDescriptionImpl.HELP_EXPRESSION_EDEFAULT == null ? helpExpression != null
+ : !EEFWidgetDescriptionImpl.HELP_EXPRESSION_EDEFAULT.equals(helpExpression);
}
return super.eIsSet(featureID);
}
@@ -223,6 +280,8 @@ public abstract class EEFWidgetDescriptionImpl extends MinimalEObjectImpl.Contai
result.append(identifier);
result.append(", labelExpression: "); //$NON-NLS-1$
result.append(labelExpression);
+ result.append(", helpExpression: "); //$NON-NLS-1$
+ result.append(helpExpression);
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/impl/EefPackageImpl.java b/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/impl/EefPackageImpl.java
index 6d26c151b..4443351b1 100644
--- a/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/impl/EefPackageImpl.java
+++ b/plugins/org.eclipse.eef/src-gen/org/eclipse/eef/impl/EefPackageImpl.java
@@ -428,6 +428,16 @@ public class EefPackageImpl extends EPackageImpl implements EefPackage {
* @generated
*/
@Override
+ public EAttribute getEEFWidgetDescription_HelpExpression() {
+ return (EAttribute) eefWidgetDescriptionEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
public EClass getEEFTextDescription() {
return eefTextDescriptionEClass;
}
@@ -769,6 +779,7 @@ public class EefPackageImpl extends EPackageImpl implements EefPackage {
eefWidgetDescriptionEClass = createEClass(EefPackage.EEF_WIDGET_DESCRIPTION);
createEAttribute(eefWidgetDescriptionEClass, EefPackage.EEF_WIDGET_DESCRIPTION__IDENTIFIER);
createEAttribute(eefWidgetDescriptionEClass, EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION);
+ createEAttribute(eefWidgetDescriptionEClass, EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION);
eefTextDescriptionEClass = createEClass(EefPackage.EEF_TEXT_DESCRIPTION);
createEAttribute(eefTextDescriptionEClass, EefPackage.EEF_TEXT_DESCRIPTION__VALUE_EXPRESSION);
@@ -941,6 +952,10 @@ public class EefPackageImpl extends EPackageImpl implements EefPackage {
getEEFWidgetDescription_LabelExpression(),
ecorePackage.getEString(),
"labelExpression", null, 0, 1, EEFWidgetDescription.class, !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_UNSETTABLE, !EPackageImpl.IS_ID, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(
+ getEEFWidgetDescription_HelpExpression(),
+ ecorePackage.getEString(),
+ "helpExpression", null, 0, 1, EEFWidgetDescription.class, !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_UNSETTABLE, !EPackageImpl.IS_ID, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); //$NON-NLS-1$
initEClass(eefTextDescriptionEClass, EEFTextDescription.class,
"EEFTextDescription", !EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE, EPackageImpl.IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java
index 9489758c8..286757307 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java
@@ -71,7 +71,7 @@ public class EEFTextControllerTests {
AdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
this.resourceSet = new ResourceSetImpl();
this.resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
- .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
+ .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
this.editingDomain = new TransactionalEditingDomainImpl(adapterFactory, this.resourceSet);
this.variableManager = new VariableManagerFactory().createVariableManager();
@@ -97,7 +97,11 @@ public class EEFTextControllerTests {
controller.onNewLabel(newLabel -> {
// do nothing
- });
+ });
+
+ controller.onNewHelp(newHelp -> {
+ // nothing
+ });
controller.refresh();
}
@@ -138,7 +142,11 @@ public class EEFTextControllerTests {
controller.onNewValue(newValue -> {
// nothing
- });
+ });
+
+ controller.onNewHelp(newHelp -> {
+ // nothing
+ });
controller.refresh();
}

Back to the top