Search in sources :

Example 1 with ContributorTrackingSet

use of org.eclipse.ui.internal.navigator.ContributorTrackingSet in project polymap4-core by Polymap4.

the class CommonViewer method add.

/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.jface.viewers.AbstractTreeViewer#add(java.lang.Object,
	 *      java.lang.Object[])
	 */
public void add(Object parentElement, Object[] childElements) {
    NavigatorPipelineService pipeDream = (NavigatorPipelineService) contentService.getPipelineService();
    PipelinedShapeModification modification = new PipelinedShapeModification(parentElement, new ContributorTrackingSet(contentService, childElements));
    pipeDream.interceptAdd(modification);
    Object parent = (parentElement == getInput()) ? getInput() : modification.getParent();
    super.add(parent, modification.getChildren().toArray());
}
Also used : NavigatorPipelineService(org.eclipse.ui.internal.navigator.NavigatorPipelineService) ContributorTrackingSet(org.eclipse.ui.internal.navigator.ContributorTrackingSet)

Example 2 with ContributorTrackingSet

use of org.eclipse.ui.internal.navigator.ContributorTrackingSet in project polymap4-core by Polymap4.

the class CommonViewer method remove.

/**
 * <p>
 * Removals are handled by refreshing the parents of each of the given
 * elements. The parents are determined via calls ot the contentProvider.
 * </p>
 *
 * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object[])
 */
public void remove(Object[] elements) {
    NavigatorPipelineService pipeDream = (NavigatorPipelineService) contentService.getPipelineService();
    PipelinedShapeModification modification = new PipelinedShapeModification(null, new ContributorTrackingSet(contentService, elements));
    pipeDream.interceptRemove(modification);
    super.remove(modification.getChildren().toArray());
}
Also used : NavigatorPipelineService(org.eclipse.ui.internal.navigator.NavigatorPipelineService) ContributorTrackingSet(org.eclipse.ui.internal.navigator.ContributorTrackingSet)

Example 3 with ContributorTrackingSet

use of org.eclipse.ui.internal.navigator.ContributorTrackingSet in project Pydev by fabioz.

the class PydevPackageExplorer method getPythonModelElement.

/**
 * @param element the element that should be gotten as an element from the pydev model
 * @return a pydev element or the same element passed as a parameter.
 */
private Object getPythonModelElement(Object element) {
    if (element instanceof IWrappedResource) {
        return element;
    }
    INavigatorPipelineService pipelineService = this.getNavigatorContentService().getPipelineService();
    if (element instanceof IAdaptable) {
        IAdaptable adaptable = (IAdaptable) element;
        IFile file = adaptable.getAdapter(IFile.class);
        if (file != null) {
            HashSet<Object> files = new ContributorTrackingSet((NavigatorContentService) this.getNavigatorContentService());
            files.add(file);
            pipelineService.interceptAdd(new PipelinedShapeModification(file.getParent(), files));
            if (files.size() > 0) {
                element = files.iterator().next();
            }
        }
    }
    return element;
}
Also used : INavigatorPipelineService(org.eclipse.ui.navigator.INavigatorPipelineService) IAdaptable(org.eclipse.core.runtime.IAdaptable) IFile(org.eclipse.core.resources.IFile) ContributorTrackingSet(org.eclipse.ui.internal.navigator.ContributorTrackingSet) PipelinedShapeModification(org.eclipse.ui.navigator.PipelinedShapeModification) IWrappedResource(org.python.pydev.navigator.elements.IWrappedResource)

Example 4 with ContributorTrackingSet

use of org.eclipse.ui.internal.navigator.ContributorTrackingSet in project eclipse.platform.ui by eclipse-platform.

the class CommonViewer method add.

@Override
public void add(Object parentElement, Object... childElements) {
    NavigatorPipelineService pipeDream = (NavigatorPipelineService) contentService.getPipelineService();
    PipelinedShapeModification modification = new PipelinedShapeModification(parentElement, new ContributorTrackingSet(contentService, childElements));
    pipeDream.interceptAdd(modification);
    Object parent = (parentElement == getInput()) ? getInput() : modification.getParent();
    super.add(parent, modification.getChildren().toArray());
}
Also used : NavigatorPipelineService(org.eclipse.ui.internal.navigator.NavigatorPipelineService) ContributorTrackingSet(org.eclipse.ui.internal.navigator.ContributorTrackingSet)

Example 5 with ContributorTrackingSet

use of org.eclipse.ui.internal.navigator.ContributorTrackingSet in project eclipse.platform.ui by eclipse-platform.

the class CommonViewer method remove.

/**
 * <p>
 * Removals are handled by refreshing the parents of each of the given
 * elements. The parents are determined via calls ot the contentProvider.
 * </p>
 *
 * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object[])
 */
@Override
public void remove(Object... elements) {
    NavigatorPipelineService pipeDream = (NavigatorPipelineService) contentService.getPipelineService();
    PipelinedShapeModification modification = new PipelinedShapeModification(null, new ContributorTrackingSet(contentService, elements));
    pipeDream.interceptRemove(modification);
    super.remove(modification.getChildren().toArray());
}
Also used : NavigatorPipelineService(org.eclipse.ui.internal.navigator.NavigatorPipelineService) ContributorTrackingSet(org.eclipse.ui.internal.navigator.ContributorTrackingSet)

Aggregations

ContributorTrackingSet (org.eclipse.ui.internal.navigator.ContributorTrackingSet)5 NavigatorPipelineService (org.eclipse.ui.internal.navigator.NavigatorPipelineService)4 IFile (org.eclipse.core.resources.IFile)1 IAdaptable (org.eclipse.core.runtime.IAdaptable)1 INavigatorPipelineService (org.eclipse.ui.navigator.INavigatorPipelineService)1 PipelinedShapeModification (org.eclipse.ui.navigator.PipelinedShapeModification)1 IWrappedResource (org.python.pydev.navigator.elements.IWrappedResource)1