From: Reino Ruusu Date: Tue, 15 Oct 2019 10:12:14 +0000 (+0300) Subject: Replace obsolete use of Callback with Consumer. X-Git-Tag: v1.43.0~192 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=d17f8bbf4ab660b5efa42ff9d54cda7bbed02648;p=simantics%2F3d.git Replace obsolete use of Callback with Consumer. Change-Id: I25ea24eadda7b7f9134083b02bed4b0e0b2205e4 --- diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/property/P3DSelectionProcessor.java b/org.simantics.plant3d/src/org/simantics/plant3d/property/P3DSelectionProcessor.java index 3bef85b5..4970d0e9 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/property/P3DSelectionProcessor.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/property/P3DSelectionProcessor.java @@ -3,6 +3,7 @@ package org.simantics.plant3d.property; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.function.Consumer; import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.widgets.Composite; @@ -26,7 +27,6 @@ import org.simantics.selectionview.BasicPropertyTab; import org.simantics.selectionview.ComparableTabContributor; import org.simantics.selectionview.PropertyTabContributorImpl; import org.simantics.selectionview.SelectionProcessor; -import org.simantics.utils.datastructures.Callback; import org.simantics.utils.threads.SWTThread; import vtk.vtkProp; @@ -99,14 +99,18 @@ public class P3DSelectionProcessor implements SelectionProcessor updateCallback) { + + @Override + public void updatePartName(ISelection forSelection, Consumer updateCallback) { Read read = getPartNameReadRequest(forSelection); if (read == null) { - updateCallback.run("Override to control part name (PropertyTabContributorImpl.updatePartName)"); + updateCallback.accept("Override to control part name (PropertyTabContributorImpl.updatePartName)"); } else { Simantics.getSession().asyncRequest(read, new PartNameListener(updateCallback)); } } + + @Override public Read getPartNameReadRequest(ISelection forSelection) { final Resource r = AdaptationUtils.adaptToSingle(forSelection, Resource.class); if (r == null) @@ -131,10 +135,12 @@ public class P3DSelectionProcessor implements SelectionProcessor getPartNameReadRequest(ISelection forSelection) { final Collection coll = AdaptationUtils.adaptToCollection(forSelection, Resource.class); if (coll.size() == 0) @@ -161,8 +167,9 @@ public class P3DSelectionProcessor implements SelectionProcessor updateCallback) { - updateCallback.run("No Selection"); + //@Override + public void updatePartName(ISelection forSelection, Consumer updateCallback) { + updateCallback.accept("No Selection"); } }