[refactoring] Replace IConsumer by java.util.function.Consumer
Change-Id: I2a08f80b07d49242d071d7fe41fac26d9457298f
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/EditingContextAdapter.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EditingContextAdapter.java
index 5c0b7ab..1ea2f3e 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EditingContextAdapter.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EditingContextAdapter.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,10 +12,10 @@
import java.util.Collection;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.core.api.LockStatusChangeEvent.LockStatus;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.EditingDomain;
@@ -46,7 +46,7 @@
* @param listener
* the listener to invoke when the model is modified.
*/
- void registerModelChangeListener(IConsumer<List<Notification>> listener);
+ void registerModelChangeListener(Consumer<List<Notification>> listener);
/**
* Unregisters the currently set model change listener. Does nothing if none is currently registered.
@@ -69,7 +69,7 @@
* @param listener
* the listener to invoke when elements are locked or unlocked.
*/
- void addLockStatusChangedListener(IConsumer<Collection<LockStatusChangeEvent>> listener);
+ void addLockStatusChangedListener(Consumer<Collection<LockStatusChangeEvent>> listener);
/**
* Removes the given lock status changed listener from the list of all lock status changed listeners..
@@ -77,7 +77,7 @@
* @param listener
* The listener to unregister
*/
- void removeLockStatusChangedListener(IConsumer<Collection<LockStatusChangeEvent>> listener);
+ void removeLockStatusChangedListener(Consumer<Collection<LockStatusChangeEvent>> listener);
/**
* Returns the current locking status of an element.
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFController.java
index c812e6f..25f6560 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFController.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
@@ -14,6 +14,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFRuleAuditDescription;
@@ -56,7 +57,7 @@
/**
* The consumer of the validation messages.
*/
- private IConsumer<List<IValidationRuleResult>> validationConsumer;
+ private Consumer<List<IValidationRuleResult>> validationConsumer;
/**
* The constructor.
@@ -86,10 +87,10 @@
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFController#onValidation(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.IEEFController#onValidation(java.util.function.Consumer)
*/
@Override
- public void onValidation(IConsumer<List<IValidationRuleResult>> consumer) {
+ public void onValidation(Consumer<List<IValidationRuleResult>> consumer) {
this.validationConsumer = consumer;
}
@@ -113,7 +114,7 @@
List<IValidationRuleResult> validationRuleResults = this.getValidationRuleResults(this.getValidationRulesContainer(),
this.getValidationRulesReference());
if (this.validationConsumer != null) {
- this.validationConsumer.apply(validationRuleResults);
+ this.validationConsumer.accept(validationRuleResults);
}
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFWidgetController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFWidgetController.java
index 8eabc21..9b406cf 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFWidgetController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFWidgetController.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,6 +10,8 @@
*******************************************************************************/
package org.eclipse.eef.core.api.controllers;
+import java.util.function.Consumer;
+
import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EditingContextAdapter;
@@ -28,12 +30,12 @@
/**
* The consumer of a new value of the label.
*/
- protected IConsumer<String> newLabelConsumer;
+ protected Consumer<String> newLabelConsumer;
/**
* The consumer of the new value of the help.
*/
- protected IConsumer<String> newHelpConsumer;
+ protected Consumer<String> newHelpConsumer;
/**
* The constructor.
@@ -79,10 +81,10 @@
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFWidgetController#onNewLabel(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.IEEFWidgetController#onNewLabel(java.util.function.Consumer)
*/
@Override
- public void onNewLabel(IConsumer<String> consumer) {
+ public void onNewLabel(Consumer<String> consumer) {
this.newLabelConsumer = consumer;
}
@@ -99,10 +101,10 @@
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFWidgetController#onNewHelp(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.IEEFWidgetController#onNewHelp(java.util.function.Consumer)
*/
@Override
- public void onNewHelp(IConsumer<String> consumer) {
+ public void onNewHelp(Consumer<String> consumer) {
this.newHelpConsumer = consumer;
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IConsumer.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IConsumer.java
deleted file mode 100644
index bda83b5..0000000
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IConsumer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.eef.core.api.controllers;
-
-/**
- * The consumer is a functional type used to receive an Object of a specific type.
- *
- * @author sbegaudeau
- * @param <T>
- * The type of the Object that can be received
- */
-public interface IConsumer<T> {
- /**
- * This operation is called in order to give to the consumer an Object.
- *
- * @param value
- * The Object
- */
- void apply(T value);
-}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFButtonController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFButtonController.java
index 6b71c1c..0e67a70 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFButtonController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFButtonController.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 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,6 +10,8 @@
*******************************************************************************/
package org.eclipse.eef.core.api.controllers;
+import java.util.function.Consumer;
+
import org.eclipse.core.runtime.IStatus;
/**
@@ -25,7 +27,7 @@
* @param consumer
* The consumer of the new value of the button's label
*/
- void onNewButtonLabel(IConsumer<String> consumer);
+ void onNewButtonLabel(Consumer<String> consumer);
/**
* Remove the consumer of the new value of the button's label.
@@ -34,7 +36,7 @@
/**
* Invoked when the user pushes the button.
- *
+ *
* @return the status of the pushed execution.
*/
IStatus pushed();
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFCheckboxController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFCheckboxController.java
index 343e9fb..f48e122 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFCheckboxController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFCheckboxController.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 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,6 +10,8 @@
*******************************************************************************/
package org.eclipse.eef.core.api.controllers;
+import java.util.function.Consumer;
+
import org.eclipse.core.runtime.IStatus;
/**
@@ -35,7 +37,7 @@
* @param consumer
* The consumer of the new value of the checkbox
*/
- void onNewValue(IConsumer<Boolean> consumer);
+ void onNewValue(Consumer<Boolean> consumer);
/**
* Remove the consumer of the new value of the checkbox.
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFController.java
index e68689e..19e093a 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFController.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
@@ -11,6 +11,7 @@
package org.eclipse.eef.core.api.controllers;
import java.util.List;
+import java.util.function.Consumer;
/**
* Common interface of all the controllers.
@@ -24,7 +25,7 @@
* @param consumer
* The consumer of the validation status
*/
- void onValidation(IConsumer<List<IValidationRuleResult>> consumer);
+ void onValidation(Consumer<List<IValidationRuleResult>> consumer);
/**
* Removes the consumer of the validation.
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFGroupController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFGroupController.java
index 99041e5..cd1c727 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFGroupController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFGroupController.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,6 +10,8 @@
*******************************************************************************/
package org.eclipse.eef.core.api.controllers;
+import java.util.function.Consumer;
+
/**
* The EEFGroupController is responsible of supporting the refresh of the label of the group.
*
@@ -22,7 +24,7 @@
* @param consumer
* The consumer of the new value of the label
*/
- void onNewLabel(IConsumer<String> consumer);
+ void onNewLabel(Consumer<String> consumer);
/**
* Remove the consumer of the new value of the label.
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFHyperlinkController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFHyperlinkController.java
index 13b55c8..251acd4 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFHyperlinkController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFHyperlinkController.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,6 +10,8 @@
*******************************************************************************/
package org.eclipse.eef.core.api.controllers;
+import java.util.function.Consumer;
+
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFWidgetAction;
@@ -36,7 +38,7 @@
* @param consumer
* The consumer of the new value of the hyperlink
*/
- void onNewValue(IConsumer<Object> consumer);
+ void onNewValue(Consumer<Object> consumer);
/**
* Remove the consumer of the new value of the hyperlink.
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 4b647f9..b77736f 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 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,6 +10,8 @@
*******************************************************************************/
package org.eclipse.eef.core.api.controllers;
+import java.util.function.Consumer;
+
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFWidgetAction;
@@ -26,7 +28,7 @@
* @param consumer
* The consumer of the new value of the label
*/
- void onNewValue(IConsumer<String> consumer);
+ void onNewValue(Consumer<String> consumer);
/**
* Remove the consumer of the new value of the label.
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFListController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFListController.java
index 34663ce..659880a 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFListController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFListController.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
@@ -11,6 +11,7 @@
package org.eclipse.eef.core.api.controllers;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFWidgetAction;
@@ -27,7 +28,7 @@
* @param consumer
* The consumer of the new value of the text
*/
- void onNewValue(IConsumer<Object> consumer);
+ void onNewValue(Consumer<Object> consumer);
/**
* Remove the consumer of the new value of the text.
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFMultipleReferencesController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFMultipleReferencesController.java
index 10c4b11..1c2bea5 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFMultipleReferencesController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFMultipleReferencesController.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
@@ -11,6 +11,7 @@
package org.eclipse.eef.core.api.controllers;
import java.util.List;
+import java.util.function.Consumer;
/**
* The IEEFMultipleReferencesController is responsible of supporting all the interactions with the widgets created for a
@@ -25,7 +26,7 @@
* @param consumer
* The consumer of the new value of the text
*/
- void onNewValue(IConsumer<List<Object>> consumer);
+ void onNewValue(Consumer<List<Object>> consumer);
/**
* Remove the consumer of the new value of the text.
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFRadioController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFRadioController.java
index 71fb473..33aa131 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFRadioController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFRadioController.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
@@ -11,6 +11,7 @@
package org.eclipse.eef.core.api.controllers;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
@@ -37,7 +38,7 @@
* @param consumer
* The consumer of the new value of the text
*/
- void onNewValue(IConsumer<Object> consumer);
+ void onNewValue(Consumer<Object> consumer);
/**
* Register a consumer which will be called with the new value of the candidates when it will change.
@@ -45,7 +46,7 @@
* @param consumer
* The consumer of the new candidates of the combo
*/
- void onNewCandidates(IConsumer<List<Object>> consumer);
+ void onNewCandidates(Consumer<List<Object>> consumer);
/**
* Remove the consumer of the new value of the text.
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFSelectController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFSelectController.java
index 010af32..621f1dc 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFSelectController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFSelectController.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
@@ -11,6 +11,7 @@
package org.eclipse.eef.core.api.controllers;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
@@ -37,7 +38,7 @@
* @param consumer
* The consumer of the new value of the text
*/
- void onNewValue(IConsumer<Object> consumer);
+ void onNewValue(Consumer<Object> consumer);
/**
* Register a consumer which will be called with the new value of the candidates when it will change.
@@ -45,7 +46,7 @@
* @param consumer
* The consumer of the new candidates of the combo
*/
- void onNewCandidates(IConsumer<List<Object>> consumer);
+ void onNewCandidates(Consumer<List<Object>> consumer);
/**
* Remove the consumer of the new value of the text.
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFTextController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFTextController.java
index a61b33c..5035f3a 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFTextController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFTextController.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 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,6 +10,8 @@
*******************************************************************************/
package org.eclipse.eef.core.api.controllers;
+import java.util.function.Consumer;
+
import org.eclipse.core.runtime.IStatus;
/**
@@ -37,7 +39,7 @@
* @param consumer
* The consumer of the new value of the text
*/
- void onNewValue(IConsumer<Object> consumer);
+ void onNewValue(Consumer<Object> consumer);
/**
* Remove the consumer of the new value of the text.
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 c48c415..e776227 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
@@ -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,6 +10,8 @@
*******************************************************************************/
package org.eclipse.eef.core.api.controllers;
+import java.util.function.Consumer;
+
/**
* The Widget controller is responsible for the refresh of the label of a widget.
*
@@ -22,7 +24,7 @@
* @param consumer
* The consumer of the new value of the label
*/
- void onNewLabel(IConsumer<String> consumer);
+ void onNewLabel(Consumer<String> consumer);
/**
* Remove the consumer of the new value of the label.
@@ -35,7 +37,7 @@
* @param consumer
* The consumer of the new value of the help
*/
- void onNewHelp(IConsumer<String> consumer);
+ void onNewHelp(Consumer<String> consumer);
/**
* Removes the consumer of the new value of the help.
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/utils/EvalFactory.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/utils/EvalFactory.java
index c7e1976..f899694 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/utils/EvalFactory.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/utils/EvalFactory.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
@@ -13,9 +13,9 @@
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
+import java.util.function.Consumer;
import org.eclipse.eef.common.api.utils.Util;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.internal.EEFCorePlugin;
import org.eclipse.eef.core.internal.Messages;
import org.eclipse.emf.ecore.EAttribute;
@@ -189,14 +189,14 @@
* @param consumer
* The consumer
*/
- public void call(String expression, IConsumer<TYPE> consumer) {
+ public void call(String expression, Consumer<TYPE> consumer) {
if (Util.isBlank(expression)) {
if (this.eAttribute != null && EEFCorePlugin.getPlugin() != null) {
EEFCorePlugin.getPlugin().blank(this.eAttribute);
}
if (this.defaultValue != null && consumer != null) {
- consumer.apply(this.defaultValue);
+ consumer.accept(this.defaultValue);
}
return;
}
@@ -213,7 +213,7 @@
this.type.getName(), value);
EEFCorePlugin.getPlugin().error(message);
}
- consumer.apply(returnValue);
+ consumer.accept(returnValue);
}
} else if (EEFCorePlugin.getPlugin() != null) {
EEFCorePlugin.getPlugin().diagnostic(expression, evaluationResult.getDiagnostic());
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFPageImpl.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFPageImpl.java
index 3786f5d..88df548 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFPageImpl.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFPageImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 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
@@ -14,6 +14,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.eef.EEFGroupDescription;
import org.eclipse.eef.EEFPageDescription;
@@ -23,7 +24,6 @@
import org.eclipse.eef.core.api.EEFPage;
import org.eclipse.eef.core.api.EEFView;
import org.eclipse.eef.core.api.IEEFDomainClassTester;
-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;
@@ -105,7 +105,7 @@
Boolean preconditionValid = EvalFactory.of(this.interpreter, this.variableManager).logIfInvalidType(Boolean.class)
.evaluate(preconditionExpression);
if (preconditionValid == null || preconditionValid.booleanValue()) {
- IConsumer<Object> consumer = (value) -> {
+ Consumer<Object> consumer = (value) -> {
DomainClassPredicate domainClassPredicate = new DomainClassPredicate(eefGroupDescription.getDomainClass(), domainClassTester);
Iterable<Object> iterable = Util.asIterable(value, Object.class);
Iterable<Object> objects = Iterables.filter(iterable, domainClassPredicate);
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFViewImpl.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFViewImpl.java
index 86ea39f..0cbd6b9 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFViewImpl.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFViewImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 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
@@ -15,6 +15,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.eef.EEFPageDescription;
import org.eclipse.eef.EEFViewDescription;
@@ -26,7 +27,6 @@
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.IEEFDomainClassTester;
import org.eclipse.eef.core.api.InputDescriptor;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.utils.EvalFactory;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
@@ -104,7 +104,7 @@
Boolean preconditionValid = EvalFactory.of(this.interpreter, this.variableManager).logIfInvalidType(Boolean.class)
.evaluate(preconditionExpression);
if (preconditionValid == null || preconditionValid.booleanValue()) {
- IConsumer<Object> consumer = (value) -> {
+ Consumer<Object> consumer = (value) -> {
DomainClassPredicate domainClassPredicate = new DomainClassPredicate(eefPageDescription.getDomainClass(), domainClassTester);
Iterable<Object> iterable = Util.asIterable(value, Object.class);
Iterable<Object> objects = Iterables.filter(iterable, domainClassPredicate);
@@ -186,7 +186,7 @@
// All your update process for EEFPages need to be updated. It's not simple in any way or shape, I know.
for (final EEFPage eefPage : this.eefPages) {
- IConsumer<Object> pageConsumer = (value) -> Util.asIterable(value, Object.class).forEach(pageSemanticCandidate -> {
+ Consumer<Object> pageConsumer = (value) -> Util.asIterable(value, Object.class).forEach(pageSemanticCandidate -> {
eefPage.getVariableManager().put(EEFExpressionUtils.SELF, pageSemanticCandidate);
});
@@ -199,7 +199,7 @@
for (final EEFGroup eefGroup : groups) {
// FIXME We need only one semantic candidate, so we just take the last one available as self
// as we did for the pages just before
- IConsumer<Object> groupConsumer = (value) -> Util.asIterable(value, Object.class).forEach(groupSemanticCandidate -> {
+ Consumer<Object> groupConsumer = (value) -> Util.asIterable(value, Object.class).forEach(groupSemanticCandidate -> {
eefGroup.getVariableManager().put(EEFExpressionUtils.SELF, groupSemanticCandidate);
});
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFButtonController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFButtonController.java
index 8a5a40a..87796dd 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFButtonController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFButtonController.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,13 +10,14 @@
*******************************************************************************/
package org.eclipse.eef.core.internal.controllers;
+import java.util.function.Consumer;
+
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFButtonDescription;
import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFButtonController;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
@@ -36,7 +37,7 @@
/**
* The consumer of a new value of the button's label.
*/
- private IConsumer<String> newButtonLabelConsumer;
+ private Consumer<String> newButtonLabelConsumer;
/**
* The constructor.
@@ -57,7 +58,7 @@
}
@Override
- public void onNewButtonLabel(IConsumer<String> consumer) {
+ public void onNewButtonLabel(Consumer<String> consumer) {
this.newButtonLabelConsumer = consumer;
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFCheckboxController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFCheckboxController.java
index 3a50029..c049dab 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFCheckboxController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFCheckboxController.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,6 +12,7 @@
import java.util.HashMap;
import java.util.Map;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFCheckboxDescription;
@@ -20,7 +21,6 @@
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFCheckboxController;
import org.eclipse.eef.core.api.utils.EvalFactory;
import org.eclipse.emf.ecore.EAttribute;
@@ -41,7 +41,7 @@
/**
* The consumer of a new value of the checkbox.
*/
- private IConsumer<Boolean> newValueConsumer;
+ private Consumer<Boolean> newValueConsumer;
/**
* The constructor.
@@ -91,10 +91,10 @@
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFTextController#onNewValue(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.IEEFTextController#onNewValue(java.util.function.Consumer)
*/
@Override
- public void onNewValue(IConsumer<Boolean> consumer) {
+ public void onNewValue(Consumer<Boolean> consumer) {
this.newValueConsumer = consumer;
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFGroupController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFGroupController.java
index 74e1f28..1f7d90b 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFGroupController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFGroupController.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Obeo.
+ * Copyright (c) 2015, 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,11 +10,12 @@
*******************************************************************************/
package org.eclipse.eef.core.internal.controllers;
+import java.util.function.Consumer;
+
import org.eclipse.eef.EEFGroupDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFController;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFGroupController;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
@@ -36,7 +37,7 @@
/**
* The label consumer.
*/
- private IConsumer<String> newLabelConsumer;
+ private Consumer<String> newLabelConsumer;
/**
* The constructor.
@@ -59,10 +60,10 @@
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFGroupController#onNewLabel(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.IEEFGroupController#onNewLabel(java.util.function.Consumer)
*/
@Override
- public void onNewLabel(IConsumer<String> consumer) {
+ public void onNewLabel(Consumer<String> consumer) {
this.newLabelConsumer = consumer;
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFHyperlinkController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFHyperlinkController.java
index acb3de5..3456862 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFHyperlinkController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFHyperlinkController.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
@@ -13,6 +13,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFHyperlinkDescription;
@@ -23,7 +24,6 @@
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFHyperlinkController;
import org.eclipse.eef.core.api.utils.EvalFactory;
import org.eclipse.emf.ecore.EAttribute;
@@ -44,7 +44,7 @@
/**
* The consumer of a new value of the text.
*/
- private IConsumer<Object> newValueConsumer;
+ private Consumer<Object> newValueConsumer;
/**
* The constructor.
@@ -75,7 +75,7 @@
String valueExpression = this.description.getValueExpression();
Object valueExpressionResult = this.newEval().evaluate(valueExpression);
- this.newValueConsumer.apply(valueExpressionResult);
+ this.newValueConsumer.accept(valueExpressionResult);
}
/**
@@ -118,10 +118,10 @@
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFTextController#onNewValue(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.IEEFTextController#onNewValue(java.util.function.Consumer)
*/
@Override
- public void onNewValue(IConsumer<Object> consumer) {
+ public void onNewValue(Consumer<Object> consumer) {
this.newValueConsumer = consumer;
}
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 8f6b92a..b893988 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 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,6 +12,7 @@
import java.util.HashMap;
import java.util.Map;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFLabelDescription;
@@ -22,7 +23,6 @@
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFLabelController;
import org.eclipse.eef.core.api.utils.EvalFactory;
import org.eclipse.emf.ecore.EAttribute;
@@ -43,7 +43,7 @@
/**
* The consumer of the new body.
*/
- private IConsumer<String> newValueConsumer;
+ private Consumer<String> newValueConsumer;
/**
* The constructor.
@@ -83,7 +83,7 @@
variables.put(EEFExpressionUtils.EEFReference.VALUE, valueExpressionResult);
EvalFactory.of(this.interpreter, variables).logIfInvalidType(String.class).call(displayExpression, this.newValueConsumer);
} else if (valueExpressionResult != null) {
- this.newValueConsumer.apply(valueExpressionResult.toString());
+ this.newValueConsumer.accept(valueExpressionResult.toString());
}
}
@@ -103,7 +103,7 @@
* @see org.eclipse.eef.core.api.controllers.IEEFLabelController#onNewValue(org.eclipse.eef.core.api.controllers.IConsumer)
*/
@Override
- public void onNewValue(IConsumer<String> consumer) {
+ public void onNewValue(Consumer<String> consumer) {
this.newValueConsumer = consumer;
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFListController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFListController.java
index 21aa00e..3841501 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFListController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFListController.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 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
@@ -13,6 +13,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFListDescription;
@@ -22,7 +23,6 @@
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFListController;
import org.eclipse.eef.core.api.utils.EvalFactory;
import org.eclipse.emf.ecore.EAttribute;
@@ -43,7 +43,7 @@
/**
* The consumer of a new value of the list.
*/
- private IConsumer<Object> newValueConsumer;
+ private Consumer<Object> newValueConsumer;
/**
* The constructor.
@@ -82,7 +82,7 @@
* @see org.eclipse.eef.core.api.controllers.IEEFListController#onNewValue(org.eclipse.eef.core.api.controllers.IConsumer)
*/
@Override
- public void onNewValue(IConsumer<Object> consumer) {
+ public void onNewValue(Consumer<Object> consumer) {
this.newValueConsumer = consumer;
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFRadioController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFRadioController.java
index a9c524c..d63debb 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFRadioController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFRadioController.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
@@ -14,6 +14,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFRadioDescription;
@@ -22,7 +23,6 @@
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFRadioController;
import org.eclipse.eef.core.api.utils.EvalFactory;
import org.eclipse.emf.ecore.EAttribute;
@@ -43,12 +43,12 @@
/**
* The consumer of a new value of the combo.
*/
- private IConsumer<Object> newValueConsumer;
+ private Consumer<Object> newValueConsumer;
/**
* The consumer of a new candidates of the combo.
*/
- private IConsumer<List<Object>> newCandidatesConsumer;
+ private Consumer<List<Object>> newCandidatesConsumer;
/**
* The constructor.
@@ -99,7 +99,7 @@
((Iterable<?>) value).forEach(object -> candidates.add(object));
- this.newCandidatesConsumer.apply(candidates);
+ this.newCandidatesConsumer.accept(candidates);
}
});
@@ -110,20 +110,20 @@
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.EEFTextController#onNewValue(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.EEFTextController#onNewValue(java.util.function.Consumer)
*/
@Override
- public void onNewValue(IConsumer<Object> consumer) {
+ public void onNewValue(Consumer<Object> consumer) {
this.newValueConsumer = consumer;
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.EEFTextController#onNewValue(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.EEFTextController#onNewValue(java.util.function.Consumer)
*/
@Override
- public void onNewCandidates(IConsumer<List<Object>> consumer) {
+ public void onNewCandidates(Consumer<List<Object>> consumer) {
this.newCandidatesConsumer = consumer;
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFSelectController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFSelectController.java
index 018b2ab..c140fff 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFSelectController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFSelectController.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
@@ -16,6 +16,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFSelectDescription;
@@ -24,7 +25,6 @@
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFSelectController;
import org.eclipse.eef.core.api.utils.EvalFactory;
import org.eclipse.emf.ecore.EAttribute;
@@ -45,12 +45,12 @@
/**
* The consumer of a new value of the combo.
*/
- private IConsumer<Object> newValueConsumer;
+ private Consumer<Object> newValueConsumer;
/**
* The consumer of a new candidates of the combo.
*/
- private IConsumer<List<Object>> newCandidatesConsumer;
+ private Consumer<List<Object>> newCandidatesConsumer;
/**
* The constructor.
@@ -102,7 +102,7 @@
Iterators.addAll(candidates, ((Iterable<?>) value).iterator());
- this.newCandidatesConsumer.apply(candidates);
+ this.newCandidatesConsumer.accept(candidates);
}
});
@@ -113,20 +113,20 @@
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFTextController#onNewValue(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.IEEFTextController#onNewValue(java.util.function.Consumer)
*/
@Override
- public void onNewValue(IConsumer<Object> consumer) {
+ public void onNewValue(Consumer<Object> consumer) {
this.newValueConsumer = consumer;
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFTextController#onNewValue(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.IEEFTextController#onNewValue(java.util.function.Consumer)
*/
@Override
- public void onNewCandidates(IConsumer<List<Object>> consumer) {
+ public void onNewCandidates(Consumer<List<Object>> consumer) {
this.newCandidatesConsumer = consumer;
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFTextController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFTextController.java
index ecfd50d..f9654ef 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFTextController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFTextController.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 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,6 +12,7 @@
import java.util.HashMap;
import java.util.Map;
+import java.util.function.Consumer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.eef.EEFTextDescription;
@@ -20,7 +21,6 @@
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFTextController;
import org.eclipse.eef.core.api.utils.EvalFactory;
import org.eclipse.emf.ecore.EAttribute;
@@ -41,7 +41,7 @@
/**
* The consumer of a new value of the text.
*/
- private IConsumer<Object> newValueConsumer;
+ private Consumer<Object> newValueConsumer;
/**
* The constructor.
@@ -91,10 +91,10 @@
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.controllers.IEEFTextController#onNewValue(org.eclipse.eef.core.api.controllers.IConsumer)
+ * @see org.eclipse.eef.core.api.controllers.IEEFTextController#onNewValue(java.util.function.Consumer)
*/
@Override
- public void onNewValue(IConsumer<Object> consumer) {
+ public void onNewValue(Consumer<Object> consumer) {
this.newValueConsumer = consumer;
}
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 64ac4e3..7414fdf 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
@@ -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,6 +12,7 @@
import java.util.Collection;
import java.util.Optional;
+import java.util.function.Consumer;
import org.eclipse.eef.EEFDynamicMappingFor;
import org.eclipse.eef.EEFDynamicMappingIf;
@@ -25,7 +26,6 @@
import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.LockStatusChangeEvent;
import org.eclipse.eef.core.api.LockStatusChangeEvent.LockStatus;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.core.api.utils.EvalFactory;
import org.eclipse.eef.ide.ui.api.widgets.EEFStyleHelper.IEEFTextStyleCallback;
@@ -98,7 +98,7 @@
/**
* The listener used to react to changes in the lock status of a semantic element.
*/
- private IConsumer<Collection<LockStatusChangeEvent>> lockStatusChangedListener;
+ private Consumer<Collection<LockStatusChangeEvent>> lockStatusChangedListener;
/**
* The decorator used to indicate the permission on the validation widget.
@@ -317,7 +317,7 @@
this.lockStatusChangedListener = (events) -> {
Display.getDefault().asyncExec(() -> {
events.stream().filter(event -> this.getWidgetSemanticElement().equals(event.getElement()))
- .forEach(event -> this.handleLockStatus(event.getStatus()));
+ .forEach(event -> this.handleLockStatus(event.getStatus()));
});
};
this.editingContextAdapter.addLockStatusChangedListener(this.lockStatusChangedListener);
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Updater.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Updater.java
index 423c32d..6997e19 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Updater.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Updater.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
@@ -11,9 +11,9 @@
package org.eclipse.eef.ide.ui.internal;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
-import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.ide.ui.api.EEFTab;
import org.eclipse.emf.common.notify.Notification;
@@ -23,7 +23,7 @@
*
* @author pcdavid
*/
-public class Updater implements IConsumer<List<Notification>> {
+public class Updater implements Consumer<List<Notification>> {
/**
* The top-level page the section is part of.
@@ -64,7 +64,7 @@
}
@Override
- public void apply(List<Notification> value) {
+ public void accept(List<Notification> value) {
formContainer.refreshPage();
}
}
\ No newline at end of file
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 7c16e7f..a71a5b3 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 @@
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 @@
/**
* The consumer of a new value of the color.
*/
- private IConsumer<Color> newValueConsumer;
+ private Consumer<Color> newValueConsumer;
/**
* The constructor.
@@ -95,7 +95,7 @@
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 @@
}
@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 e21c49a..3e4ccb9 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);
}