/** @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) */ @SuppressWarnings("unchecked") public Object getParent(final Object element) { if (element instanceof IFile) { return null; } else if (element instanceof SimpleTree) { final SimpleTree<Object> treeData = (SimpleTree<Object>) element; return treeData.getParent(); } else { return null; } }
/** @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) */ @SuppressWarnings("unchecked") public boolean hasChildren(final Object element) { if (element instanceof IFile) { final IFile file = (IFile) element; if (fileToTreeMap == null || fileToTreeMap.get(file) == null) { updateModel(file); } return fileToTreeMap.get(file).hasChildren(); } else if (element instanceof SimpleTree) { final SimpleTree<Object> treeData = (SimpleTree<Object>) element; return treeData.hasChildren(); } else { return false; } }
/** @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) */ @SuppressWarnings("unchecked") public Object[] getChildren(final Object parentElement) { if (parentElement instanceof IFile) { final IFile file = (IFile) parentElement; if (fileToTreeMap == null || fileToTreeMap.get(file) == null) { updateModel(file); } return fileToTreeMap.get(file).getChildren(); } else if (parentElement instanceof SimpleTree) { final SimpleTree<Object> simpleTree = (SimpleTree<Object>) parentElement; return simpleTree.getChildren(); } else { return CPNModelContentProvider.NO_CHILDREN; } }