use of org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter in project eclipse.platform.runtime by eclipse.
the class ConvertMessageBundleAction method run.
@Override
public void run(IAction action) {
if (fAccessorUnit == null)
return;
try {
final GotoResourceAction pAction = new GotoResourceAction(fPart);
IRunnableWithProgress runnable = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) {
pAction.run();
}
};
PlatformUI.getWorkbench().getProgressService().run(false, false, runnable);
IFile propertiesFile = (IFile) pAction.getResource();
if (propertiesFile == null)
return;
MessageBundleRefactoring refactoring = new MessageBundleRefactoring(fAccessorUnit.getTypes()[0], propertiesFile);
PerformRefactoringOperation op = new PerformRefactoringOperation(refactoring, CheckConditionsOperation.ALL_CONDITIONS);
PlatformUI.getWorkbench().getProgressService().run(false, false, new WorkbenchRunnableAdapter(op));
} catch (CoreException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
}
use of org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter in project eclipse.platform.runtime by eclipse.
the class RemoveUnusedMessagesAction method run.
@Override
public void run(IAction action) {
if (fAccessorUnit == null)
return;
try {
final GotoResourceAction pAction = new GotoResourceAction(fPart);
IRunnableWithProgress runnable = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) {
pAction.run();
}
};
PlatformUI.getWorkbench().getProgressService().run(false, false, runnable);
IFile propertiesFile = (IFile) pAction.getResource();
if (propertiesFile == null)
return;
RemoveUnusedMessages refactoring = new RemoveUnusedMessages(fAccessorUnit.getTypes()[0], propertiesFile);
PerformRefactoringOperation op = new PerformRefactoringOperation(refactoring, CheckConditionsOperation.ALL_CONDITIONS);
PlatformUI.getWorkbench().getProgressService().run(false, true, new WorkbenchRunnableAdapter(op));
} catch (CoreException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
}
Aggregations