use of org.eclipse.ui.internal.navigator.NavigatorSafeRunnable in project polymap4-core by Polymap4.
the class StructuredViewerManager method initialize.
/**
* @param aContentProvider
* @return True if all is well.
*/
public boolean initialize(final IStructuredContentProvider aContentProvider) {
final boolean[] result = new boolean[1];
SafeRunner.run(new NavigatorSafeRunnable() {
public void run() throws Exception {
if (aContentProvider != null) {
aContentProvider.inputChanged(viewer, cachedOldInput, cachedNewInput);
}
result[0] = true;
}
});
return result[0];
}
use of org.eclipse.ui.internal.navigator.NavigatorSafeRunnable in project polymap4-core by Polymap4.
the class CommonFilterDescriptor method createFilter.
/**
* @return An instance of the ViewerFilter defined by the extension. Callers
* of this method are responsible for managing the instantiated
* filter.
*/
public ViewerFilter createFilter() {
final ViewerFilter[] filter = new ViewerFilter[1];
SafeRunner.run(new NavigatorSafeRunnable() {
public void run() throws Exception {
if (filterExpression != null) {
if (element.getAttribute(ATT_CLASS) != null) {
NavigatorPlugin.log(IStatus.WARNING, 0, // $NON-NLS-1$
"A \"commonFilter\" was specified in " + element.getDeclaringExtension().getNamespaceIdentifier() + // $NON-NLS-1$
" which specifies a \"class\" attribute and an Core Expression.\n" + // $NON-NLS-1$
"Only the Core Expression will be respected.", null);
}
filter[0] = new CoreExpressionFilter(filterExpression);
return;
}
filter[0] = (ViewerFilter) element.createExecutableExtension(ATT_CLASS);
}
});
if (filter[0] != null)
return filter[0];
return SkeletonViewerFilter.INSTANCE;
}
use of org.eclipse.ui.internal.navigator.NavigatorSafeRunnable in project polymap4-core by Polymap4.
the class SafeDelegateTreeContentProvider method inputChanged.
public void inputChanged(final Viewer aViewer, final Object anOldInput, final Object aNewInput) {
viewer = (StructuredViewer) aViewer;
SafeRunner.run(new NavigatorSafeRunnable() {
public void run() throws Exception {
contentProvider.inputChanged(aViewer, anOldInput, aNewInput);
}
});
}
use of org.eclipse.ui.internal.navigator.NavigatorSafeRunnable in project polymap4-core by Polymap4.
the class NavigatorActionService method addCommonActionProviderMenu.
/**
* @param aMenu
*/
private void addCommonActionProviderMenu(final IMenuManager aMenu) {
final CommonActionProviderDescriptor[] providerDescriptors = CommonActionDescriptorManager.getInstance().findRelevantActionDescriptors(contentService, getContext());
if (providerDescriptors.length > 0) {
for (int i = 0; i < providerDescriptors.length; i++) {
final CommonActionProviderDescriptor providerDescriptorLocal = providerDescriptors[i];
SafeRunner.run(new NavigatorSafeRunnable() {
public void run() throws Exception {
if (!filterActionProvider(providerDescriptorLocal)) {
CommonActionProvider provider = getActionProviderInstance(providerDescriptorLocal);
provider.setContext(getContext());
provider.fillContextMenu(aMenu);
}
}
});
}
}
}
use of org.eclipse.ui.internal.navigator.NavigatorSafeRunnable in project polymap4-core by Polymap4.
the class NavigatorActionService method restoreState.
/**
* Use the given memento to restore the state of each Action Provider as it is initialized.
*
* @param aMemento
* The memento retrieved from the dialog settings
*/
public void restoreState(IMemento aMemento) {
Assert.isTrue(!disposed);
memento = aMemento;
synchronized (actionProviderInstances) {
for (Iterator actionProviderIterator = actionProviderInstances.values().iterator(); actionProviderIterator.hasNext(); ) {
final CommonActionProvider provider = (CommonActionProvider) actionProviderIterator.next();
SafeRunner.run(new NavigatorSafeRunnable() {
public void run() throws Exception {
provider.restoreState(memento);
}
});
}
}
}
Aggregations