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;
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;
public P3DBasicPropertyTab(boolean enabled) {
this.enabled = enabled;
}
- public void updatePartName(ISelection forSelection, Callback<String> updateCallback) {
+
+ @Override
+ public void updatePartName(ISelection forSelection, Consumer<String> updateCallback) {
Read<String> 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<String> getPartNameReadRequest(ISelection forSelection) {
final Resource r = AdaptationUtils.adaptToSingle(forSelection, Resource.class);
if (r == null)
public class MultiSelectionTabContibutor extends PropertyTabContributorImpl {
+ @Override
public void createControls(org.eclipse.swt.widgets.Composite body, org.eclipse.ui.IWorkbenchSite site, org.simantics.db.management.ISessionContext context, org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport support) {
//Composite composite = new Composite(body, SWT.NONE);
}
+ @Override
public Read<String> getPartNameReadRequest(ISelection forSelection) {
final Collection<Resource> coll = AdaptationUtils.adaptToCollection(forSelection, Resource.class);
if (coll.size() == 0)
}
- public void updatePartName(ISelection forSelection, Callback<String> updateCallback) {
- updateCallback.run("No Selection");
+ //@Override
+ public void updatePartName(ISelection forSelection, Consumer<String> updateCallback) {
+ updateCallback.accept("No Selection");
}
}