/******************************************************************************* * Copyright (c) 2012 BMW Car IT and others. * 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 *******************************************************************************/ /* * generated by Xtext */ package org.jnario.feature.ui.outline; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtend.core.xtend.XtendTypeDeclaration; import org.eclipse.xtend.ide.outline.XtendFeatureNode; import org.eclipse.xtend.ide.outline.XtendOutlineTreeProvider; import org.eclipse.xtext.common.types.JvmConstructor; import org.eclipse.xtext.common.types.JvmDeclaredType; import org.eclipse.xtext.common.types.JvmFeature; import org.eclipse.xtext.ui.editor.outline.IOutlineNode; import org.eclipse.xtext.ui.editor.outline.impl.EObjectNode; import org.jnario.feature.feature.Background; import org.jnario.feature.feature.Feature; import org.jnario.feature.feature.Scenario; /** * @author Sebastian Benz - Initial contribution and API */ public class FeatureOutlineTreeProvider extends XtendOutlineTreeProvider { // // @Override // public void createChildren(IOutlineNode parentNode, EObject modelElement) { // super.createChildren(parentNode, modelElement); // if (modelElement instanceof Feature) { // Feature feature = (Feature) modelElement; // Background background = feature.getBackground(); // if (background != null) { // EObjectNode classNode = createNode(parentNode, background); // createFeatureNodes(classNode, background); // } // for (Scenario member : feature.getScenarios()){ // EObjectNode classNode = createNode(parentNode, member); // createFeatureNodes(classNode, member); // } // } // // } // // protected XtendFeatureNode createNodeForFeature(IOutlineNode parentNode, // JvmDeclaredType inferredType, JvmFeature jvmFeature, // EObject semanticFeature, int inheritanceDepth) { // if(jvmFeature instanceof JvmConstructor){ // return null; // } // return super.createNodeForFeature(parentNode, inferredType, jvmFeature, // semanticFeature, inheritanceDepth); // } protected boolean _isLeaf(Scenario element) { return element.getMembers().isEmpty() && element.getSteps().isEmpty(); } protected boolean _isLeaf(Background element) { return element.getMembers().isEmpty() && element.getSteps().isEmpty(); } }