Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane Bégaudeau2017-03-08 09:18:27 -0500
committerStéphane Bégaudeau2017-03-30 08:32:13 -0400
commita5a69d327c368ecaad0af06e1c43ce5a87b3cc85 (patch)
tree9071dac0fdebf759a8a1a9eaf68bae12f389491d /samples
parent0ada594db0caa8e8dc7bd5cc2b1f419566c87092 (diff)
downloadorg.eclipse.eef-a5a69d327c368ecaad0af06e1c43ce5a87b3cc85.tar.gz
org.eclipse.eef-a5a69d327c368ecaad0af06e1c43ce5a87b3cc85.tar.xz
org.eclipse.eef-a5a69d327c368ecaad0af06e1c43ce5a87b3cc85.zip
[refactoring] Replace IConsumer by java.util.function.Consumer
Change-Id: I2a08f80b07d49242d071d7fe41fac26d9457298f Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
Diffstat (limited to 'samples')
-rw-r--r--samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerController.java10
-rw-r--r--samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/IColorPickerController.java46
2 files changed, 28 insertions, 28 deletions
diff --git a/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerController.java b/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerController.java
index 7c16e7f39..a71a5b3a0 100644
--- a/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerController.java
+++ b/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerController.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 Obeo.
+ * Copyright (c) 2016, 2017 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,12 +12,12 @@ package org.eclipse.eef.sample.custom.widget.colorpicker;
import java.util.HashMap;
import java.util.Map;
+import java.util.function.Consumer;
import org.eclipse.eef.EEFCustomWidgetDescription;
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFCustomWidgetController;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.utils.EvalFactory;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -54,7 +54,7 @@ public class ColorPickerController extends AbstractEEFCustomWidgetController imp
/**
* The consumer of a new value of the color.
*/
- private IConsumer<Color> newValueConsumer;
+ private Consumer<Color> newValueConsumer;
/**
* The constructor.
@@ -95,7 +95,7 @@ public class ColorPickerController extends AbstractEEFCustomWidgetController imp
green = Integer.parseInt(rgb[1]);
blue = Integer.parseInt(rgb[2]);
Color color = ColorHelper.getColor(red, green, blue);
- ColorPickerController.this.newValueConsumer.apply(color);
+ ColorPickerController.this.newValueConsumer.accept(color);
} catch (NumberFormatException e) {
// TODO Log warning about unexpected result format from the expression.
}
@@ -105,7 +105,7 @@ public class ColorPickerController extends AbstractEEFCustomWidgetController imp
}
@Override
- public void onNewValue(IConsumer<Color> consumer) {
+ public void onNewValue(Consumer<Color> consumer) {
this.newValueConsumer = consumer;
}
diff --git a/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/IColorPickerController.java b/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/IColorPickerController.java
index e21c49a30..3e4ccb986 100644
--- a/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/IColorPickerController.java
+++ b/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/IColorPickerController.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 Obeo.
+ * Copyright (c) 2016, 2017 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,38 +10,38 @@
*******************************************************************************/
package org.eclipse.eef.sample.custom.widget.colorpicker;
-import org.eclipse.eef.core.api.controllers.IConsumer;
+import java.util.function.Consumer;
+
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
/**
- * The IColorPickerController is responsible of supporting all the interactions
- * with the widgets created for a color picker.
+ * The IColorPickerController is responsible of supporting all the interactions with the widgets created for a color
+ * picker.
*
* @author mbats
*/
public interface IColorPickerController extends IEEFWidgetController {
- /**
- * Register a consumer which will be called with the new value of the text
- * when it will change.
- *
- * @param consumer
- * The consumer of the new value of the text
- */
- void onNewValue(IConsumer<Color> consumer);
+ /**
+ * Register a consumer which will be called with the new value of the text when it will change.
+ *
+ * @param consumer
+ * The consumer of the new value of the text
+ */
+ void onNewValue(Consumer<Color> consumer);
- /**
- * Remove the consumer of the new value of the text.
- */
- void removeNewValueConsumer();
+ /**
+ * Remove the consumer of the new value of the text.
+ */
+ void removeNewValueConsumer();
- /**
- * Update the value of the text.
- *
- * @param selected
- * The new value of the color
- */
- void updateValue(RGB selected);
+ /**
+ * Update the value of the text.
+ *
+ * @param selected
+ * The new value of the color
+ */
+ void updateValue(RGB selected);
}

Back to the top