[Esbox-commits] r1973 - in trunk/org.maemo.esbox.scratchbox.sb1: META-INF src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard

raul at garage.maemo.org raul at garage.maemo.org
Wed Aug 19 18:22:42 EEST 2009


Author: raul
Date: 2009-08-19 18:22:41 +0300 (Wed, 19 Aug 2009)
New Revision: 1973

Modified:
   trunk/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF
   trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1SDKWizard.java
   trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java
   trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerSelectionWizardPage.java
Log:
maemo sdk vm installer

Modified: trunk/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF	2009-08-19 14:43:29 UTC (rev 1972)
+++ trunk/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF	2009-08-19 15:22:41 UTC (rev 1973)
@@ -19,4 +19,5 @@
 Export-Package: org.maemo.esbox.internal.scratchbox.sb1.command;x-friends:="org.maemo.esbox.scratchbox.tests",
  org.maemo.esbox.internal.scratchbox.sb1.core;x-friends:="org.maemo.esbox.scratchbox.tests,org.maemo.esbox.tests",
  org.maemo.esbox.internal.scratchbox.sb1.provider;x-friends:="org.maemo.esbox.scratchbox.tests",
+ org.maemo.esbox.internal.scratchbox.sb1.ui.wizard,
  org.maemo.esbox.scratchbox.sb1.sdk

Modified: trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1SDKWizard.java
===================================================================
--- trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1SDKWizard.java	2009-08-19 14:43:29 UTC (rev 1972)
+++ trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1SDKWizard.java	2009-08-19 15:22:41 UTC (rev 1973)
@@ -21,13 +21,18 @@
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.window.Window;
 import org.eclipse.jface.wizard.IWizardContainer;
 import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWizard;
 import org.maemo.esbox.internal.scratchbox.sb1.Activator;
 import org.maemo.esbox.internal.scratchbox.sb1.IHelpID;
@@ -246,6 +251,33 @@
 	public void init(IWorkbench workbench, IStructuredSelection selection) {
 	}
 	
+	/**
+	 * Starts a new Wizard instance
+	 * @param defaultTargets If not null the default selected targets will be these
+	 * 
+	 */
+	public static IStatus startWizard() {
+		IWorkbenchWindow activeWorkbenchWindow = Activator.getDefault()
+				.getWorkbench().getActiveWorkbenchWindow();
+		if (activeWorkbenchWindow == null) {
+			// action has been disposed
+			return Activator.createStatus(IStatus.ERROR, "Cannot open Scratchbox 1 SDK wizard");
+		}
+		
+		NewScratchbox1SDKWizard wizard = new NewScratchbox1SDKWizard();
+		wizard.init(activeWorkbenchWindow.getWorkbench(),
+				StructuredSelection.EMPTY);
+		Shell parent = activeWorkbenchWindow.getShell();
+		WizardDialog dialog = new WizardDialog(parent, wizard);
+		dialog.create();
+		int result = dialog.open();
+		if (result == Window.CANCEL)
+			return Activator.createStatus(IStatus.CANCEL, "Scratchbox 1 SDK installation was canceled");
+		else
+			return Activator.createStatus(IStatus.OK, "Scratchbox 1 SDK has finished");
+			
+	}
+	
 	public class Scratchbox1SDKInstallerWorkPage extends
 			Scratchbox1InstallerWorkPage {
 		private Label freeSpaceWarningLabel;

Modified: trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java
===================================================================
--- trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java	2009-08-19 14:43:29 UTC (rev 1972)
+++ trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java	2009-08-19 15:22:41 UTC (rev 1973)
@@ -20,9 +20,19 @@
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.*;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.*;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWizard;
 import org.maemo.esbox.internal.scratchbox.sb1.Activator;
 import org.maemo.esbox.internal.scratchbox.sb1.IHelpID;
 import org.maemo.esbox.internal.scratchbox.sb1.ui.wizard.nokiabin.NokiaBinariesInstallWizard;
@@ -216,4 +226,30 @@
 	 */
 	public void init(IWorkbench workbench, IStructuredSelection selection) {
 	}
-}
\ No newline at end of file
+	
+	/**
+	 * Starts a new Wizard instance
+	 * @param defaultTargets If not null the default selected targets will be these
+	 * 
+	 */
+	public static IStatus startWizard() {
+		IWorkbenchWindow activeWorkbenchWindow = Activator.getDefault()
+				.getWorkbench().getActiveWorkbenchWindow();
+		if (activeWorkbenchWindow == null) {
+			// action has been disposed
+			return Activator.createStatus(IStatus.ERROR, "Cannot open Scratchbox 1 SDK wizard");
+		}
+		
+		NewScratchbox1TargetWizard wizard = new NewScratchbox1TargetWizard();
+		wizard.init(activeWorkbenchWindow.getWorkbench(),
+				StructuredSelection.EMPTY);
+		Shell parent = activeWorkbenchWindow.getShell();
+		WizardDialog dialog = new WizardDialog(parent, wizard);
+		dialog.create();
+		int result = dialog.open();
+		if (result == Window.CANCEL)
+			return Activator.createStatus(IStatus.CANCEL, "Scratchbox 1 target installation was canceled");
+		else
+			return Activator.createStatus(IStatus.OK, "Scratchbox 1 target has finished");
+	}
+}

Modified: trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerSelectionWizardPage.java
===================================================================
--- trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerSelectionWizardPage.java	2009-08-19 14:43:29 UTC (rev 1972)
+++ trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerSelectionWizardPage.java	2009-08-19 15:22:41 UTC (rev 1973)
@@ -339,7 +339,7 @@
 					WARNING);
 		}
 		setPageComplete(true);
-		getWizard().setCanFinish(false);
+		getWizard().setCanFinish(true);
 	}
 
 	/* (non-Javadoc)



More information about the Esbox-commits mailing list