1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.browsing.ui.platform.debug;
\r
14 import java.util.ArrayList;
\r
15 import java.util.Collection;
\r
17 import org.simantics.browsing.ui.common.EvaluatorData.Evaluator;
\r
18 import org.simantics.browsing.ui.common.EvaluatorData.EvaluatorTree;
\r
19 import org.simantics.browsing.ui.common.contributor.FinalRootViewpointContributionContributor;
\r
21 public class EvaluatorContribution extends FinalRootViewpointContributionContributor<Evaluator> {
\r
23 private boolean isEmpty(EvaluatorTree<?> tree) {
\r
24 return tree.getAcceptedFactories().isEmpty() && tree.getChildren().isEmpty();
\r
27 private void addNonEmpty(Collection<EvaluatorTree<?>> result, EvaluatorTree<?>... trees) {
\r
28 for (EvaluatorTree<?> tree : trees)
\r
34 public Collection<?> getContribution(Evaluator input) {
\r
35 //return NodeContextUtil.toContextCollectionWithInput(input.getViewpointTree(), input.getLabelerTree(), input.getImagerTree(), input.getLabelDecoratorTree(), input.getComparatorTree());
\r
36 Collection<EvaluatorTree<?>> result = new ArrayList<EvaluatorTree<?>>();
\r
37 addNonEmpty(result, input.getViewpointTree(), input.getLabelerTree(), input.getLabelDecoratorTree(), input.getImagerTree(), input.getComparableContextTree());
\r
42 public String getViewpointId() {
\r
43 return "Evaluators";
\r