use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension in project polymap4-core by Polymap4.
the class NavigatorPipelineService method interceptRemove.
public PipelinedShapeModification interceptRemove(PipelinedShapeModification aRemoveModification) {
ContributorTrackingSet trackedSet = (ContributorTrackingSet) aRemoveModification.getChildren();
Set interestedExtensions = new LinkedHashSet();
for (Iterator iter = trackedSet.iterator(); iter.hasNext(); ) {
Object element = (Object) iter.next();
if (element instanceof TreePath) {
interestedExtensions.addAll(contentService.findOverrideableContentExtensionsForPossibleChild(((TreePath) element).getLastSegment()));
} else {
interestedExtensions = contentService.findOverrideableContentExtensionsForPossibleChild(element);
}
}
for (Iterator overridingExtensionsIter = interestedExtensions.iterator(); overridingExtensionsIter.hasNext(); ) pipelineInterceptRemove(aRemoveModification, trackedSet, (NavigatorContentExtension) overridingExtensionsIter.next());
return aRemoveModification;
}
use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension in project polymap4-core by Polymap4.
the class NavigatorPipelineService method interceptRefresh.
public boolean interceptRefresh(PipelinedViewerUpdate aRefreshSynchronization) {
boolean pipelined = false;
Object refreshable = null;
Set overrideableExtensions = new LinkedHashSet();
for (Iterator iter = aRefreshSynchronization.getRefreshTargets().iterator(); iter.hasNext(); ) {
refreshable = iter.next();
overrideableExtensions.addAll(contentService.findOverrideableContentExtensionsForPossibleChild(refreshable));
}
for (Iterator overrideableExtensionItr = overrideableExtensions.iterator(); overrideableExtensionItr.hasNext(); ) {
pipelined |= pipelineInterceptRefresh((NavigatorContentExtension) overrideableExtensionItr.next(), aRefreshSynchronization, refreshable);
}
return pipelined;
}
use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension in project polymap4-core by Polymap4.
the class NavigatorPipelineService method pipelineInterceptRefresh.
private boolean pipelineInterceptRefresh(final NavigatorContentExtension overrideableExtension, final PipelinedViewerUpdate aRefreshSynchronization, final Object refreshable) {
final boolean[] intercepted = new boolean[1];
final NavigatorContentExtension[] overridingExtensions = overrideableExtension.getOverridingExtensions();
for (int i = 0; i < overridingExtensions.length; i++) {
final NavigatorContentExtension nceLocal = overridingExtensions[i];
if (nceLocal.internalGetContentProvider().isPipelined()) {
SafeRunner.run(new NavigatorSafeRunnable() {
public void run() throws Exception {
intercepted[0] |= ((IPipelinedTreeContentProvider) nceLocal.internalGetContentProvider()).interceptRefresh(aRefreshSynchronization);
if (nceLocal.getDescriptor().hasOverridingExtensions())
intercepted[0] |= pipelineInterceptRefresh(nceLocal, aRefreshSynchronization, refreshable);
}
public void handleException(Throwable e) {
NavigatorPlugin.logError(0, NLS.bind(CommonNavigatorMessages.Exception_Invoking_Extension, new Object[] { nceLocal.getDescriptor().getId(), refreshable }), e);
}
});
}
}
return intercepted[0];
}
use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension in project polymap4-core by Polymap4.
the class NavigatorSaveablesService method createSaveablesProvider.
/**
* @param descriptor
* @return the SaveablesProvider, or null
*/
private SaveablesProvider createSaveablesProvider(NavigatorContentDescriptor descriptor) {
NavigatorContentExtension extension = contentService.getExtension(descriptor, true);
// Use getContentProvider to get the client objects, this is important
// for the adaptation below. See bug 306545
ITreeContentProvider contentProvider = extension.getContentProvider();
return (SaveablesProvider) AdaptabilityUtility.getAdapter(contentProvider, SaveablesProvider.class);
}
use of org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension in project tmdm-studio-se by Talend.
the class MDMNavigatorDecoratingLabelProvider method getToolTipText.
@Override
public String getToolTipText(Object element) {
if (getViewer() instanceof CommonViewer) {
CommonViewer viewer = (CommonViewer) getViewer();
INavigatorContentService contentService = viewer.getNavigatorContentService();
if (contentService != null && contentService instanceof NavigatorContentService) {
Collection<?> contentExtensions = ((NavigatorContentService) contentService).findPossibleLabelExtensions(element);
for (Iterator<?> itr = contentExtensions.iterator(); itr.hasNext(); ) {
Object extension = itr.next();
if (extension instanceof NavigatorContentExtension) {
ICommonLabelProvider provider = ((NavigatorContentExtension) extension).getLabelProvider();
if (provider instanceof CellLabelProvider) {
String toolTipText = ((CellLabelProvider) provider).getToolTipText(element);
if (toolTipText != null) {
return toolTipText;
}
}
}
}
}
}
return super.getToolTipText(element);
}
Aggregations