use of org.eclipse.ui.internal.navigator.NavigatorSafeRunnable in project polymap4-core by Polymap4.
the class NavigatorActionService method fillActionBars.
/**
* Request that the service invoke extensions to fill the given IActionBars with retargetable
* actions or view menu contributions from Action Providers that are interested in the given
* selection.
*
* @param theActionBars
* The action bars in use by the current view site.
* @see ActionGroup#fillActionBars(IActionBars)
*/
public void fillActionBars(final IActionBars theActionBars) {
Assert.isTrue(!disposed);
theActionBars.clearGlobalActionHandlers();
ActionContext context = getContext();
if (context == null) {
context = new ActionContext(StructuredSelection.EMPTY);
}
final CommonActionProviderDescriptor[] providerDescriptors = CommonActionDescriptorManager.getInstance().findRelevantActionDescriptors(contentService, context);
if (providerDescriptors.length > 0) {
for (int i = 0; i < providerDescriptors.length; i++) {
final CommonActionProviderDescriptor providerDesciptorLocal = providerDescriptors[i];
final ActionContext actionContextLocal = context;
SafeRunner.run(new NavigatorSafeRunnable() {
public void run() throws Exception {
if (!filterActionProvider(providerDesciptorLocal)) {
CommonActionProvider provider = null;
provider = getActionProviderInstance(providerDesciptorLocal);
provider.setContext(actionContextLocal);
provider.fillActionBars(theActionBars);
provider.updateActionBars();
}
}
});
}
}
theActionBars.updateActionBars();
theActionBars.getMenuManager().update();
}
use of org.eclipse.ui.internal.navigator.NavigatorSafeRunnable in project polymap4-core by Polymap4.
the class NavigatorContentExtension method dispose.
/**
* Dispose of any resources acquired during the lifecycle of the extension.
*/
public void dispose() {
try {
synchronized (this) {
SafeRunner.run(new NavigatorSafeRunnable() {
public void run() throws Exception {
if (contentProvider != null) {
contentProvider.dispose();
}
}
});
SafeRunner.run(new NavigatorSafeRunnable() {
public void run() throws Exception {
if (labelProvider != null) {
labelProvider.removeListener((ILabelProviderListener) contentService.createCommonLabelProvider());
labelProvider.dispose();
}
}
});
}
} finally {
isDisposed = true;
}
}
Aggregations