/*******************************************************************************
* Copyright (c) 2011 Sebastian Benz.
* 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:
* Sebastian Benz - initial API and implementation
******************************************************************************/
/*
* generated by Xtext
*/
package de.sebastianbenz.task.ui.outline;
import org.eclipse.xtext.ui.editor.outline.impl.AbstractOutlineNode;
import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider;
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode;
import org.eclipse.xtext.ui.editor.outline.impl.EObjectNode;
import de.sebastianbenz.task.Container;
import de.sebastianbenz.task.Content;
import de.sebastianbenz.task.TaskModel;
/**
* customization of the default outline structure
*
*/
public class TaskOutlineTreeProvider extends DefaultOutlineTreeProvider {
protected void _createChildren(DocumentRootNode parentNode, TaskModel todo) {
for (Content content : todo.getChildren()) {
EObjectNode child = createEObjectNode(parentNode, content);
createChildrenDispatcher.invoke(child, content);
}
}
protected void _createChildren(AbstractOutlineNode parentNode,
Container content) {
for (Content child : content.getChildren()) {
EObjectNode childNode = createEObjectNode(parentNode, child);
createChildrenDispatcher.invoke(childNode, child);
}
}
protected boolean _isLeaf(Container container){
return container.getChildren().isEmpty();
}
}