/*******************************************************************************
 * Copyright (c) 2000, 2008 IBM Corporation 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
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.swt.internal.flex;

import org.eclipse.swt.widgets.TreeItem;

import intrinsic.mx.collections.ICollectionView;
import intrinsic.mx.controls.treeClasses.ITreeDataDescriptor;

public class SWTTreeDataDescriptor implements ITreeDataDescriptor{
/*+
   public function addChildAt(arg0: Object, arg1: Object, arg2: int, arg3: Object = null): Boolean {
    return _addChildAt(arg0, arg1, arg2, arg3);
  }
  public function getChildren(arg0: Object, arg1: Object = null): ICollectionView {
    return _getChildren(arg0, arg1);
  }
  public function getData(arg0: Object, arg1: Object = null): Object {
    return _getData(arg0, arg1);
  }
  public function hasChildren(arg0: Object, arg1: Object = null): Boolean {
    return _hasChildren(arg0, arg1);
  }
  public function isBranch(arg0: Object, arg1: Object = null): Boolean {
    return _isBranch(arg0, arg1);
  }
  public function removeChildAt(arg0: Object, arg1: Object, arg2: int, arg3: Object = null): Boolean {
    return _removeChildAt(arg0, arg1, arg2, arg3);
  }
+*/

	public boolean _addChildAt(Object parent, Object newChild, int index, Object model) {
		return false;
	}

	public ICollectionView _getChildren(Object node, Object model) {
		TreeItem item = (TreeItem)node;
		return item.items;
	}

	public Object _getData(Object node, Object model) {
		TreeItem item = (TreeItem)node;
		return item.getText();
	}

	public boolean _hasChildren(Object node, Object model) {
		TreeItem item = (TreeItem)node;
		return item.items.length > 0;
	}

	public boolean _isBranch(Object node, Object model) {
		TreeItem item = (TreeItem)node;
		return item.items.length > 0;
	}

	public boolean _removeChildAt(Object parent, Object child, int index, Object model) {
		return false;
	}

}
