use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension in project polymap4-core by Polymap4.
the class NavigatorContentServiceContentProvider method findParents.
private Set findParents(final Object anElement) {
final Set descriptors = contentService.findDescriptorsWithPossibleChild(anElement, false);
final Set parents = new LinkedHashSet();
for (final Iterator itr = descriptors.iterator(); itr.hasNext(); ) {
SafeRunner.run(new NavigatorSafeRunnable() {
NavigatorContentDescriptor foundDescriptor;
NavigatorContentExtension foundExtension;
Object parent = null;
public void run() throws Exception {
foundDescriptor = (NavigatorContentDescriptor) itr.next();
foundExtension = contentService.getExtension(foundDescriptor);
if (!isOverridingDescriptorInSet(foundExtension.getDescriptor(), descriptors)) {
if (foundExtension.internalGetContentProvider().isTreePath()) {
TreePath[] parentTreePaths = ((ITreePathContentProvider) foundExtension.internalGetContentProvider()).getParents(anElement);
for (int i = 0; i < parentTreePaths.length; i++) {
parent = parentTreePaths[i].getLastSegment();
if ((parent = findParent(foundExtension, anElement, parent)) != null)
parents.add(parent);
}
} else {
parent = foundExtension.internalGetContentProvider().getParent(anElement);
if ((parent = findParent(foundExtension, anElement, parent)) != null)
parents.add(parent);
}
}
}
public void handleException(Throwable e) {
NavigatorPlugin.logError(0, NLS.bind(CommonNavigatorMessages.Exception_Invoking_Extension, new Object[] { foundExtension.getDescriptor().getId(), anElement }), e);
}
});
}
return parents;
}
use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension in project polymap4-core by Polymap4.
the class NavigatorContentServiceLabelProvider method getColumnImage.
public Image getColumnImage(Object element, int columnIndex) {
Collection contentExtensions = contentService.findPossibleLabelExtensions(element);
Image image = null;
for (Iterator itr = contentExtensions.iterator(); itr.hasNext() && image == null; ) {
image = findImage((NavigatorContentExtension) itr.next(), element, columnIndex);
}
return image;
}
use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension in project polymap4-core by Polymap4.
the class NavigatorPipelineService method interceptUpdate.
public boolean interceptUpdate(PipelinedViewerUpdate anUpdateSynchronization) {
boolean pipelined = false;
Object refreshable = null;
Set overrideableExtensions = new LinkedHashSet();
for (Iterator iter = anUpdateSynchronization.getRefreshTargets().iterator(); iter.hasNext(); ) {
refreshable = iter.next();
overrideableExtensions.addAll(contentService.findOverrideableContentExtensionsForPossibleChild(refreshable));
}
for (Iterator overrideableExtensionItr = overrideableExtensions.iterator(); overrideableExtensionItr.hasNext(); ) {
pipelined |= pipelineInterceptUpdate((NavigatorContentExtension) overrideableExtensionItr.next(), anUpdateSynchronization, refreshable);
}
return pipelined;
}
use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension in project polymap4-core by Polymap4.
the class NavigatorPipelineService method pipelineInterceptAdd.
private void pipelineInterceptAdd(final PipelinedShapeModification anAddModification, final ContributorTrackingSet trackedSet, final INavigatorContentDescriptor descriptor) {
if (descriptor.hasOverridingExtensions()) {
Set overridingDescriptors = descriptor.getOverriddingExtensions();
for (Iterator overridingDescriptorsItr = overridingDescriptors.iterator(); overridingDescriptorsItr.hasNext(); ) {
INavigatorContentDescriptor overridingDescriptor = (INavigatorContentDescriptor) overridingDescriptorsItr.next();
if (contentService.isVisible(overridingDescriptor.getId()) && contentService.isActive(overridingDescriptor.getId())) {
trackedSet.setContributor((NavigatorContentDescriptor) overridingDescriptor, (NavigatorContentDescriptor) descriptor);
final NavigatorContentExtension extension = contentService.getExtension(overridingDescriptor);
if (extension.internalGetContentProvider().isPipelined()) {
SafeRunner.run(new NavigatorSafeRunnable() {
public void run() throws Exception {
((IPipelinedTreeContentProvider) extension.internalGetContentProvider()).interceptAdd(anAddModification);
}
public void handleException(Throwable e) {
NavigatorPlugin.logError(0, NLS.bind(CommonNavigatorMessages.Exception_Invoking_Extension, new Object[] { extension.getDescriptor().getId(), null }), e);
}
});
}
trackedSet.setContributor(null, null);
pipelineInterceptAdd(anAddModification, trackedSet, overridingDescriptor);
}
}
}
}
Aggregations