Remove additional references to the bodyExpression of the label
Change-Id: I309582bc0a6db3182af8d04c813760cee546997f
Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFLabelController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFLabelController.java
index 21608c3..06687ef 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFLabelController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFLabelController.java
@@ -18,15 +18,15 @@
*/
public interface IEEFLabelController extends IEEFWidgetController {
/**
- * Register a consumer which will be called with the new body of the label when it will change.
+ * Register a consumer which will be called with the new value of the label when it will change.
*
* @param consumer
- * The consumer of the new body of the label
+ * The consumer of the new value of the label
*/
- void onNewBody(IConsumer<String> consumer);
+ void onNewValue(IConsumer<String> consumer);
/**
- * Remove the consumer of the new body of the label.
+ * Remove the consumer of the new value of the label.
*/
- void removeNewBodyConsumer();
+ void removeNewValueConsumer();
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFLabelController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFLabelController.java
index 4b87bcb..c81d58b 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFLabelController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFLabelController.java
@@ -32,7 +32,7 @@
/**
* The consumer of the new body.
*/
- private IConsumer<String> newBodyConsumer;
+ private IConsumer<String> newValueConsumer;
/**
* The constructor.
@@ -59,8 +59,8 @@
public void refresh() {
super.refresh();
- String bodyExpression = this.description.getValueExpression();
- this.newEval().logIfInvalidType(String.class).call(bodyExpression, this.newBodyConsumer);
+ String valueExpression = this.description.getValueExpression();
+ this.newEval().logIfInvalidType(String.class).call(valueExpression, this.newValueConsumer);
}
/**
@@ -76,21 +76,21 @@
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFLabelController#onNewBody(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.IEEFLabelController#onNewValue(org.eclipse.eef.core.api.controllers.IConsumer)
*/
@Override
- public void onNewBody(IConsumer<String> consumer) {
- this.newBodyConsumer = consumer;
+ public void onNewValue(IConsumer<String> consumer) {
+ this.newValueConsumer = consumer;
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFLabelController#removeNewBodyConsumer()
+ * @see org.eclipse.eef.core.api.controllers.IEEFLabelController#removeNewValueConsumer()
*/
@Override
- public void removeNewBodyConsumer() {
- this.newBodyConsumer = null;
+ public void removeNewValueConsumer() {
+ this.newValueConsumer = null;
}
}
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java
index 194cdcb..b821a0f 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java
@@ -150,6 +150,7 @@
this.help = widgetFactory.createCLabel(composite, ""); //$NON-NLS-1$
if (!Util.isBlank(this.getWidgetDescription().getHelpExpression())) {
this.help.setImage(EEFIdeUiPlugin.getPlugin().getImageRegistry().get(Icons.HELP));
+ this.help.setLayoutData(new GridData(this.getLabelVerticalAlignment()));
this.help.setToolTipText(""); //$NON-NLS-1$
}
}
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 16094f8..2e848e4 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
@@ -96,7 +96,7 @@
public void aboutToBeShown() {
super.aboutToBeShown();
- this.controller.onNewBody(new IConsumer<String>() {
+ this.controller.onNewValue(new IConsumer<String>() {
@Override
public void apply(String value) {
if (!body.isDisposed()) {
@@ -132,7 +132,7 @@
@Override
public void aboutToBeHidden() {
super.aboutToBeHidden();
- this.controller.removeNewBodyConsumer();
+ this.controller.removeNewValueConsumer();
}
/**
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFLabelControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFLabelControllerTests.java
index ccb4754..c032da9 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFLabelControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFLabelControllerTests.java
@@ -56,7 +56,7 @@
public void testBody() {
AtomicBoolean atomicBoolean = new AtomicBoolean(false);
IEEFLabelController controller = this.labelController(EEFDataTests.EEFLABELCONTROLLERTESTS_BODY);
- controller.onNewBody(label -> {
+ controller.onNewValue(label -> {
assertThat(label, is("This is the documentation of the project")); //$NON-NLS-1$
atomicBoolean.set(true);
});