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());
}
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());
}
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;
}
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());
}
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());
}
Aggregations