Search in sources :

Example 21 with IWorkbenchAdapter

use of org.eclipse.ui.model.IWorkbenchAdapter in project core by jcryptool.

the class FileExplorerContentProvider method getChildren.

/*
     * (non-Javadoc) Method declared on ITreeContentProvider.
     */
public Object[] getChildren(Object element) {
    List<Object> result = new LinkedList<Object>();
    IWorkbenchAdapter adapter = getAdapter(element);
    if (adapter != null) {
        Object[] children = adapter.getChildren(element);
        for (Object child : children) {
            if (canAdd(child))
                result.add(child);
        }
    }
    return result.toArray();
}
Also used : IWorkbenchAdapter(org.eclipse.ui.model.IWorkbenchAdapter) LinkedList(java.util.LinkedList)

Aggregations

IWorkbenchAdapter (org.eclipse.ui.model.IWorkbenchAdapter)21 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)6 Image (org.eclipse.swt.graphics.Image)5 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)4 Iterator (java.util.Iterator)3 IResource (org.eclipse.core.resources.IResource)3 IPreferenceNode (org.eclipse.jface.preference.IPreferenceNode)3 PropertyPageManager (org.eclipse.ui.internal.dialogs.PropertyPageManager)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 ISelection (org.eclipse.jface.viewers.ISelection)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 IOException (java.io.IOException)1 LinkedList (java.util.LinkedList)1 ExecutionException (org.eclipse.core.commands.ExecutionException)1 IFileStore (org.eclipse.core.filesystem.IFileStore)1 IContainer (org.eclipse.core.resources.IContainer)1 IFolder (org.eclipse.core.resources.IFolder)1 IProject (org.eclipse.core.resources.IProject)1 CoreException (org.eclipse.core.runtime.CoreException)1 IAdaptable (org.eclipse.core.runtime.IAdaptable)1