1 11 package org.eclipse.pde.internal.ui.editor.target; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.jface.dialogs.MessageDialog; 15 import org.eclipse.jface.window.ApplicationWindow; 16 import org.eclipse.pde.internal.core.itarget.ITargetModel; 17 import org.eclipse.pde.internal.ui.PDEUIMessages; 18 import org.eclipse.swt.widgets.Shell; 19 20 public class OpenTargetProfileAction extends Action { 21 22 private ITargetModel fTargetModel; 23 private Shell fShell; 24 private String fTargetName; 25 26 public OpenTargetProfileAction(Shell shell, ITargetModel model, String targetName) { 27 fShell = shell; 28 fTargetModel = model; 29 fTargetName = targetName; 30 } 31 32 public void run() { 33 if (fTargetModel == null) { 34 MessageDialog.openError(fShell, PDEUIMessages.OpenTargetProfileAction_title, PDEUIMessages.OpenTargetProfileAction_missingProfile); 35 return; 36 } 37 38 if (!fTargetModel.isLoaded()) { 39 MessageDialog.openError(fShell, PDEUIMessages.OpenTargetProfileAction_title, PDEUIMessages.OpenTargetProfileAction_invalidProfile); 40 return; 41 } 42 43 ApplicationWindow appWindow = new TargetProfileWindow(fShell, fTargetModel, fTargetName); 44 appWindow.create(); 45 appWindow.open(); 46 } 47 48 } 49 | Popular Tags |