X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.selectionview%2Fsrc%2Forg%2Fsimantics%2Fselectionview%2FSelectionProcessor.java;fp=bundles%2Forg.simantics.selectionview%2Fsrc%2Forg%2Fsimantics%2Fselectionview%2FSelectionProcessor.java;h=10f35630450352a89e853f006a7d6e296e23dccc;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/SelectionProcessor.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/SelectionProcessor.java new file mode 100644 index 000000000..10f356304 --- /dev/null +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/SelectionProcessor.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * 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: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.selectionview; + +import java.util.Collection; + +/** + * A selection processor is an interface for encapsulating the conversion from a + * UI selection into a collection of input objects. Minimally a selection + * processor must simply transfer the incoming selection's contents into a + * collection. The point of having this interface is to allow contribution-based + * preprocessing of UI selections into proper domain-specific model objects that + * the domain-specific UI components can take as their inputs. + * + *
+ * This interface is used in conjunction with UI components that are meant to
+ * react to external inputs/UI selections. A tabbed selection view is an example
+ * of such a UI component. One or more tabs are created for each preprocessed
+ * input object. A selection processor in a tabbed property table is the party
+ * that decides how to process/adapt a new workbench selection before sending it
+ * on to property contributors for resolving all potential property tab
+ * contributors.
+ *
+ * @author Tuukka Lehtonen
+ *
+ * @param
+ * @param
+ */
+public interface SelectionProcessor {
+
+ /**
+ * @param selection the incoming selection to process
+ * @param backend for providing back-end access to the processor
+ * @return an ordered set of
+ * org.simantics.browsing.ui.swt.ComparableTabContributor
+ * instances representing the property tabs to be contributed to the
+ * selection view. The processor must not return null
,
+ * return an empty collection instead.
+ */
+ Collection> process(S selection, B backend);
+
+}