Search in sources :

Example 6 with OffWorkspaceResourceTreeNode

use of com.devonfw.cobigen.eclipse.wizard.common.model.stubs.OffWorkspaceResourceTreeNode in project cobigen by devonfw.

the class SelectFileContentProvider method filter.

/**
 * Filters the {@link TreeViewer} contents by the given paths
 *
 * @param paths to be filtered
 * @param offScopeResourceTree resource tree for workspace external files
 */
public void filter(Set<String> paths, List<OffWorkspaceResourceTreeNode> offScopeResourceTree) {
    this.filteredPaths = new HashSet<>(paths);
    this._cachedChildren.clear();
    this._cachedPackageFragmentRoots.clear();
    HierarchicalTreeOperator.resetCache();
    this.offScopeResourceTree = offScopeResourceTree;
    this._cachedProvidedResources.clear();
    Deque<OffWorkspaceResourceTreeNode> worklist = Lists.newLinkedList(offScopeResourceTree);
    while (!worklist.isEmpty()) {
        OffWorkspaceResourceTreeNode next = worklist.pop();
        if (next.hasChildren()) {
            worklist.addAll(next.getChildren());
        } else {
            this._cachedProvidedResources.put(next.getAbsolutePathStr(), next);
        }
    }
}
Also used : OffWorkspaceResourceTreeNode(com.devonfw.cobigen.eclipse.wizard.common.model.stubs.OffWorkspaceResourceTreeNode)

Aggregations

OffWorkspaceResourceTreeNode (com.devonfw.cobigen.eclipse.wizard.common.model.stubs.OffWorkspaceResourceTreeNode)6 IJavaElementStub (com.devonfw.cobigen.eclipse.wizard.common.model.stubs.IJavaElementStub)2 IResourceStub (com.devonfw.cobigen.eclipse.wizard.common.model.stubs.IResourceStub)2 Path (java.nio.file.Path)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 IJavaElement (org.eclipse.jdt.core.IJavaElement)2 TreePath (org.eclipse.jface.viewers.TreePath)2 SelectFileContentProvider (com.devonfw.cobigen.eclipse.wizard.common.model.SelectFileContentProvider)1 IFolder (org.eclipse.core.resources.IFolder)1 IProject (org.eclipse.core.resources.IProject)1 IResource (org.eclipse.core.resources.IResource)1 JavaModelException (org.eclipse.jdt.core.JavaModelException)1 JavaElementImageProvider (org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider)1 MessageDialog (org.eclipse.jface.dialogs.MessageDialog)1 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)1 CheckboxTreeViewer (org.eclipse.jface.viewers.CheckboxTreeViewer)1 Image (org.eclipse.swt.graphics.Image)1