blob: 6dfda52ee0b0002de89f0fe037c955c7824752d0 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2010 itemis AG (http://www.itemis.eu) 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
*******************************************************************************/
package org.eclipse.xtext.example.arithmetics.ui.outline;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.example.arithmetics.arithmetics.Definition;
import org.eclipse.xtext.example.arithmetics.arithmetics.Module;
import org.eclipse.xtext.ui.editor.outline.IOutlineNode;
import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider;
/**
* customization of the default outline structure
*
*/
public class ArithmeticsOutlineTreeProvider extends DefaultOutlineTreeProvider {
protected void _createChildren(IOutlineNode parentNode, Module module) {
for(Definition definition : EcoreUtil2.typeSelect(module.eContents(), Definition.class)) {
createNode(parentNode, definition);
}
}
protected boolean _isLeaf(Definition definition) {
return true;
}
}