01: package org.eclipse.ui.examples.jobs.actions;
02:
03: import org.eclipse.core.resources.*;
04: import org.eclipse.core.runtime.*;
05: import org.eclipse.jface.action.IAction;
06: import org.eclipse.jface.viewers.ISelection;
07: import org.eclipse.ui.IWorkbenchWindow;
08: import org.eclipse.ui.IWorkbenchWindowActionDelegate;
09:
10: public class ForegroundAction implements IWorkbenchWindowActionDelegate {
11: public void run(IAction action) {
12: try {
13: ResourcesPlugin.getWorkspace().run(
14: new IWorkspaceRunnable() {
15: public void run(IProgressMonitor monitor) {
16: //no-op
17: }
18: }, null);
19: } catch (OperationCanceledException e) {
20: e.printStackTrace();
21: } catch (CoreException e) {
22: e.printStackTrace();
23: }
24: }
25:
26: public void selectionChanged(IAction action, ISelection selection) {
27: //do nothing
28: }
29:
30: public void dispose() {
31: //do nothing
32: }
33:
34: public void init(IWorkbenchWindow window) {
35: //do nothing
36: }
37: }
|