{
public Object[] getChildren(Object parentElement)
{
if (parentElement instanceof ICompoundModelElement)
{
ICompoundModelElement model = (ICompoundModelElement) parentElement;
return model.children();
}
return null;
}
public Object getParent(Object element)
{
if (element instanceof IModelElement)
{
IModelElement model = (IModelElement) element;
return model.getParent();
}
return null;
}
public boolean hasChildren(Object element)
{
if (element instanceof ICompoundModelElement)
{
ICompoundModelElement model = (ICompoundModelElement) element;
return model.children().length > 0;
}
return false;
}
public Object[] getElements(Object inputElement)
{
IBundleRepository rep = (IBundleRepository) inputElement;
IRepositoryModel model = SigilCore.getRepositoryModel(rep);
if ( model.getProblem() == null ) {
return getBundles(rep);
}
else {
return new Object[] { model.getProblem() };
}
}
});
treeViewer.setComparator(new ModelElementComparator());