use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentDescriptor in project polymap4-core by Polymap4.
the class NavigatorContentService method getVisibleExtensionIds.
public String[] getVisibleExtensionIds() {
List visibleExtensionIds = new ArrayList();
NavigatorContentDescriptor[] descriptors = CONTENT_DESCRIPTOR_REGISTRY.getAllContentDescriptors();
for (int i = 0; i < descriptors.length; i++) {
if (assistant.isVisible(descriptors[i].getId())) {
visibleExtensionIds.add(descriptors[i].getId());
}
}
if (visibleExtensionIds.isEmpty()) {
return NO_EXTENSION_IDS;
}
return (String[]) visibleExtensionIds.toArray(new String[visibleExtensionIds.size()]);
}
use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentDescriptor 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;
}
Aggregations