1 24 package org.objectweb.dolphin.actions; 25 26 import org.eclipse.jface.action.Action; 27 import org.eclipse.jface.action.IAction; 28 import org.eclipse.swt.widgets.Shell; 29 import org.eclipse.ui.IWorkbenchWindow; 30 import org.objectweb.dolphin.dialogs.DialogWorkspace; 31 32 33 37 public class ChangeWorkspaceAction extends Action { 38 39 42 private IWorkbenchWindow fWindow; 43 44 45 49 public ChangeWorkspaceAction(IWorkbenchWindow window) { 50 init(window); 51 setEnabled(true); 52 } 53 54 58 public void init(IWorkbenchWindow window) { 59 fWindow= window; 60 setId("org.objectweb.dolphin.actions.ChangeWorkspaceAction"); 61 setText("Switch Workspace"); 62 setToolTipText("Change the current workspace to another one"); 63 } 64 65 68 public void dispose() { 69 fWindow = null; 70 71 } 72 73 77 public void run(IAction action) { 78 run(); 79 80 } 81 82 83 84 87 public void run(){ 88 Shell parentshell = new Shell(); DialogWorkspace dialog = new DialogWorkspace(parentshell); 96 parentshell.pack(); 97 dialog.open(); 98 } 99 100 } 101 | Popular Tags |