public Object[] getChildren(final Object parentElement) {
    try {
      if (parentElement instanceof IScriptModel) {
        return getExtendedChildren(
            parentElement,
            StandardModelElementContentProvider.concatenate(
                getScriptProjects((IScriptModel) parentElement),
                getNonJavaProjects((IScriptModel) parentElement)));
      }

      if (parentElement instanceof ProjectFragmentContainer) {
        return getExtendedChildren(
            parentElement, getContainerProjectFragments((ProjectFragmentContainer) parentElement));
      }

      if (parentElement instanceof IProject) {
        if (!((IProject) parentElement).isAccessible()) {
          return StandardModelElementContentProvider.NO_CHILDREN;
        }
        return getExtendedChildren(parentElement, ((IProject) parentElement).members());
      }

      return super.getChildren(parentElement);
    } catch (CoreException e) {
      return getExtendedChildren(parentElement, StandardModelElementContentProvider.NO_CHILDREN);
    }
  }
 /*
  * (non-Javadoc) Method declared on IContentProvider.
  */
 public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
   super.inputChanged(viewer, oldInput, newInput);
   fViewer = (TreeViewer) viewer;
   if (oldInput == null && newInput != null) {
     DLTKCore.addElementChangedListener(this);
   } else if (oldInput != null && newInput == null) {
     DLTKCore.removeElementChangedListener(this);
   }
   fInput = newInput;
 }
 /*
  * (non-Javadoc) Method declared on IContentProvider.
  */
 public void dispose() {
   super.dispose();
   DLTKCore.removeElementChangedListener(this);
   DLTKUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
 }