[Esbox-commits] r1978 - in branches/work_Andre: org.maemo.esbox.help/html/tasks org.maemo.esbox.launch.analysis org.maemo.esbox.product org.maemo.esbox.scratchbox.sb1/META-INF org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard org.maemo.esbox.tests/src/org/maemo/esbox/tests/common org.maemo.esbox.vm/META-INF org.maemo.esbox.vm.vmware org.maemo.esbox.vm.vmware/META-INF org.maemo.esbox.vm.vmware/data org.maemo.esbox.vm.vmware/icons org.maemo.esbox.vm.vmware/icons/full org.maemo.esbox.vm.vmware/icons/full/etool16 org.maemo.esbox.vm.vmware/icons/full/wizban org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards
andregomes at garage.maemo.org
andregomes at garage.maemo.org
Thu Aug 20 00:23:23 EEST 2009
Author: andregomes
Date: 2009-08-20 00:23:20 +0300 (Thu, 20 Aug 2009)
New Revision: 1978
Added:
branches/work_Andre/org.maemo.esbox.vm.vmware/data/
branches/work_Andre/org.maemo.esbox.vm.vmware/data/license.txt
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine.png
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine_48.png
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine_64.png
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/wizban/
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/wizban/virtual_machine_wiz.png
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/ui/
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallData.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallationWorkPage.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java
Removed:
branches/work_Andre/org.maemo.esbox.vm.vmware/data/license.txt
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine.png
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine_48.png
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine_64.png
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/wizban/
branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/wizban/virtual_machine_wiz.png
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/ui/
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallData.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallationWorkPage.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java
Modified:
branches/work_Andre/org.maemo.esbox.help/html/tasks/UsingFlasherWizard.html
branches/work_Andre/org.maemo.esbox.launch.analysis/plugin.xml
branches/work_Andre/org.maemo.esbox.product/about.mappings
branches/work_Andre/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF
branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1SDKWizard.java
branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java
branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerSelectionWizardPage.java
branches/work_Andre/org.maemo.esbox.tests/src/org/maemo/esbox/tests/common/TestOProfileValgrindSupport.java
branches/work_Andre/org.maemo.esbox.vm.vmware/META-INF/MANIFEST.MF
branches/work_Andre/org.maemo.esbox.vm.vmware/plugin.xml
branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/Activator.java
branches/work_Andre/org.maemo.esbox.vm/META-INF/MANIFEST.MF
Log:
Merging with trunk.
Modified: branches/work_Andre/org.maemo.esbox.help/html/tasks/UsingFlasherWizard.html
===================================================================
--- branches/work_Andre/org.maemo.esbox.help/html/tasks/UsingFlasherWizard.html 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.help/html/tasks/UsingFlasherWizard.html 2009-08-19 21:23:20 UTC (rev 1978)
@@ -65,18 +65,10 @@
</p>
<p>
- Note that the flasher binary is currently only available on a Linux host.
- If you are using Eclipse outside Linux, the current Build Machine will run the
- flasher, and the USB connection to the device will need to be "attached"
- to the virtual machine. (The device will show up as "Nokia N8x0 Update Mode".)
+ <b>NOTE:</b> If you are using <b>build machine</b> to flash the device then the USB connection to
+ the device will need to be "attached" to the virtual machine. VirtualBox and VMWare support USB,
+ but QEMU 0.9.x does not support USB at all.
</p>
-
- <p>
- <b>NOTE:</b> QEMU 0.9.x does not (currently) support USB at all, so you cannot use
- it with the flasher wizard. Also, VirtualBox seems to have problems connecting
- to the Internet Tablet in the Update Mode. Your best bet is running the flasher
- natively from Linux or using VMware.
- </p>
</li>
@@ -113,7 +105,7 @@
</p>
<p>
See
- <a href="http://pc-connectivity.garage.maemo.org/beta1/documentation_usbnet.html#Setup_USB_Network_on_Windows">
+ <a href="http://pc-connectivity.garage.maemo.org/documentation_usbnet.html#Setup_USB_Network_on_Windows">
the PC Connectivity page
</a>
for information about setting up Windows networking after using the
@@ -171,7 +163,7 @@
Click <strong>Next</strong>. The wizard will now download the flasher binary (once)
and also install any driver software required for communicating with
the device in flashing mode. This may install additional software,
- such as the <a href="pc-connectivity.garage.maemo.org">Host PC Connectivity software</a>.
+ such as the <a href="http://pc-connectivity.garage.maemo.org/">Host PC Connectivity software</a>.
<p/>
<img src="../images/flash/dialog-flash-get-flasher.png" />
</li>
@@ -204,8 +196,7 @@
<li>
<p>
- Once you hit <strong>F
- model = new FlasherToolModel();inish</strong>, the wizard will download the
+ Once you hit <strong>Finish</strong>, the wizard will download the
image(s) and invoke the flasher.
<p/>
Modified: branches/work_Andre/org.maemo.esbox.launch.analysis/plugin.xml
===================================================================
--- branches/work_Andre/org.maemo.esbox.launch.analysis/plugin.xml 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.launch.analysis/plugin.xml 2009-08-19 21:23:20 UTC (rev 1978)
@@ -205,6 +205,9 @@
<test
forcePluginActivation="true"
property="org.maemo.mica.maemosdk.isEmulatorTarget"/>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.maemosdk.isX86Target"/>
<test
forcePluginActivation="true"
property="org.maemo.mica.cpp.isCppLaunchable"/>
@@ -474,6 +477,9 @@
<test
forcePluginActivation="true"
property="org.maemo.mica.maemosdk.isEmulatorTarget"/>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.maemosdk.isX86Target"/>
<test
forcePluginActivation="true"
property="org.maemo.mica.python.isPythonLaunchable"/>
Modified: branches/work_Andre/org.maemo.esbox.product/about.mappings
===================================================================
--- branches/work_Andre/org.maemo.esbox.product/about.mappings 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.product/about.mappings 2009-08-19 21:23:20 UTC (rev 1978)
@@ -7,4 +7,4 @@
# e.g. "0=20020612"
# This value will be added automatically via the build scripts
0=20090211-1700
-1=I20090806
\ No newline at end of file
+1=I20090819
Modified: branches/work_Andre/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF
===================================================================
--- branches/work_Andre/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF 2009-08-19 21:23:20 UTC (rev 1978)
@@ -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: branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1SDKWizard.java
===================================================================
--- branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1SDKWizard.java 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1SDKWizard.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -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: branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java
===================================================================
--- branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -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: branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerSelectionWizardPage.java
===================================================================
--- branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerSelectionWizardPage.java 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerSelectionWizardPage.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -339,7 +339,7 @@
WARNING);
}
setPageComplete(true);
- getWizard().setCanFinish(false);
+ getWizard().setCanFinish(true);
}
/* (non-Javadoc)
Modified: branches/work_Andre/org.maemo.esbox.tests/src/org/maemo/esbox/tests/common/TestOProfileValgrindSupport.java
===================================================================
--- branches/work_Andre/org.maemo.esbox.tests/src/org/maemo/esbox/tests/common/TestOProfileValgrindSupport.java 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.tests/src/org/maemo/esbox/tests/common/TestOProfileValgrindSupport.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -17,11 +17,14 @@
import org.junit.Test;
import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
+import org.maemo.mica.common.analysis.adapters.ILtraceSupportAdapter;
import org.maemo.mica.common.analysis.adapters.IOProfileSupportAdapter;
import org.maemo.mica.common.analysis.adapters.IValgrindSupportAdapter;
import org.maemo.mica.common.core.machine.IMachine;
import org.maemo.mica.common.core.sdk.ISDKTarget;
import org.maemo.mica.common.core.tests.TestUtils;
+import org.maemo.mica.internal.api.common.core.sdk.MachineSDK;
+import org.maemo.mica.internal.api.common.core.sdk.MachineSDKTarget;
import org.maemo.mica.internal.api.protocol.ssh.DeviceSSHLinuxMachine;
import org.maemo.mica.protocol.ssh.SSHConfiguration;
@@ -40,18 +43,21 @@
for (ISDKTarget sdkTarget : ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets()) {
IOProfileSupportAdapter oprofileSupport = (IOProfileSupportAdapter) sdkTarget.getAdapter(IOProfileSupportAdapter.class);
IValgrindSupportAdapter valgrindSupportAdapter = (IValgrindSupportAdapter) sdkTarget.getAdapter(IValgrindSupportAdapter.class);
+ ILtraceSupportAdapter ltraceAdapter = (ILtraceSupportAdapter) sdkTarget.getAdapter(ILtraceSupportAdapter.class);
if (TestUtils.isSupportedSDKTarget(sdkTarget)) {
assertNotNull(sdkTarget.getName(), oprofileSupport);
assertNotNull(sdkTarget.getName(), valgrindSupportAdapter);
+ assertNotNull(sdkTarget.getName(), ltraceAdapter);
- IMachine machine = sdkTarget.getMachine();
if (sdkTarget.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL)) {
armelTarget = sdkTarget;
- assertNotNull(oprofileSupport.validateSupport(machine)); // not a device
- assertNotNull(valgrindSupportAdapter.validateSupport(machine)); // no ARMEL port of valgrind known
+ assertNotNull(oprofileSupport.validateSupport(armelTarget)); // not a device
+ assertNotNull(valgrindSupportAdapter.validateSupport(armelTarget)); // no ARMEL port of valgrind known
+ assertNotNull(ltraceAdapter.validateSupport(armelTarget)); // no ARMEL support on emulator
} else if (sdkTarget.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_X86)) {
- assertNotNull(oprofileSupport.validateSupport(machine)); // not a device
- assertNull(valgrindSupportAdapter.validateSupport(machine));
+ assertNotNull(oprofileSupport.validateSupport(sdkTarget)); // not a device
+ assertNull(valgrindSupportAdapter.validateSupport(sdkTarget)); // only supported on emulator
+ assertNull(ltraceAdapter.validateSupport(sdkTarget)); // works here
}
}
}
@@ -59,16 +65,28 @@
if (armelTarget != null) {
SSHConfiguration sshConfig = new SSHConfiguration();
IMachine machine = new DeviceSSHLinuxMachine("foo", sshConfig, null);
-
+ ISDKTarget machineTarget = new MachineSDKTarget(new MachineSDK(
+ machine, "0.0", "foo"));
+
IOProfileSupportAdapter oprofileSupport = (IOProfileSupportAdapter) armelTarget.getAdapter(IOProfileSupportAdapter.class);
IValgrindSupportAdapter valgrindSupportAdapter = (IValgrindSupportAdapter) armelTarget.getAdapter(IValgrindSupportAdapter.class);
+ ILtraceSupportAdapter ltraceSupportAdapter = (ILtraceSupportAdapter) armelTarget.getAdapter(ILtraceSupportAdapter.class);
assertNotNull(oprofileSupport);
assertNotNull(valgrindSupportAdapter);
+ assertNotNull(ltraceSupportAdapter);
- assertNotNull(valgrindSupportAdapter.validateSupport(machine)); // no ARMEL port of valgrind known
- assertNull(oprofileSupport.validateSupport(machine)); // device launch
+ assertNotNull(valgrindSupportAdapter.validateSupport(armelTarget)); // no ARMEL port of valgrind known
+ assertNotNull(oprofileSupport.validateSupport(armelTarget)); // emulator launch
+ assertNotNull(ltraceSupportAdapter.validateSupport(armelTarget)); // emulator launch
+
+ assertNotNull(valgrindSupportAdapter.validateSupport(machineTarget)); // machine does not support it
+ assertNull(oprofileSupport.validateSupport(machineTarget)); // machine should support it
+ assertNull(ltraceSupportAdapter.validateSupport(machineTarget)); // machine should support it
}
+
+
+
}
}
Modified: branches/work_Andre/org.maemo.esbox.vm/META-INF/MANIFEST.MF
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm/META-INF/MANIFEST.MF 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.vm/META-INF/MANIFEST.MF 2009-08-19 21:23:20 UTC (rev 1978)
@@ -20,4 +20,5 @@
org.maemo.esbox.internal.api.vm.ui,
org.maemo.esbox.internal.api.vm.ui.preferences,
org.maemo.esbox.internal.vm;x-friends:="org.maemo.esbox.vm.tests",
- org.maemo.esbox.vm.core
+ org.maemo.esbox.vm.core,
+ org.maemo.esbox.vm.ui
Modified: branches/work_Andre/org.maemo.esbox.vm.vmware/META-INF/MANIFEST.MF
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/META-INF/MANIFEST.MF 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/META-INF/MANIFEST.MF 2009-08-19 21:23:20 UTC (rev 1978)
@@ -12,7 +12,10 @@
org.maemo.mica.protocol.ssh;bundle-version="2.0.0",
org.maemo.esbox.vm;bundle-version="2.0.0",
org.maemo.esbox.maemosdk.core;bundle-version="2.0.0",
- org.eclipse.cdt.core;bundle-version="5.0.2"
+ org.eclipse.cdt.core;bundle-version="5.0.2",
+ org.maemo.mica.linux.packages.ui;bundle-version="2.0.0",
+ org.maemo.mica.linux.packages.core;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.sb1;bundle-version="2.0.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.maemo.esbox.internal.vm.vmware;x-friends:="org.maemo.esbox.vm.tests",
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/data (from rev 1976, trunk/org.maemo.esbox.vm.vmware/data)
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/data/license.txt
===================================================================
--- trunk/org.maemo.esbox.vm.vmware/data/license.txt 2009-08-19 18:08:38 UTC (rev 1976)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/data/license.txt 2009-08-19 21:23:20 UTC (rev 1978)
@@ -1,251 +0,0 @@
-IMPORTANT: READ CAREFULLY BEFORE INSTALLING, DOWNLOADING, OR USING
-THE SOFTWARE
-
-This Software includes some software copyrighted by Nokia Corporation or
-third parties and some Open Source Software in binary form.
-
-The Software copyrighted by Nokia or some third parties is licensed to you
-under the Nokia End-User License Agreement [see below] and distributed to
-you only in binary form.
-
-The Open Source Software is licensed and distributed under GNU General
-Public License (GPL, the GNU lesser General Public License (LGPL, aka. The GNU
-Library General Public License) and/or other copyright licenses, permissions,
-notices or disclaimers containing obligation or permission to provide the
-source code of such software with the binary / executable form delivery of
-the said software. The source code of such software are made available to
-you in accordance with the referred license terms and conditions on this
-page http://www.maemo.org. The exact license terms of GPL, LGPL and said
-certain other licenses, as well as the required copyright and other notices,
-permissions and acknowledgements are reproduced in and delivered to you as
-part of the referred source code.
-
-
-NOKIA CORPORATION END-USER SOFTWARE AGREEMENT
-
-This Software Agreement ("Agreement") is between You (either an
-individual or an entity), the End User, and Nokia Corporation ("Nokia").
-The Agreement authorizes You to use the Software specified in Clause 1
-below, which may be stored on a CD-ROM, sent to You by electronic mail,
-or downloaded from Nokia's Web pages or Servers or from other sources
-under the terms and conditions set forth below. This is an agreement on
-end-user rights and not an agreement for sale. Nokia continues to own
-the copy of the Software and the physical media contained in the sales
-package and any other copy that You are authorized to make pursuant to
-this Agreement.
-
-Read this Agreement carefully before installing, downloading, or using
-the Software. By clicking on the "I Accept" button while installing,
-downloading, and/or using the Software, You agree to the terms and
-conditions of this Agreement. If You do not agree to all of the
-terms and conditions of this Agreement, promptly click the "Decline"
-or "I Do Not Accept" button, cancel the installation or downloading,
-or destroy or return the Software and accompanying documentation to
-Nokia. YOU AGREE THAT YOUR USE OF THE SOFTWARE ACKNOWLEDGES THAT YOU
-HAVE READ THIS AGREEMENT, UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS
-TERMS AND CONDITIONS.
-
-1. SOFTWARE.
-
-As used in this Agreement, the term "Software" means, collectively:
-(i) the software product identified above (ii) all the contents of the
-disk(s), CD-ROM(s), electronic mail and its file attachments, or other
-media with which this Agreement is provided, including the object code
-form of the software delivered via a CD-ROM, electronic mail, or Web page
-(iii) digital images, stock photographs, clip art, or other artistic
-works ("Stock Files") (iv) related explanatory written materials and
-any other possible documentation related thereto ("Documentation");
-(v) fonts, and (vi) upgrades, modified versions, updates, additions,
-and copies of the Software (collectively "Updates"), if any, licensed
-to You by Nokia under this Agreement.
-
-2. END-USER RIGHTS AND USE.
-
-Nokia grants to You non-exclusive, non-transferable end-user rights
-to install the Software on the local hard disk(s) or other permanent
-storage media of one computer and use the Software on a single computer
-or terminal at a time.
-
-3. LIMITATIONS ON END-USER RIGHTS.
-
-You may not copy, distribute, or make derivative works of the Software
-except as follows:
-
-(a) You may make one copy of the Software on magnetic media as an archival
-backup copy, provided Your archival backup copy is not installed or
-used on any computer. Any other copies You make of the Software are in
-violation of this Agreement.
-
-(b) You may not use, modify, translate, reproduce, or transfer the right
-to use the Software or copy the Software except as expressly provided
-in this Agreement.
-
-(c) You may not resell, sublicense, rent, lease, or lend the Software.
-
-(d) You may not reverse engineer, reverse compile, disassemble, or
-otherwise attempt to discover the source code of the Software (except
-to the extent that this restriction is expressly prohibited by law)
-or create derivative works based on the Software.
-
-(e) Unless stated otherwise in the Documentation, You shall not display,
-modify, reproduce, or distribute any of the Stock Files included with the
-Software. In the event that the Documentation allows You to display the
-Stock Files, You shall not distribute the Stock Files on a stand-alone
-basis, i.e., in circumstances in which the Stock Files constitute the
-primary value of the product being distributed. You should review the
-"Readme" files associated with the Stock Files that You use to ascertain
-what rights You have with respect to such materials. Stock Files may
-not be used in the production of libelous, defamatory, fraudulent,
-infringing, lewd, obscene, or pornographic material or in any otherwise
-illegal manner. You may not register or claim any rights in the Stock
-Files or derivative works thereof.
-
-(f) You agree that You shall only use the Software in a manner that
-complies with all applicable laws in the jurisdiction in which You use
-the Software, including, but not limited to, applicable restrictions
-concerning copyright and other intellectual property rights.
-
-4. COPYRIGHT.
-
-The Software and all rights, without limitation including proprietary
-rights therein, are owned by Nokia and/or its licensors and affiliates and
-are protected by international treaty provisions and all other applicable
-national laws of the country in which it is being used. The structure,
-organization, and code of the Software are the valuable trade secrets and
-confidential information of Nokia and/or its licensors and affiliates. You
-must not copy the Software, except as set forth in clause 3 (Limitations
-On End-User Rights). Any copies which You are permitted to make pursuant
-to this Agreement must contain the same copyright and other proprietary
-notices that appear on the Software.
-
-5. MULTIPLE ENVIRONMENT SOFTWARE / MULTIPLE LANGUAGE SOFTWARE / DUAL
-MEDIA SOFTWARE / MULTIPLE COPIES / UPDATES.
-
-If the Software supports multiple platforms or languages, if You receive
-the Software on multiple media, or if You otherwise receive multiple
-copies of the Software, the number of computers on which all versions
-of the Software are installed shall be one computer. You may not rent,
-lease, sublicense, lend, or transfer versions or copies of the Software
-You do not use. If the Software is an Update to a previous version of
-the Software, You must possess valid end-user rights to such a previous
-version in order to use the Update, and You may use the previous version
-for ninety (90) days after You receive the Update in order to assist
-You in the transition to the Update. After such time You no longer have
-a right to use the previous version, except for the sole purpose of
-enabling You to install the Update.
-
-6. COMMENCEMENT & TERMINATION.
-
-This Agreement is effective from the first date You install the
-Software. You may terminate this Agreement at any time by permanently
-deleting, destroying, and returning, at Your own costs, the Software, all
-backup copies, and all related materials provided by Nokia. Your end-user
-rights automatically and immediately terminate without notice from Nokia
-if You fail to comply with any provision of this Agreement. In such an
-event, You must immediately delete, destroy, or return at Your own cost,
-the Software, all backup copies, and all related material to Nokia.
-
-7. YOU ACKNOWLEDGE THAT THE SOFTWARE IS PROVIDED "AS IS" WITHOUT
-WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, AND TO THE MAXIMUM EXTENT
-PERMITTED BY APPLICABLE LAW NEITHER NOKIA, ITS LICENSORS OR AFFILIATES,
-NOR THE COPYRIGHT HOLDERS MAKE ANY REPRESENTATIONS OR WARRANTIES,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR THAT THE SOFTWARE
-WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS, OR
-OTHER RIGHTS. THERE IS NO WARRANTY BY NOKIA OR BY ANY OTHER PARTY THAT
-THE FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR
-THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE.
-YOU ASSUME ALL RESPONSIBILITY AND RISK FOR THE SELECTION OF THE SOFTWARE
-TO ACHIEVE YOUR INTENDED RESULTS AND FOR THE INSTALLATION, USE, AND
-RESULTS OBTAINED FROM IT.
-
-8. NO OTHER OBLIGATIONS.
-
-This Agreement creates no obligations on the part of Nokia other than
-as specifically set forth herein.
-
-9. LIMITATION OF LIABILITY.
-
-TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL
-NOKIA, ITS EMPLOYEES OR LICENSORS OR AFFILIATES BE LIABLE FOR ANY LOST
-PROFITS, REVENUE, SALES, DATA, OR COSTS OF PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES, PROPERTY DAMAGE, PERSONAL INJURY, INTERRUPTION OF BUSINESS,
-LOSS OF BUSINESS INFORMATION, OR FOR ANY SPECIAL, DIRECT, INDIRECT,
-INCIDENTAL, ECONOMIC, COVER, PUNITIVE, SPECIAL, OR CONSEQUENTIAL
-DAMAGES, HOWEVER CAUSED AND WHETHER ARISING UNDER CONTRACT, TORT,
-NEGLIGENCE, OR OTHER THEORY OF LIABILITY ARISING OUT OF THE USE OF
-OR INABILITY TO USE THE SOFTWARE, EVEN IF NOKIA OR ITS LICENSORS OR
-AFFILIATES ARE ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE
-SOME COUNTRIES/STATES/JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF
-LIABILITY, BUT MAY ALLOW LIABILITY TO BE LIMITED, IN SUCH CASES, NOKIA,
-ITS EMPLOYEES OR LICENSORS OR AFFILIATES' LIABILITY SHALL BE LIMITED
-TO U.S. $50. Nothing contained in this Agreement shall prejudice the
-statutory rights of any party dealing as a consumer. Nothing contained
-in this Agreement limits Nokia's liability to You in the event of death
-or personal injury resulting from Nokia's negligence. Nokia is acting
-on behalf of its employees and licensors or affiliates for the purpose
-of disclaiming, excluding, and/or restricting obligations, warranties,
-and liability as provided in this clause 9, but in no other respects
-and for no other purpose.
-
-10. TECHNICAL SUPPORT.
-
-Nokia has no obligation to furnish You with technical support unless
-separately agreed in writing between You and Nokia.
-
-11. EXPORT CONTROL.
-
-The Software, including technical data, includes cryptographic software
-subject to export controls under the U.S. Export Administration
-Regulations ("EAR") and may be subject to import or export controls in
-other countries. The EAR prohibits the use of the Software and technical
-data by a Government End User, as defined hereafter, without a license
-from the U.S. government. A Government End User is defined in Part
-772 of the EAR as "any foreign central, regional, or local government
-department, agency, or other entity performing governmental functions;
-including governmental research institutions, governmental corporations,
-or their separate business units (as defined in part 772 of the EAR)
-which are engaged in the manufacture or distribution of items or
-services controlled on the Wassenaar Munitions List, and international
-governmental organizations. This term does not include: utilities
-(telecommunications companies and Internet service providers; banks
-and financial institutions; transportation; broadcast or entertainment;
-educational organizations; civil health and medical organizations; retail
-or wholesale firms; and manufacturing or industrial entities not engaged
-in the manufacture or distribution of items or services controlled on
-the Wassenaar Munitions List.)" You agree to strictly comply with all
-applicable import and export regulations and acknowledge that You have
-the responsibility to obtain licenses to export, re-export, transfer, or
-import the Software. You further represent that You are not a Government
-End User as defined above, and You will not transfer the Software to
-any Government End User without a license.
-
-12. NOTICES.
-
-All notices and return of the Software and Documentation should be
-delivered to:
-
-NOKIA CORPORATION
-P.O. Box 100
-FIN-00045
-NOKIA GROUP FINLAND
-
-13. APPLICABLE LAW & GENERAL PROVISIONS.
-
-This Agreement is governed by the laws of Finland. All disputes
-arising from or relating to this Agreement shall be settled by a single
-arbitrator appointed by the Central Chamber of Commerce of Finland. The
-arbitration procedure shall take place in Helsinki, Finland in the English
-language. If any part of this Agreement is found void and unenforceable,
-it will not affect the validity of the balance of the Agreement, which
-shall remain valid and enforceable according to its terms. This Agreement
-may only be modified in writing by an authorized officer of Nokia.
-
-This is the entire agreement between Nokia and You relating to the
-Software, and it supersedes any prior representations, discussions,
-undertakings, end-user agreements, communications, or advertising relating
-to the Software.
-
-PLEASE SUBMIT ANY ACCOMPANYING REGISTRATION FORMS TO RECEIVE REGISTRATION
-BENEFITS WHERE APPLICABLE
-
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/data/license.txt (from rev 1976, trunk/org.maemo.esbox.vm.vmware/data/license.txt)
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/data/license.txt (rev 0)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/data/license.txt 2009-08-19 21:23:20 UTC (rev 1978)
@@ -0,0 +1,251 @@
+IMPORTANT: READ CAREFULLY BEFORE INSTALLING, DOWNLOADING, OR USING
+THE SOFTWARE
+
+This Software includes some software copyrighted by Nokia Corporation or
+third parties and some Open Source Software in binary form.
+
+The Software copyrighted by Nokia or some third parties is licensed to you
+under the Nokia End-User License Agreement [see below] and distributed to
+you only in binary form.
+
+The Open Source Software is licensed and distributed under GNU General
+Public License (GPL, the GNU lesser General Public License (LGPL, aka. The GNU
+Library General Public License) and/or other copyright licenses, permissions,
+notices or disclaimers containing obligation or permission to provide the
+source code of such software with the binary / executable form delivery of
+the said software. The source code of such software are made available to
+you in accordance with the referred license terms and conditions on this
+page http://www.maemo.org. The exact license terms of GPL, LGPL and said
+certain other licenses, as well as the required copyright and other notices,
+permissions and acknowledgements are reproduced in and delivered to you as
+part of the referred source code.
+
+
+NOKIA CORPORATION END-USER SOFTWARE AGREEMENT
+
+This Software Agreement ("Agreement") is between You (either an
+individual or an entity), the End User, and Nokia Corporation ("Nokia").
+The Agreement authorizes You to use the Software specified in Clause 1
+below, which may be stored on a CD-ROM, sent to You by electronic mail,
+or downloaded from Nokia's Web pages or Servers or from other sources
+under the terms and conditions set forth below. This is an agreement on
+end-user rights and not an agreement for sale. Nokia continues to own
+the copy of the Software and the physical media contained in the sales
+package and any other copy that You are authorized to make pursuant to
+this Agreement.
+
+Read this Agreement carefully before installing, downloading, or using
+the Software. By clicking on the "I Accept" button while installing,
+downloading, and/or using the Software, You agree to the terms and
+conditions of this Agreement. If You do not agree to all of the
+terms and conditions of this Agreement, promptly click the "Decline"
+or "I Do Not Accept" button, cancel the installation or downloading,
+or destroy or return the Software and accompanying documentation to
+Nokia. YOU AGREE THAT YOUR USE OF THE SOFTWARE ACKNOWLEDGES THAT YOU
+HAVE READ THIS AGREEMENT, UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS
+TERMS AND CONDITIONS.
+
+1. SOFTWARE.
+
+As used in this Agreement, the term "Software" means, collectively:
+(i) the software product identified above (ii) all the contents of the
+disk(s), CD-ROM(s), electronic mail and its file attachments, or other
+media with which this Agreement is provided, including the object code
+form of the software delivered via a CD-ROM, electronic mail, or Web page
+(iii) digital images, stock photographs, clip art, or other artistic
+works ("Stock Files") (iv) related explanatory written materials and
+any other possible documentation related thereto ("Documentation");
+(v) fonts, and (vi) upgrades, modified versions, updates, additions,
+and copies of the Software (collectively "Updates"), if any, licensed
+to You by Nokia under this Agreement.
+
+2. END-USER RIGHTS AND USE.
+
+Nokia grants to You non-exclusive, non-transferable end-user rights
+to install the Software on the local hard disk(s) or other permanent
+storage media of one computer and use the Software on a single computer
+or terminal at a time.
+
+3. LIMITATIONS ON END-USER RIGHTS.
+
+You may not copy, distribute, or make derivative works of the Software
+except as follows:
+
+(a) You may make one copy of the Software on magnetic media as an archival
+backup copy, provided Your archival backup copy is not installed or
+used on any computer. Any other copies You make of the Software are in
+violation of this Agreement.
+
+(b) You may not use, modify, translate, reproduce, or transfer the right
+to use the Software or copy the Software except as expressly provided
+in this Agreement.
+
+(c) You may not resell, sublicense, rent, lease, or lend the Software.
+
+(d) You may not reverse engineer, reverse compile, disassemble, or
+otherwise attempt to discover the source code of the Software (except
+to the extent that this restriction is expressly prohibited by law)
+or create derivative works based on the Software.
+
+(e) Unless stated otherwise in the Documentation, You shall not display,
+modify, reproduce, or distribute any of the Stock Files included with the
+Software. In the event that the Documentation allows You to display the
+Stock Files, You shall not distribute the Stock Files on a stand-alone
+basis, i.e., in circumstances in which the Stock Files constitute the
+primary value of the product being distributed. You should review the
+"Readme" files associated with the Stock Files that You use to ascertain
+what rights You have with respect to such materials. Stock Files may
+not be used in the production of libelous, defamatory, fraudulent,
+infringing, lewd, obscene, or pornographic material or in any otherwise
+illegal manner. You may not register or claim any rights in the Stock
+Files or derivative works thereof.
+
+(f) You agree that You shall only use the Software in a manner that
+complies with all applicable laws in the jurisdiction in which You use
+the Software, including, but not limited to, applicable restrictions
+concerning copyright and other intellectual property rights.
+
+4. COPYRIGHT.
+
+The Software and all rights, without limitation including proprietary
+rights therein, are owned by Nokia and/or its licensors and affiliates and
+are protected by international treaty provisions and all other applicable
+national laws of the country in which it is being used. The structure,
+organization, and code of the Software are the valuable trade secrets and
+confidential information of Nokia and/or its licensors and affiliates. You
+must not copy the Software, except as set forth in clause 3 (Limitations
+On End-User Rights). Any copies which You are permitted to make pursuant
+to this Agreement must contain the same copyright and other proprietary
+notices that appear on the Software.
+
+5. MULTIPLE ENVIRONMENT SOFTWARE / MULTIPLE LANGUAGE SOFTWARE / DUAL
+MEDIA SOFTWARE / MULTIPLE COPIES / UPDATES.
+
+If the Software supports multiple platforms or languages, if You receive
+the Software on multiple media, or if You otherwise receive multiple
+copies of the Software, the number of computers on which all versions
+of the Software are installed shall be one computer. You may not rent,
+lease, sublicense, lend, or transfer versions or copies of the Software
+You do not use. If the Software is an Update to a previous version of
+the Software, You must possess valid end-user rights to such a previous
+version in order to use the Update, and You may use the previous version
+for ninety (90) days after You receive the Update in order to assist
+You in the transition to the Update. After such time You no longer have
+a right to use the previous version, except for the sole purpose of
+enabling You to install the Update.
+
+6. COMMENCEMENT & TERMINATION.
+
+This Agreement is effective from the first date You install the
+Software. You may terminate this Agreement at any time by permanently
+deleting, destroying, and returning, at Your own costs, the Software, all
+backup copies, and all related materials provided by Nokia. Your end-user
+rights automatically and immediately terminate without notice from Nokia
+if You fail to comply with any provision of this Agreement. In such an
+event, You must immediately delete, destroy, or return at Your own cost,
+the Software, all backup copies, and all related material to Nokia.
+
+7. YOU ACKNOWLEDGE THAT THE SOFTWARE IS PROVIDED "AS IS" WITHOUT
+WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, AND TO THE MAXIMUM EXTENT
+PERMITTED BY APPLICABLE LAW NEITHER NOKIA, ITS LICENSORS OR AFFILIATES,
+NOR THE COPYRIGHT HOLDERS MAKE ANY REPRESENTATIONS OR WARRANTIES,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR THAT THE SOFTWARE
+WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS, OR
+OTHER RIGHTS. THERE IS NO WARRANTY BY NOKIA OR BY ANY OTHER PARTY THAT
+THE FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR
+THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE.
+YOU ASSUME ALL RESPONSIBILITY AND RISK FOR THE SELECTION OF THE SOFTWARE
+TO ACHIEVE YOUR INTENDED RESULTS AND FOR THE INSTALLATION, USE, AND
+RESULTS OBTAINED FROM IT.
+
+8. NO OTHER OBLIGATIONS.
+
+This Agreement creates no obligations on the part of Nokia other than
+as specifically set forth herein.
+
+9. LIMITATION OF LIABILITY.
+
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL
+NOKIA, ITS EMPLOYEES OR LICENSORS OR AFFILIATES BE LIABLE FOR ANY LOST
+PROFITS, REVENUE, SALES, DATA, OR COSTS OF PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES, PROPERTY DAMAGE, PERSONAL INJURY, INTERRUPTION OF BUSINESS,
+LOSS OF BUSINESS INFORMATION, OR FOR ANY SPECIAL, DIRECT, INDIRECT,
+INCIDENTAL, ECONOMIC, COVER, PUNITIVE, SPECIAL, OR CONSEQUENTIAL
+DAMAGES, HOWEVER CAUSED AND WHETHER ARISING UNDER CONTRACT, TORT,
+NEGLIGENCE, OR OTHER THEORY OF LIABILITY ARISING OUT OF THE USE OF
+OR INABILITY TO USE THE SOFTWARE, EVEN IF NOKIA OR ITS LICENSORS OR
+AFFILIATES ARE ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE
+SOME COUNTRIES/STATES/JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF
+LIABILITY, BUT MAY ALLOW LIABILITY TO BE LIMITED, IN SUCH CASES, NOKIA,
+ITS EMPLOYEES OR LICENSORS OR AFFILIATES' LIABILITY SHALL BE LIMITED
+TO U.S. $50. Nothing contained in this Agreement shall prejudice the
+statutory rights of any party dealing as a consumer. Nothing contained
+in this Agreement limits Nokia's liability to You in the event of death
+or personal injury resulting from Nokia's negligence. Nokia is acting
+on behalf of its employees and licensors or affiliates for the purpose
+of disclaiming, excluding, and/or restricting obligations, warranties,
+and liability as provided in this clause 9, but in no other respects
+and for no other purpose.
+
+10. TECHNICAL SUPPORT.
+
+Nokia has no obligation to furnish You with technical support unless
+separately agreed in writing between You and Nokia.
+
+11. EXPORT CONTROL.
+
+The Software, including technical data, includes cryptographic software
+subject to export controls under the U.S. Export Administration
+Regulations ("EAR") and may be subject to import or export controls in
+other countries. The EAR prohibits the use of the Software and technical
+data by a Government End User, as defined hereafter, without a license
+from the U.S. government. A Government End User is defined in Part
+772 of the EAR as "any foreign central, regional, or local government
+department, agency, or other entity performing governmental functions;
+including governmental research institutions, governmental corporations,
+or their separate business units (as defined in part 772 of the EAR)
+which are engaged in the manufacture or distribution of items or
+services controlled on the Wassenaar Munitions List, and international
+governmental organizations. This term does not include: utilities
+(telecommunications companies and Internet service providers; banks
+and financial institutions; transportation; broadcast or entertainment;
+educational organizations; civil health and medical organizations; retail
+or wholesale firms; and manufacturing or industrial entities not engaged
+in the manufacture or distribution of items or services controlled on
+the Wassenaar Munitions List.)" You agree to strictly comply with all
+applicable import and export regulations and acknowledge that You have
+the responsibility to obtain licenses to export, re-export, transfer, or
+import the Software. You further represent that You are not a Government
+End User as defined above, and You will not transfer the Software to
+any Government End User without a license.
+
+12. NOTICES.
+
+All notices and return of the Software and Documentation should be
+delivered to:
+
+NOKIA CORPORATION
+P.O. Box 100
+FIN-00045
+NOKIA GROUP FINLAND
+
+13. APPLICABLE LAW & GENERAL PROVISIONS.
+
+This Agreement is governed by the laws of Finland. All disputes
+arising from or relating to this Agreement shall be settled by a single
+arbitrator appointed by the Central Chamber of Commerce of Finland. The
+arbitration procedure shall take place in Helsinki, Finland in the English
+language. If any part of this Agreement is found void and unenforceable,
+it will not affect the validity of the balance of the Agreement, which
+shall remain valid and enforceable according to its terms. This Agreement
+may only be modified in writing by an authorized officer of Nokia.
+
+This is the entire agreement between Nokia and You relating to the
+Software, and it supersedes any prior representations, discussions,
+undertakings, end-user agreements, communications, or advertising relating
+to the Software.
+
+PLEASE SUBMIT ANY ACCOMPANYING REGISTRATION FORMS TO RECEIVE REGISTRATION
+BENEFITS WHERE APPLICABLE
+
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/icons (from rev 1976, trunk/org.maemo.esbox.vm.vmware/icons)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full (from rev 1976, trunk/org.maemo.esbox.vm.vmware/icons/full)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16 (from rev 1976, trunk/org.maemo.esbox.vm.vmware/icons/full/etool16)
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine.png
===================================================================
(Binary files differ)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine.png (from rev 1976, trunk/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine.png)
===================================================================
(Binary files differ)
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine_48.png
===================================================================
(Binary files differ)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine_48.png (from rev 1976, trunk/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine_48.png)
===================================================================
(Binary files differ)
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine_64.png
===================================================================
(Binary files differ)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine_64.png (from rev 1976, trunk/org.maemo.esbox.vm.vmware/icons/full/etool16/virtual_machine_64.png)
===================================================================
(Binary files differ)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/wizban (from rev 1976, trunk/org.maemo.esbox.vm.vmware/icons/full/wizban)
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/wizban/virtual_machine_wiz.png
===================================================================
(Binary files differ)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/icons/full/wizban/virtual_machine_wiz.png (from rev 1976, trunk/org.maemo.esbox.vm.vmware/icons/full/wizban/virtual_machine_wiz.png)
===================================================================
(Binary files differ)
Modified: branches/work_Andre/org.maemo.esbox.vm.vmware/plugin.xml
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/plugin.xml 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/plugin.xml 2009-08-19 21:23:20 UTC (rev 1978)
@@ -24,5 +24,20 @@
class="org.maemo.esbox.internal.vm.vmware.VMwareMachineFactory">
</machineFactory>
</extension>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ canFinishEarly="false"
+ category="org.maemo.mica.maemosdk.ui.maemo_installer_wizard"
+ class="org.maemo.esbox.internal.vm.vmware.ui.wizards.NewMaemoSDKVMWizard"
+ hasPages="true"
+ icon="icons/full/etool16/virtual_machine.png"
+ id="org.maemo.esbox.vm.maemovm_installer"
+ name="Maemo SDK Virtual Image">
+ <description>
+ Installs Maemo SDK Virtual Image to be used with ESbox to build and launch applications.
+ </description>
+ </wizard>
+ </extension>
</plugin>
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/ui (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/ui)
Modified: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/Activator.java
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/Activator.java 2009-08-19 18:48:54 UTC (rev 1977)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/Activator.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -14,6 +14,8 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.maemo.mica.common.core.ErrorLogger;
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.Policy;
import org.osgi.framework.BundleContext;
import java.io.*;
@@ -25,6 +27,11 @@
// The plug-in ID
public static final String PLUGIN_ID = "org.maemo.esbox.vm.vmware";
+
+ public static ImageDescriptor MAEMO_VM_WIZBAN_DESCRIPTOR = getImageDescriptor("./icons/full/wizban/virtual_machine_wiz.png");
+ public static ImageDescriptor MAEMO_VM_DESCRIPTOR = getImageDescriptor("./icons/full/etool16/virtual_machine.png");
+
+ public static final int BUFFER_SIZE = 4096; // 4 KB
// The shared instance
private static Activator plugin;
@@ -137,5 +144,32 @@
public static ImageDescriptor getImageDescriptor(String path) {
return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
+
+ /**
+ * Read resource file
+ *
+ * @param resouce
+ * file name
+ * @return content of resource file
+ * @throws MicaException
+ */
+ public static String readResourceFile(String resouce) throws MicaException {
+ InputStream in = null;
+ try {
+ in = getPluginRelativeInputStream(resouce);
+ StringBuffer buf = new StringBuffer();
+ byte[] byteBuf = new byte[BUFFER_SIZE];
+ for (int n; (n = in.read(byteBuf)) > 0;) {
+ buf.append(new String(byteBuf, 0, n));
+ }
+ return buf.toString();
+ } catch (IOException e) {
+ throw new MicaException(e.getMessage(), e);
+ } finally {
+ Policy.close(in);
+ }
+ }
+
+
}
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui)
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards)
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java
===================================================================
--- trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java 2009-08-19 18:08:38 UTC (rev 1976)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -1,292 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Raul Herbster (INdT) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.vm.vmware.ui.wizards;
-
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.maemo.esbox.internal.vm.vmware.Activator;
-
-/**
- * This page displays information about Maemo SDK virtual machine configuration.
- *
- * @author raulherbster
- *
- */
-public class MaemoSDKVMConfigurationWizardPage extends WizardPage {
-
- private Button installEverything;
-
- // installation details area
- private Group installationDetailsGroup;
- private Button installScratchbox;
- private Button installScratchboxTargets;
-
- // programming environment area
- private Group programmingEnvGroup;
- private Button installCPPEnv;
- private Button installPythonEnv;
-
- /**
- * Constructor.
- *
- * @param wizard
- * parent wizard.
- */
- protected MaemoSDKVMConfigurationWizardPage(NewMaemoSDKVMWizard wizard) {
- super("maemovm_postdonwload", "Maemo SDK Virtual Image Downloaded",
- Activator.MAEMO_VM_WIZBAN_DESCRIPTOR);
- setDescription("Select configuration options for Maemo SDK Virtual Image.");
- setWizard(wizard);
- setPageComplete(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
- * .Composite)
- */
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayoutFactory.fillDefaults().numColumns(1).applyTo(composite);
- GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
- setControl(composite);
-
- Label message = new Label(composite, SWT.NONE);
- message
- .setText("The virtual image XXX was properly saved on your machine");
- GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
- .applyTo(message);
-
- Label separator = new Label(composite, SWT.NONE);
- GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
- .applyTo(separator);
-
- installEverything = createButton(composite, SWT.CHECK,
- "Install complete Maemo SDK programming environment");
- GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
- .applyTo(installEverything);
- installEverything
- .setToolTipText("If checked, install the complete Maemo SDK programming environment on virtual image");
- installEverything.setSelection(true);
- installEverything.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent evt) {
- boolean isInstallEverythingSelected = installEverything
- .getSelection();
- setInstallationDetailsButtonsSelection(isInstallEverythingSelected);
- setInstallationDetailsGroupEnabled(!isInstallEverythingSelected);
- setProgrammingEnvButtonsSelection(isInstallEverythingSelected);
- setProgrammignEnvGroupEnabled(!isInstallEverythingSelected);
- updateInstallData();
- }
-
- });
-
- createInstallationDetailsArea(composite);
-
- createProgrammingEnvironmentArea(composite);
-
- setInstallationDetailsButtonsSelection(true);
- setInstallationDetailsGroupEnabled(false);
- setProgrammingEnvButtonsSelection(true);
- setProgrammignEnvGroupEnabled(false);
-
- updateInstallData();
- }
-
- /**
- * Create contents of installation options area.
- *
- * @param composite
- * parent composite.
- */
- private void createInstallationDetailsArea(Composite composite) {
- installationDetailsGroup = new Group(composite, SWT.NONE);
- installationDetailsGroup.setText("Installation Details");
- installationDetailsGroup.setLayoutData(new GridData(
- GridData.FILL_HORIZONTAL));
- installationDetailsGroup.setLayout(new GridLayout(1, false));
- GridDataFactory.fillDefaults().grab(true, false).applyTo(
- installationDetailsGroup);
-
- installScratchbox = createButton(installationDetailsGroup, SWT.RADIO,
- "Install Scratchbox");
- GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
- .applyTo(installScratchbox);
- installScratchbox
- .setToolTipText("If checked, the wizard to install Scratchbox 1 is launched");
- installScratchbox.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- updateInstallData();
- }
-
- });
-
- installScratchboxTargets = createButton(installationDetailsGroup,
- SWT.RADIO, "Install Scratchbox and Maemo SDK targets");
- GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
- .applyTo(installScratchboxTargets);
- installScratchboxTargets
- .setToolTipText("If checked, the wizard to install Scratchbox 1 targets is launched");
- installScratchboxTargets.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- updateInstallData();
- }
-
- });
- }
-
- /**
- * Create contents of programming environment contents area.
- *
- * @param composite
- * parent composite.
- */
- private void createProgrammingEnvironmentArea(Composite composite) {
- programmingEnvGroup = new Group(composite, SWT.NONE);
- programmingEnvGroup.setText("Programming Environments");
- programmingEnvGroup
- .setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- programmingEnvGroup.setLayout(new GridLayout(1, false));
- GridDataFactory.fillDefaults().grab(true, false).applyTo(
- programmingEnvGroup);
-
- installCPPEnv = createButton(programmingEnvGroup, SWT.CHECK,
- "Install C/C++ programming environment");
- GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
- .applyTo(installCPPEnv);
- installCPPEnv
- .setToolTipText("If checked, install C/C++ programming environment (maemo-c-debug-tools and maemo-debug-scripts and cplusplus-env)");
- installCPPEnv.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- setButtonsForProgrammingEnvSelection(installCPPEnv.getSelection() || installPythonEnv.getSelection());
- updateInstallData();
- }
-
- });
-
- installPythonEnv = createButton(programmingEnvGroup, SWT.CHECK,
- "Install Python programming environment");
- GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
- .applyTo(installPythonEnv);
- installPythonEnv
- .setToolTipText("If checked, install Python programming environment (maemo-python-env)");
- installPythonEnv.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- setButtonsForProgrammingEnvSelection(installCPPEnv.getSelection() || installPythonEnv.getSelection());
- updateInstallData();
- }
-
- });
- }
-
- /**
- * Utility method to create a button.
- *
- * @param composite
- * the parent composite.
- * @param style
- * the style of the button.
- * @param text
- * the button text.
- * @return
- */
- private Button createButton(Composite composite, int style, String text) {
- Button button = new Button(composite, style);
- button.setText(text);
- return button;
- }
-
- /**
- * Set selection of all buttons of details area.
- *
- * @param isSelected
- */
- private void setInstallationDetailsButtonsSelection(boolean isSelected) {
- installScratchboxTargets.setSelection(isSelected);
- if (isSelected) {
- installScratchbox.setSelection(!isSelected);
- }
-
- }
-
- /**
- * Set selection of all buttons of programming environment area.
- *
- * @param isSelected
- */
- private void setProgrammingEnvButtonsSelection(boolean isSelected) {
- installCPPEnv.setSelection(isSelected);
- installPythonEnv.setSelection(isSelected);
- }
-
- /**
- * Set select of installation details group if programming env is goind to be installed.
- *
- * @param isSelected
- */
- private void setButtonsForProgrammingEnvSelection(boolean isSelected) {
- setInstallationDetailsGroupEnabled(!isSelected);
- setInstallationDetailsButtonsSelection(isSelected);
- }
-
- /**
- * Set enablement of all buttons of details area.
- *
- * @param isEnabled
- */
- private void setInstallationDetailsGroupEnabled(boolean isEnabled) {
- installationDetailsGroup.setEnabled(isEnabled);
- }
-
- /**
- * Set enablement of all buttons of programming environment area.
- *
- * @param isEnabled
- */
- private void setProgrammignEnvGroupEnabled(boolean isEnabled) {
- programmingEnvGroup.setEnabled(isEnabled);
- }
-
- /**
- * Update installation data based on selections of buttons.
- */
- private void updateInstallData() {
- MaemoSDKVMInstallData installData = ((NewMaemoSDKVMWizard) getWizard())
- .getInstallData();
- installData.setInstallCppEnv(installCPPEnv.getSelection());
- installData.setInstallPythonEnv(installPythonEnv.getSelection());
- installData.setInstallTargets(installScratchboxTargets.getSelection() || installCPPEnv.getSelection() ||
- installPythonEnv.getSelection());
- installData.setInstallSbox(installScratchbox.getSelection() || installScratchboxTargets.getSelection());
- }
-
-}
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java)
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java (rev 0)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -0,0 +1,292 @@
+/*******************************************************************************
+ * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (INdT) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.vm.vmware.ui.wizards;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.maemo.esbox.internal.vm.vmware.Activator;
+
+/**
+ * This page displays information about Maemo SDK virtual machine configuration.
+ *
+ * @author raulherbster
+ *
+ */
+public class MaemoSDKVMConfigurationWizardPage extends WizardPage {
+
+ private Button installEverything;
+
+ // installation details area
+ private Group installationDetailsGroup;
+ private Button installScratchbox;
+ private Button installScratchboxTargets;
+
+ // programming environment area
+ private Group programmingEnvGroup;
+ private Button installCPPEnv;
+ private Button installPythonEnv;
+
+ /**
+ * Constructor.
+ *
+ * @param wizard
+ * parent wizard.
+ */
+ protected MaemoSDKVMConfigurationWizardPage(NewMaemoSDKVMWizard wizard) {
+ super("maemovm_postdonwload", "Maemo SDK Virtual Image Downloaded",
+ Activator.MAEMO_VM_WIZBAN_DESCRIPTOR);
+ setDescription("Select configuration options for Maemo SDK Virtual Image.");
+ setWizard(wizard);
+ setPageComplete(true);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayoutFactory.fillDefaults().numColumns(1).applyTo(composite);
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
+ setControl(composite);
+
+ Label message = new Label(composite, SWT.NONE);
+ message
+ .setText("The virtual image XXX was properly saved on your machine");
+ GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
+ .applyTo(message);
+
+ Label separator = new Label(composite, SWT.NONE);
+ GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
+ .applyTo(separator);
+
+ installEverything = createButton(composite, SWT.CHECK,
+ "Install complete Maemo SDK programming environment");
+ GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
+ .applyTo(installEverything);
+ installEverything
+ .setToolTipText("If checked, install the complete Maemo SDK programming environment on virtual image");
+ installEverything.setSelection(true);
+ installEverything.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent evt) {
+ boolean isInstallEverythingSelected = installEverything
+ .getSelection();
+ setInstallationDetailsButtonsSelection(isInstallEverythingSelected);
+ setInstallationDetailsGroupEnabled(!isInstallEverythingSelected);
+ setProgrammingEnvButtonsSelection(isInstallEverythingSelected);
+ setProgrammignEnvGroupEnabled(!isInstallEverythingSelected);
+ updateInstallData();
+ }
+
+ });
+
+ createInstallationDetailsArea(composite);
+
+ createProgrammingEnvironmentArea(composite);
+
+ setInstallationDetailsButtonsSelection(true);
+ setInstallationDetailsGroupEnabled(false);
+ setProgrammingEnvButtonsSelection(true);
+ setProgrammignEnvGroupEnabled(false);
+
+ updateInstallData();
+ }
+
+ /**
+ * Create contents of installation options area.
+ *
+ * @param composite
+ * parent composite.
+ */
+ private void createInstallationDetailsArea(Composite composite) {
+ installationDetailsGroup = new Group(composite, SWT.NONE);
+ installationDetailsGroup.setText("Installation Details");
+ installationDetailsGroup.setLayoutData(new GridData(
+ GridData.FILL_HORIZONTAL));
+ installationDetailsGroup.setLayout(new GridLayout(1, false));
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(
+ installationDetailsGroup);
+
+ installScratchbox = createButton(installationDetailsGroup, SWT.RADIO,
+ "Install Scratchbox");
+ GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
+ .applyTo(installScratchbox);
+ installScratchbox
+ .setToolTipText("If checked, the wizard to install Scratchbox 1 is launched");
+ installScratchbox.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateInstallData();
+ }
+
+ });
+
+ installScratchboxTargets = createButton(installationDetailsGroup,
+ SWT.RADIO, "Install Scratchbox and Maemo SDK targets");
+ GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
+ .applyTo(installScratchboxTargets);
+ installScratchboxTargets
+ .setToolTipText("If checked, the wizard to install Scratchbox 1 targets is launched");
+ installScratchboxTargets.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateInstallData();
+ }
+
+ });
+ }
+
+ /**
+ * Create contents of programming environment contents area.
+ *
+ * @param composite
+ * parent composite.
+ */
+ private void createProgrammingEnvironmentArea(Composite composite) {
+ programmingEnvGroup = new Group(composite, SWT.NONE);
+ programmingEnvGroup.setText("Programming Environments");
+ programmingEnvGroup
+ .setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ programmingEnvGroup.setLayout(new GridLayout(1, false));
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(
+ programmingEnvGroup);
+
+ installCPPEnv = createButton(programmingEnvGroup, SWT.CHECK,
+ "Install C/C++ programming environment");
+ GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
+ .applyTo(installCPPEnv);
+ installCPPEnv
+ .setToolTipText("If checked, install C/C++ programming environment (maemo-c-debug-tools and maemo-debug-scripts and cplusplus-env)");
+ installCPPEnv.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setButtonsForProgrammingEnvSelection(installCPPEnv.getSelection() || installPythonEnv.getSelection());
+ updateInstallData();
+ }
+
+ });
+
+ installPythonEnv = createButton(programmingEnvGroup, SWT.CHECK,
+ "Install Python programming environment");
+ GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
+ .applyTo(installPythonEnv);
+ installPythonEnv
+ .setToolTipText("If checked, install Python programming environment (maemo-python-env)");
+ installPythonEnv.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setButtonsForProgrammingEnvSelection(installCPPEnv.getSelection() || installPythonEnv.getSelection());
+ updateInstallData();
+ }
+
+ });
+ }
+
+ /**
+ * Utility method to create a button.
+ *
+ * @param composite
+ * the parent composite.
+ * @param style
+ * the style of the button.
+ * @param text
+ * the button text.
+ * @return
+ */
+ private Button createButton(Composite composite, int style, String text) {
+ Button button = new Button(composite, style);
+ button.setText(text);
+ return button;
+ }
+
+ /**
+ * Set selection of all buttons of details area.
+ *
+ * @param isSelected
+ */
+ private void setInstallationDetailsButtonsSelection(boolean isSelected) {
+ installScratchboxTargets.setSelection(isSelected);
+ if (isSelected) {
+ installScratchbox.setSelection(!isSelected);
+ }
+
+ }
+
+ /**
+ * Set selection of all buttons of programming environment area.
+ *
+ * @param isSelected
+ */
+ private void setProgrammingEnvButtonsSelection(boolean isSelected) {
+ installCPPEnv.setSelection(isSelected);
+ installPythonEnv.setSelection(isSelected);
+ }
+
+ /**
+ * Set select of installation details group if programming env is goind to be installed.
+ *
+ * @param isSelected
+ */
+ private void setButtonsForProgrammingEnvSelection(boolean isSelected) {
+ setInstallationDetailsGroupEnabled(!isSelected);
+ setInstallationDetailsButtonsSelection(isSelected);
+ }
+
+ /**
+ * Set enablement of all buttons of details area.
+ *
+ * @param isEnabled
+ */
+ private void setInstallationDetailsGroupEnabled(boolean isEnabled) {
+ installationDetailsGroup.setEnabled(isEnabled);
+ }
+
+ /**
+ * Set enablement of all buttons of programming environment area.
+ *
+ * @param isEnabled
+ */
+ private void setProgrammignEnvGroupEnabled(boolean isEnabled) {
+ programmingEnvGroup.setEnabled(isEnabled);
+ }
+
+ /**
+ * Update installation data based on selections of buttons.
+ */
+ private void updateInstallData() {
+ MaemoSDKVMInstallData installData = ((NewMaemoSDKVMWizard) getWizard())
+ .getInstallData();
+ installData.setInstallCppEnv(installCPPEnv.getSelection());
+ installData.setInstallPythonEnv(installPythonEnv.getSelection());
+ installData.setInstallTargets(installScratchboxTargets.getSelection() || installCPPEnv.getSelection() ||
+ installPythonEnv.getSelection());
+ installData.setInstallSbox(installScratchbox.getSelection() || installScratchboxTargets.getSelection());
+ }
+
+}
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallData.java
===================================================================
--- trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallData.java 2009-08-19 18:08:38 UTC (rev 1976)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallData.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Raul Herbster (INdT) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.vm.vmware.ui.wizards;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMInfo;
-import org.maemo.esbox.internal.vm.vmware.Activator;
-
-/**
- * This is a wrapper that contains information about Maemo SDK virtual image
- * installation process.
- *
- * @author raulherbster
- *
- */
-public class MaemoSDKVMInstallData {
-
- private MaemoSDKVMInfo fileToDownload;
- private boolean usePreviousInstallation;
- private String installationPath;
- private String pathOfExistentVM;
- private boolean licenseTermsAgreed;
- private boolean installSbox;
- private boolean installTargets;
- private boolean installCppEnv;
- private boolean installPythonEnv;
-
- /**
- * Constructor.
- */
- public MaemoSDKVMInstallData() {
- fileToDownload = new MaemoSDKVMInfo();
- }
-
- /**
- * Set the file to download.
- *
- * @param downloadFile
- */
- public void setFileToDownload(MaemoSDKVMInfo downloadFile) {
- if (downloadFile == null)
- return;
- this.fileToDownload = downloadFile;
- if (fileToDownload.getLocalURL() == null && installationPath != null)
- try {
- fileToDownload.setLocalURL(new File(installationPath).toURL());
- } catch (MalformedURLException e) {
- Activator.getErrorLogger().logAndShowError(
- "Cannot get location for file "
- + downloadFile.getDescription(), e);
- }
- }
-
- /**
- * Return the file to download.
- *
- * @return
- */
- public MaemoSDKVMInfo getFileToDownload() {
- return fileToDownload;
- }
-
- /**
- * @return the usePreviousInstallation
- */
- public boolean canUsePreviousInstallation() {
- return usePreviousInstallation;
- }
-
- /**
- * @param usePreviousInstallation
- * the usePreviousInstallation to set
- */
- public void setUsePreviousInstallation(boolean usePreviousInstallation) {
- this.usePreviousInstallation = usePreviousInstallation;
- }
-
- /**
- * @return the installationPath
- */
- public String getInstallationPath() {
- return installationPath;
- }
-
- /**
- * @param installationPath
- * the installationPath to set
- */
- public void setInstallationPath(String installationPath) {
- this.installationPath = installationPath;
- try {
- fileToDownload.setLocalURL(new File(installationPath).toURL());
- } catch (MalformedURLException e) {
- Activator.getErrorLogger().logAndShowError(
- "Cannot get location for file "
- + fileToDownload.getDescription(), e);
- }
-
- }
-
- /**
- * @return the pathOfExistentVM
- */
- public String getPathOfExistentVM() {
- return pathOfExistentVM;
- }
-
- /**
- * @param pathOfExistentVM
- * the pathOfExistentVM to set
- */
- public void setPathOfExistentVM(String pathOfExistentVM) {
- this.pathOfExistentVM = pathOfExistentVM;
- }
-
- /**
- * @return the installSbox
- */
- public boolean canInstallSbox() {
- return installSbox;
- }
-
- /**
- * @param installSbox
- * the installSbox to set
- */
- public void setInstallSbox(boolean installSbox) {
- this.installSbox = installSbox;
- }
-
- /**
- * @return the installTargets
- */
- public boolean canInstallTargets() {
- return installTargets;
- }
-
- /**
- * @param installTargets
- * the installTargets to set
- */
- public void setInstallTargets(boolean installTargets) {
- this.installTargets = installTargets;
- }
-
- /**
- * @return true, if it is necessary to install Python programming
- * environment; false, otherwise.
- */
- public boolean canInstallPythonEnv() {
- return installPythonEnv;
- }
-
- /**
- * @param installTargets
- * the installTargets to set
- */
- public void setInstallPythonEnv(boolean installPythonEnv) {
- this.installPythonEnv = installPythonEnv;
- }
-
- /**
- *
- * @return true, if it is necessary to install CPP programming environment;
- * false, otherwise.
- */
- public boolean canInstallCppEnv() {
- return installCppEnv;
- }
-
- /**
- * @param installCppEnv
- * the installTargets to set
- */
- public void setInstallCppEnv(boolean installCppEnv) {
- this.installCppEnv = installCppEnv;
- }
-
- /**
- * @return true, if license terms were agreed; false, otherwise.
- */
- public boolean isLicenseTermsAgreed() {
- return licenseTermsAgreed;
- }
-
- /**
- * @param licenseTermsAgreed
- * the licenseTermsAgreed to set
- */
- public void setLicenseTermsAgreed(boolean licenseTermsAgreed) {
- this.licenseTermsAgreed = licenseTermsAgreed;
- }
-
-}
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallData.java (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallData.java)
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallData.java (rev 0)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallData.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -0,0 +1,204 @@
+/*******************************************************************************
+ * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (INdT) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.vm.vmware.ui.wizards;
+
+import java.io.File;
+import java.net.MalformedURLException;
+
+import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMInfo;
+import org.maemo.esbox.internal.vm.vmware.Activator;
+
+/**
+ * This is a wrapper that contains information about Maemo SDK virtual image
+ * installation process.
+ *
+ * @author raulherbster
+ *
+ */
+public class MaemoSDKVMInstallData {
+
+ private MaemoSDKVMInfo fileToDownload;
+ private boolean usePreviousInstallation;
+ private String installationPath;
+ private String pathOfExistentVM;
+ private boolean licenseTermsAgreed;
+ private boolean installSbox;
+ private boolean installTargets;
+ private boolean installCppEnv;
+ private boolean installPythonEnv;
+
+ /**
+ * Constructor.
+ */
+ public MaemoSDKVMInstallData() {
+ fileToDownload = new MaemoSDKVMInfo();
+ }
+
+ /**
+ * Set the file to download.
+ *
+ * @param downloadFile
+ */
+ public void setFileToDownload(MaemoSDKVMInfo downloadFile) {
+ if (downloadFile == null)
+ return;
+ this.fileToDownload = downloadFile;
+ if (fileToDownload.getLocalURL() == null && installationPath != null)
+ try {
+ fileToDownload.setLocalURL(new File(installationPath).toURL());
+ } catch (MalformedURLException e) {
+ Activator.getErrorLogger().logAndShowError(
+ "Cannot get location for file "
+ + downloadFile.getDescription(), e);
+ }
+ }
+
+ /**
+ * Return the file to download.
+ *
+ * @return
+ */
+ public MaemoSDKVMInfo getFileToDownload() {
+ return fileToDownload;
+ }
+
+ /**
+ * @return the usePreviousInstallation
+ */
+ public boolean canUsePreviousInstallation() {
+ return usePreviousInstallation;
+ }
+
+ /**
+ * @param usePreviousInstallation
+ * the usePreviousInstallation to set
+ */
+ public void setUsePreviousInstallation(boolean usePreviousInstallation) {
+ this.usePreviousInstallation = usePreviousInstallation;
+ }
+
+ /**
+ * @return the installationPath
+ */
+ public String getInstallationPath() {
+ return installationPath;
+ }
+
+ /**
+ * @param installationPath
+ * the installationPath to set
+ */
+ public void setInstallationPath(String installationPath) {
+ this.installationPath = installationPath;
+ try {
+ fileToDownload.setLocalURL(new File(installationPath).toURL());
+ } catch (MalformedURLException e) {
+ Activator.getErrorLogger().logAndShowError(
+ "Cannot get location for file "
+ + fileToDownload.getDescription(), e);
+ }
+
+ }
+
+ /**
+ * @return the pathOfExistentVM
+ */
+ public String getPathOfExistentVM() {
+ return pathOfExistentVM;
+ }
+
+ /**
+ * @param pathOfExistentVM
+ * the pathOfExistentVM to set
+ */
+ public void setPathOfExistentVM(String pathOfExistentVM) {
+ this.pathOfExistentVM = pathOfExistentVM;
+ }
+
+ /**
+ * @return the installSbox
+ */
+ public boolean canInstallSbox() {
+ return installSbox;
+ }
+
+ /**
+ * @param installSbox
+ * the installSbox to set
+ */
+ public void setInstallSbox(boolean installSbox) {
+ this.installSbox = installSbox;
+ }
+
+ /**
+ * @return the installTargets
+ */
+ public boolean canInstallTargets() {
+ return installTargets;
+ }
+
+ /**
+ * @param installTargets
+ * the installTargets to set
+ */
+ public void setInstallTargets(boolean installTargets) {
+ this.installTargets = installTargets;
+ }
+
+ /**
+ * @return true, if it is necessary to install Python programming
+ * environment; false, otherwise.
+ */
+ public boolean canInstallPythonEnv() {
+ return installPythonEnv;
+ }
+
+ /**
+ * @param installTargets
+ * the installTargets to set
+ */
+ public void setInstallPythonEnv(boolean installPythonEnv) {
+ this.installPythonEnv = installPythonEnv;
+ }
+
+ /**
+ *
+ * @return true, if it is necessary to install CPP programming environment;
+ * false, otherwise.
+ */
+ public boolean canInstallCppEnv() {
+ return installCppEnv;
+ }
+
+ /**
+ * @param installCppEnv
+ * the installTargets to set
+ */
+ public void setInstallCppEnv(boolean installCppEnv) {
+ this.installCppEnv = installCppEnv;
+ }
+
+ /**
+ * @return true, if license terms were agreed; false, otherwise.
+ */
+ public boolean isLicenseTermsAgreed() {
+ return licenseTermsAgreed;
+ }
+
+ /**
+ * @param licenseTermsAgreed
+ * the licenseTermsAgreed to set
+ */
+ public void setLicenseTermsAgreed(boolean licenseTermsAgreed) {
+ this.licenseTermsAgreed = licenseTermsAgreed;
+ }
+
+}
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallationWorkPage.java
===================================================================
--- trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallationWorkPage.java 2009-08-19 18:08:38 UTC (rev 1976)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallationWorkPage.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Raul Herbster (INdT) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.vm.vmware.ui.wizards;
-
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.maemo.mica.common.ui.TimeoutUI;
-import org.maemo.mica.internal.api.common.ui.wizards.WizardWorkProgressPageBase;
-
-/**
- * Work page for Maemo SDK virtual image installer.
- *
- * @author raulherbster
- *
- */
-public class MaemoSDKVMInstallationWorkPage extends WizardWorkProgressPageBase {
-
- private TimeoutUI timeoutUI;
-
- /**
- * Constructor.
- *
- * @param wizard
- * parent wizard
- */
- public MaemoSDKVMInstallationWorkPage(NewMaemoSDKVMWizard wizard) {
- super(
- "Install Maemo SDK Virtual Image",
- "This page shows the installation process. Before finishing, configure the settings and verify your network preferences.");
- timeoutUI = new TimeoutUI();
- timeoutUI.setTimeout(30);
- setWizard(wizard);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.WizardPage#getWizard()
- */
- @Override
- public NewMaemoSDKVMWizard getWizard() {
- return (NewMaemoSDKVMWizard) super.getWizard();
- }
-
- /**
- * @return the timeout in seconds
- */
- public int getTimeout() {
- return timeoutUI.getTimeout();
- }
-
- /**
- * @param timeout
- * the timeout to set in seconds
- */
- public void setTimeout(int timeout) {
- timeoutUI.setTimeout(timeout);
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.maemo.mica.common.ui.wizards.WizardWorkProgressPageBase#
- * addControlsBelowProgress(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected void addControlsBelowProgress(Composite body) {
- Composite options = new Composite(body, SWT.NONE);
- options.setLayout(new GridLayout(2, true));
- GridDataFactory.fillDefaults().grab(true, false).applyTo(options);
-
- Composite timeoutBlock = timeoutUI.createUI(options, SWT.NONE);
- GridDataFactory.fillDefaults().grab(true, false).applyTo(timeoutBlock);
-
- addStockNetworkSettingHyperlink(body);
-
- }
-
-}
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallationWorkPage.java (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallationWorkPage.java)
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallationWorkPage.java (rev 0)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallationWorkPage.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (INdT) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.vm.vmware.ui.wizards;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.maemo.mica.common.ui.TimeoutUI;
+import org.maemo.mica.internal.api.common.ui.wizards.WizardWorkProgressPageBase;
+
+/**
+ * Work page for Maemo SDK virtual image installer.
+ *
+ * @author raulherbster
+ *
+ */
+public class MaemoSDKVMInstallationWorkPage extends WizardWorkProgressPageBase {
+
+ private TimeoutUI timeoutUI;
+
+ /**
+ * Constructor.
+ *
+ * @param wizard
+ * parent wizard
+ */
+ public MaemoSDKVMInstallationWorkPage(NewMaemoSDKVMWizard wizard) {
+ super(
+ "Install Maemo SDK Virtual Image",
+ "This page shows the installation process. Before finishing, configure the settings and verify your network preferences.");
+ timeoutUI = new TimeoutUI();
+ timeoutUI.setTimeout(30);
+ setWizard(wizard);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.WizardPage#getWizard()
+ */
+ @Override
+ public NewMaemoSDKVMWizard getWizard() {
+ return (NewMaemoSDKVMWizard) super.getWizard();
+ }
+
+ /**
+ * @return the timeout in seconds
+ */
+ public int getTimeout() {
+ return timeoutUI.getTimeout();
+ }
+
+ /**
+ * @param timeout
+ * the timeout to set in seconds
+ */
+ public void setTimeout(int timeout) {
+ timeoutUI.setTimeout(timeout);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.mica.common.ui.wizards.WizardWorkProgressPageBase#
+ * addControlsBelowProgress(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected void addControlsBelowProgress(Composite body) {
+ Composite options = new Composite(body, SWT.NONE);
+ options.setLayout(new GridLayout(2, true));
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(options);
+
+ Composite timeoutBlock = timeoutUI.createUI(options, SWT.NONE);
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(timeoutBlock);
+
+ addStockNetworkSettingHyperlink(body);
+
+ }
+
+}
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java
===================================================================
--- trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java 2009-08-19 18:08:38 UTC (rev 1976)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Raul Herbster (INdT) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.vm.vmware.ui.wizards;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.swt.graphics.Image;
-import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMInfo;
-import org.maemo.esbox.internal.vm.vmware.Activator;
-import org.maemo.mica.internal.api.common.ui.LazyLoadingThreadTableContentProvider;
-
-import com.nokia.cpp.internal.api.utils.core.FileUtils;
-
-/**
- * Content and label provider for table that shows available Maemo SDK virtual
- * images.
- *
- * @author raulherbster
- *
- */
-public class MaemoSDKVMInstallerContentLabelProvider extends
- LazyLoadingThreadTableContentProvider {
-
- /**
- * Thread to access information about available Maemo SDK virtual images on
- * website.
- *
- * @author raulherbster
- *
- */
- protected class MaemoVMInstallScriptFetcherThread extends Thread {
- protected Object newInput;
-
- /**
- * Construtor.
- *
- * @param newInput
- */
- public MaemoVMInstallScriptFetcherThread(Object newInput) {
- this.newInput = newInput;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Thread#run()
- */
- public void run() {
- doFetchScripts();
-
- contents.remove(LOADING_LABEL);
- doFireContentChanged();
- }
-
- /**
- * Implement by querying the input and/or calling fetchScriptsFromUrl()
- * and adding them to contents.
- */
- protected void doFetchScripts() {
- List<String> virtualImagesNames = fetchVMNamesFromUrl("http://tablets-dev.nokia.com/maemo-dev-env-downloads.php");
- for (String name : virtualImagesNames) {
- MaemoSDKVMInfo downloadFile = new MaemoSDKVMInfo();
- downloadFile.setDescription(name);
- if (!contents.contains(downloadFile))
- contents.add(downloadFile);
- else {
- int indexOfExistingDownloadFile = contents
- .indexOf(downloadFile);
- ((MaemoSDKVMInfo) contents.get(indexOfExistingDownloadFile))
- .setHasMoreParts(true);
- }
- }
- }
-
- /**
- * Get available Maemo SDK virtual image from given URL.
- *
- * @param urlString
- * the url of website that contains information about
- * available Maemo SDK virtual images.
- * @return a list with the names of available Maemo SDK virtual images.
- */
- protected List<String> fetchVMNamesFromUrl(String urlString) {
- URL url;
- try {
- url = new URL(urlString);
- } catch (MalformedURLException e) {
- Activator.getErrorLogger().logAndShowError(
- "Invalid URL: " + urlString, e);
- return Collections.emptyList();
- }
-
- List<String> virtualImagesNames = new ArrayList<String>();
- try {
-
- URLConnection connection = url.openConnection();
- connection.setConnectTimeout(1000 * 10);
- connection.connect();
-
- // apparently this fetches the HTML...
- String content = new String(FileUtils.readInputStreamContents(
- connection.getInputStream(), "UTF-8"));
-
- /*
- * The names of virtual images are on
- * http://tablets-dev.nokia.com/maemo-dev-env-downloads.php
- * (front-page). Basically, they list have the following format:
- * Maemo ANY_WORD Virtual ANY_WORD Image ANY_WORD Also, we
- * filter duplicated entries, for example, files split into two
- * parts.
- */
- Pattern maemoVMPattern = Pattern
- .compile("Maemo([\\w\\s]*)Virtual([\\w\\s]*)Image([\\w\\s]*)");
- Matcher matcher = maemoVMPattern.matcher(content);
- while (matcher.find()) {
- String virtualImageName = matcher.group(0);
- virtualImageName = processVirtualImageName(virtualImageName);
- virtualImagesNames.add(virtualImageName);
- }
- } catch (Exception e) {
- if (e instanceof InterruptedException)
- return virtualImagesNames;
-
- if (!isInterrupted())
- Activator.getErrorLogger().logAndShowError(
- "Could not fetch listing from " + url, e);
- }
-
- return virtualImagesNames;
- }
-
- /**
- * Process the description of Maemo SDK virtual image and only returns
- * the main description.
- *
- * @param virtualImageName
- * the complete description of a certain Maemo SDK virtual
- * image.
- * @return the main description of a certain Maemo SDK virtual image.
- */
- private String processVirtualImageName(String virtualImageName) {
- int indexOfPar = virtualImageName.indexOf("(");
- if (indexOfPar < 0)
- return virtualImageName;
- return virtualImageName.substring(0, indexOfPar).trim();
- }
- }
-
- private Image vmImage;
-
- /**
- * Construtor.
- */
- public MaemoSDKVMInstallerContentLabelProvider() {
- super();
- vmImage = Activator.MAEMO_VM_DESCRIPTOR.createImage();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.maemo.mica.common.ui.common.LazyLoadingThreadTableContentProvider
- * #createContentFetchThread(java.lang.Object)
- */
- @Override
- protected Thread createContentFetchThread(Object newInput) {
- return new MaemoVMInstallScriptFetcherThread(newInput);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.
- * Object)
- */
- public Object[] getChildren(Object parentElement) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object
- * )
- */
- public Object getParent(Object element) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.
- * Object)
- */
- public boolean hasChildren(Object element) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
- */
- public String getColumnText(Object element, int column) {
- if (element == LOADING_LABEL)
- return super.getColumnText(element, column);
-
- if (element instanceof MaemoSDKVMInfo) {
- MaemoSDKVMInfo data = (MaemoSDKVMInfo) element;
- if (column == 0)
- return data.getDescription();
- }
- return "";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
- */
- public Image getColumnImage(Object element, int column) {
- if (element instanceof MaemoSDKVMInfo) {
- if (column == 0)
- return vmImage;
- }
- return null;
- }
-
-}
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java)
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java (rev 0)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (INdT) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.vm.vmware.ui.wizards;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.swt.graphics.Image;
+import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMInfo;
+import org.maemo.esbox.internal.vm.vmware.Activator;
+import org.maemo.mica.internal.api.common.ui.LazyLoadingThreadTableContentProvider;
+
+import com.nokia.cpp.internal.api.utils.core.FileUtils;
+
+/**
+ * Content and label provider for table that shows available Maemo SDK virtual
+ * images.
+ *
+ * @author raulherbster
+ *
+ */
+public class MaemoSDKVMInstallerContentLabelProvider extends
+ LazyLoadingThreadTableContentProvider {
+
+ /**
+ * Thread to access information about available Maemo SDK virtual images on
+ * website.
+ *
+ * @author raulherbster
+ *
+ */
+ protected class MaemoVMInstallScriptFetcherThread extends Thread {
+ protected Object newInput;
+
+ /**
+ * Construtor.
+ *
+ * @param newInput
+ */
+ public MaemoVMInstallScriptFetcherThread(Object newInput) {
+ this.newInput = newInput;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Thread#run()
+ */
+ public void run() {
+ doFetchScripts();
+
+ contents.remove(LOADING_LABEL);
+ doFireContentChanged();
+ }
+
+ /**
+ * Implement by querying the input and/or calling fetchScriptsFromUrl()
+ * and adding them to contents.
+ */
+ protected void doFetchScripts() {
+ List<String> virtualImagesNames = fetchVMNamesFromUrl("http://tablets-dev.nokia.com/maemo-dev-env-downloads.php");
+ for (String name : virtualImagesNames) {
+ MaemoSDKVMInfo downloadFile = new MaemoSDKVMInfo();
+ downloadFile.setDescription(name);
+ if (!contents.contains(downloadFile))
+ contents.add(downloadFile);
+ else {
+ int indexOfExistingDownloadFile = contents
+ .indexOf(downloadFile);
+ ((MaemoSDKVMInfo) contents.get(indexOfExistingDownloadFile))
+ .setHasMoreParts(true);
+ }
+ }
+ }
+
+ /**
+ * Get available Maemo SDK virtual image from given URL.
+ *
+ * @param urlString
+ * the url of website that contains information about
+ * available Maemo SDK virtual images.
+ * @return a list with the names of available Maemo SDK virtual images.
+ */
+ protected List<String> fetchVMNamesFromUrl(String urlString) {
+ URL url;
+ try {
+ url = new URL(urlString);
+ } catch (MalformedURLException e) {
+ Activator.getErrorLogger().logAndShowError(
+ "Invalid URL: " + urlString, e);
+ return Collections.emptyList();
+ }
+
+ List<String> virtualImagesNames = new ArrayList<String>();
+ try {
+
+ URLConnection connection = url.openConnection();
+ connection.setConnectTimeout(1000 * 10);
+ connection.connect();
+
+ // apparently this fetches the HTML...
+ String content = new String(FileUtils.readInputStreamContents(
+ connection.getInputStream(), "UTF-8"));
+
+ /*
+ * The names of virtual images are on
+ * http://tablets-dev.nokia.com/maemo-dev-env-downloads.php
+ * (front-page). Basically, they list have the following format:
+ * Maemo ANY_WORD Virtual ANY_WORD Image ANY_WORD Also, we
+ * filter duplicated entries, for example, files split into two
+ * parts.
+ */
+ Pattern maemoVMPattern = Pattern
+ .compile("Maemo([\\w\\s]*)Virtual([\\w\\s]*)Image([\\w\\s]*)");
+ Matcher matcher = maemoVMPattern.matcher(content);
+ while (matcher.find()) {
+ String virtualImageName = matcher.group(0);
+ virtualImageName = processVirtualImageName(virtualImageName);
+ virtualImagesNames.add(virtualImageName);
+ }
+ } catch (Exception e) {
+ if (e instanceof InterruptedException)
+ return virtualImagesNames;
+
+ if (!isInterrupted())
+ Activator.getErrorLogger().logAndShowError(
+ "Could not fetch listing from " + url, e);
+ }
+
+ return virtualImagesNames;
+ }
+
+ /**
+ * Process the description of Maemo SDK virtual image and only returns
+ * the main description.
+ *
+ * @param virtualImageName
+ * the complete description of a certain Maemo SDK virtual
+ * image.
+ * @return the main description of a certain Maemo SDK virtual image.
+ */
+ private String processVirtualImageName(String virtualImageName) {
+ int indexOfPar = virtualImageName.indexOf("(");
+ if (indexOfPar < 0)
+ return virtualImageName;
+ return virtualImageName.substring(0, indexOfPar).trim();
+ }
+ }
+
+ private Image vmImage;
+
+ /**
+ * Construtor.
+ */
+ public MaemoSDKVMInstallerContentLabelProvider() {
+ super();
+ vmImage = Activator.MAEMO_VM_DESCRIPTOR.createImage();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.common.ui.common.LazyLoadingThreadTableContentProvider
+ * #createContentFetchThread(java.lang.Object)
+ */
+ @Override
+ protected Thread createContentFetchThread(Object newInput) {
+ return new MaemoVMInstallScriptFetcherThread(newInput);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.
+ * Object)
+ */
+ public Object[] getChildren(Object parentElement) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object
+ * )
+ */
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.
+ * Object)
+ */
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+ */
+ public String getColumnText(Object element, int column) {
+ if (element == LOADING_LABEL)
+ return super.getColumnText(element, column);
+
+ if (element instanceof MaemoSDKVMInfo) {
+ MaemoSDKVMInfo data = (MaemoSDKVMInfo) element;
+ if (column == 0)
+ return data.getDescription();
+ }
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+ */
+ public Image getColumnImage(Object element, int column) {
+ if (element instanceof MaemoSDKVMInfo) {
+ if (column == 0)
+ return vmImage;
+ }
+ return null;
+ }
+
+}
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java
===================================================================
--- trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java 2009-08-19 18:08:38 UTC (rev 1976)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Raul Herbster (INdT) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.vm.vmware.ui.wizards;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.maemo.esbox.internal.vm.vmware.Activator;
-
-/**
- * Page that display license contents.
- *
- * @author raulherbster
- *
- */
-public class MaemoSDKVMLicenseWizardPage extends WizardPage {
-
- private String license;
- private boolean licenseTermsAgreed = false;
- private boolean ok = false;
-
- /**
- * Constructor
- *
- * @param wizard
- * parent wizard.
- */
- protected MaemoSDKVMLicenseWizardPage(NewMaemoSDKVMWizard wizard) {
- super("maemovm_licensepage", "License",
- Activator.MAEMO_VM_WIZBAN_DESCRIPTOR);
- try {
- license = Activator.readResourceFile("./data/license.txt");
- } catch (Exception e) {
- Activator.getErrorLogger().logAndShowError(
- "Cannot open license terms file.", e);
- }
- setWizard(wizard);
- ok = true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
- * .Composite)
- */
- public void createControl(Composite parent) {
- if (license != null) {
- Composite container = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout(1, false);
- container.setLayout(layout);
- GridData licenseGridData = new GridData(GridData.BEGINNING
- | GridData.FILL_BOTH);
- licenseGridData.widthHint = 500;
- licenseGridData.heightHint = 300;
- Text licenseText = new Text(container, SWT.BORDER | SWT.V_SCROLL
- | SWT.WRAP);
-
- StringBuffer licenseTextBuffer = new StringBuffer();
- licenseTextBuffer
- .append("THIS LICENSE COVERS THE FOLLOWING COMPONENTS\n\n");
- // licenseTextBuffer.append(image.getDescription() + "\n");
- // licenseTextBuffer.append(flasher.getDescription() + "\n");
- licenseTextBuffer.append("\n");
-
- licenseTextBuffer.append(license);
- licenseText.setLayoutData(licenseGridData);
- licenseText.setEditable(false);
- // licenseText.setBackground(FlasherUtil.COLOR_WHITE);
-
- licenseText.setText(licenseTextBuffer.toString());
- licenseText.setTopIndex(0);
-
- Button agreeButton = new Button(container, SWT.RADIO);
- agreeButton.setText("I accept the terms of the license agreements"); //$NON-NLS-1$
- agreeButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent event) {
- licenseTermsAgreed = true;
- setPageComplete(licenseTermsAgreed);
- }
- });
- Button disagreeButton = new Button(container, SWT.RADIO);
- disagreeButton
- .setText("I do not accept the terms of the license agreements"); //$NON-NLS-1$
- disagreeButton.setSelection(true);
- disagreeButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent event) {
- licenseTermsAgreed = false;
- ((NewMaemoSDKVMWizard) getWizard()).getInstallData()
- .setLicenseTermsAgreed(licenseTermsAgreed);
- setPageComplete(licenseTermsAgreed);
- }
- });
-
- setControl(container);
- } else {
- ok = false;
- final String message = "Cannot fetch license terms";
- Activator.getErrorLogger().logAndShowError(message, null); //$NON-NLS-1$
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.WizardPage#canFlipToNextPage()
- */
- @Override
- public boolean canFlipToNextPage() {
- return ok && licenseTermsAgreed;
- }
-
-}
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java)
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java (rev 0)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (INdT) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.vm.vmware.ui.wizards;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.maemo.esbox.internal.vm.vmware.Activator;
+
+/**
+ * Page that display license contents.
+ *
+ * @author raulherbster
+ *
+ */
+public class MaemoSDKVMLicenseWizardPage extends WizardPage {
+
+ private String license;
+ private boolean licenseTermsAgreed = false;
+ private boolean ok = false;
+
+ /**
+ * Constructor
+ *
+ * @param wizard
+ * parent wizard.
+ */
+ protected MaemoSDKVMLicenseWizardPage(NewMaemoSDKVMWizard wizard) {
+ super("maemovm_licensepage", "License",
+ Activator.MAEMO_VM_WIZBAN_DESCRIPTOR);
+ try {
+ license = Activator.readResourceFile("./data/license.txt");
+ } catch (Exception e) {
+ Activator.getErrorLogger().logAndShowError(
+ "Cannot open license terms file.", e);
+ }
+ setWizard(wizard);
+ ok = true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ public void createControl(Composite parent) {
+ if (license != null) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout(1, false);
+ container.setLayout(layout);
+ GridData licenseGridData = new GridData(GridData.BEGINNING
+ | GridData.FILL_BOTH);
+ licenseGridData.widthHint = 500;
+ licenseGridData.heightHint = 300;
+ Text licenseText = new Text(container, SWT.BORDER | SWT.V_SCROLL
+ | SWT.WRAP);
+
+ StringBuffer licenseTextBuffer = new StringBuffer();
+ licenseTextBuffer
+ .append("THIS LICENSE COVERS THE FOLLOWING COMPONENTS\n\n");
+ // licenseTextBuffer.append(image.getDescription() + "\n");
+ // licenseTextBuffer.append(flasher.getDescription() + "\n");
+ licenseTextBuffer.append("\n");
+
+ licenseTextBuffer.append(license);
+ licenseText.setLayoutData(licenseGridData);
+ licenseText.setEditable(false);
+ // licenseText.setBackground(FlasherUtil.COLOR_WHITE);
+
+ licenseText.setText(licenseTextBuffer.toString());
+ licenseText.setTopIndex(0);
+
+ Button agreeButton = new Button(container, SWT.RADIO);
+ agreeButton.setText("I accept the terms of the license agreements"); //$NON-NLS-1$
+ agreeButton.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent event) {
+ // do nothing
+ }
+
+ public void widgetSelected(SelectionEvent event) {
+ licenseTermsAgreed = true;
+ setPageComplete(licenseTermsAgreed);
+ }
+ });
+ Button disagreeButton = new Button(container, SWT.RADIO);
+ disagreeButton
+ .setText("I do not accept the terms of the license agreements"); //$NON-NLS-1$
+ disagreeButton.setSelection(true);
+ disagreeButton.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent event) {
+ // do nothing
+ }
+
+ public void widgetSelected(SelectionEvent event) {
+ licenseTermsAgreed = false;
+ ((NewMaemoSDKVMWizard) getWizard()).getInstallData()
+ .setLicenseTermsAgreed(licenseTermsAgreed);
+ setPageComplete(licenseTermsAgreed);
+ }
+ });
+
+ setControl(container);
+ } else {
+ ok = false;
+ final String message = "Cannot fetch license terms";
+ Activator.getErrorLogger().logAndShowError(message, null); //$NON-NLS-1$
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.WizardPage#canFlipToNextPage()
+ */
+ @Override
+ public boolean canFlipToNextPage() {
+ return ok && licenseTermsAgreed;
+ }
+
+}
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java
===================================================================
--- trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java 2009-08-19 18:08:38 UTC (rev 1976)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Raul Herbster (INdT) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.vm.vmware.ui.wizards;
-
-import java.io.File;
-
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMInfo;
-import org.maemo.esbox.internal.vm.vmware.Activator;
-import org.maemo.mica.common.ui.NetworkSettingsUI;
-import org.maemo.mica.common.ui.dialogs.DialogUtils;
-
-/**
- * Page that displays general information about the Maemo SDK virtual image to
- * be installed.
- *
- * @author raulherbster
- *
- */
-public class MaemoSDKVMSelectionWizardPage extends WizardPage {
-
- private static final MaemoSDKVMInfo latestVMInstallData = getLatestVMInstallFile();
-
- private static MaemoSDKVMInfo getLatestVMInstallFile() {
- MaemoSDKVMInfo downloadFile = new MaemoSDKVMInfo();
- downloadFile
- .setDescription("Maemo Diablo SDK Virtual Image with Ubuntu Intrepid Server");
- return downloadFile;
- }
-
- // Virtual images area
- private Button downloadLatest;
- private TableViewer virtualImagesTable;
-
- // options area
- private Button usePreviousDownloadButton;
- private Text destinationTextField;
-
- // advanced area
- private Button advancedButton;
- private Composite advancedContent;
- private Text existingVirtualImageTextField;
-
- /**
- * Constructor.
- *
- * @param wizard
- * the parent wizard.
- */
- protected MaemoSDKVMSelectionWizardPage(NewMaemoSDKVMWizard wizard) {
- super("maemovm_selection", "Select Maemo SDK Virtual Image",
- Activator.MAEMO_VM_WIZBAN_DESCRIPTOR);
- setDescription("Select the Maemo SDK Virtual Image you want to install.");
- setPageComplete(false);
- setWizard(wizard);
- // set latest maemo SDK VM
- wizard.getInstallData().setFileToDownload(latestVMInstallData);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
- * .Composite)
- */
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayoutFactory.fillDefaults().numColumns(4).applyTo(composite);
- GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
- setControl(composite);
-
- createVirtualImagesSelector(composite);
-
- createOptionsContent(composite);
-
- createAdvancedContent(composite);
-
- virtualImagesTable.setInput(new Object[0]);
-
- for (TableColumn column : virtualImagesTable.getTable().getColumns()) {
- column.pack();
- }
- }
-
- /**
- * Create table that displays available Maemo SDK virtual image.
- *
- * @param composite
- * parent composite.
- */
- private void createVirtualImagesSelector(Composite composite) {
- Label label = new Label(composite, SWT.NONE);
- label.setText("Select an image:");
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1)
- .applyTo(label);
- Link link = NetworkSettingsUI
- .createStockNetworkSettingHyperlink(composite);
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).span(2, 1)
- .applyTo(link);
-
- downloadLatest = createButton(composite, SWT.CHECK ,
- "Download latest empty server image for Maemo");
- downloadLatest.setSelection(true);
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(4, 1)
- .applyTo(downloadLatest);
- downloadLatest.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- virtualImagesTable.getTable().setEnabled(
- !downloadLatest.getSelection());
- if (downloadLatest.getSelection())
- doChangeVMChoice(latestVMInstallData);
- validatePage();
- }
- });
-
- virtualImagesTable = new TableViewer(composite, SWT.BORDER | SWT.SCROLL_PAGE);
- virtualImagesTable
- .addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- Object element = ((IStructuredSelection) event
- .getSelection()).getFirstElement();
- if (element instanceof MaemoSDKVMInfo) {
- doChangeVMChoice((MaemoSDKVMInfo) element);
- validatePage();
- }
- }
-
- });
-
- MaemoSDKVMInstallerContentLabelProvider platformProvider = new MaemoSDKVMInstallerContentLabelProvider();
-
- virtualImagesTable.setContentProvider(platformProvider);
- virtualImagesTable.setLabelProvider(platformProvider);
-
- platformProvider.addListener(new ILabelProviderListener() {
-
- public void labelProviderChanged(LabelProviderChangedEvent event) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (!virtualImagesTable.getTable().isDisposed()) {
- for (TableColumn column : virtualImagesTable
- .getTable().getColumns()) {
- column.pack();
- }
- }
- }
- });
- }
- });
-
- Table table = virtualImagesTable.getTable();
- GridDataFactory.fillDefaults().grab(true, true).span(4, 1).applyTo(
- table);
-
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- table.setEnabled(false);
-
- TableColumn column = new TableColumn(table, SWT.LEFT);
- column.setText("Name");
-
- }
-
- /**
- * Create the contents with options to install Maemo SDK virtual image.
- *
- * @param composite
- * parent composite.
- */
- public void createOptionsContent(Composite composite) {
- usePreviousDownloadButton = createButton(composite, SWT.CHECK,
- "Use previous download");
- GridDataFactory.swtDefaults().span(4, 1).align(SWT.LEFT, SWT.CENTER)
- .applyTo(usePreviousDownloadButton);
- usePreviousDownloadButton
- .setToolTipText("If checked, continue from a previous download of the virtual image if possible, else, always download.");
- usePreviousDownloadButton.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent evt) {
- boolean usePreviousDownload = usePreviousDownloadButton
- .getSelection();
- downloadLatest.setEnabled(!usePreviousDownload);
- virtualImagesTable.getTable().setEnabled(
- !usePreviousDownload && !downloadLatest.getSelection());
- advancedButton.setEnabled(usePreviousDownload);
- ((NewMaemoSDKVMWizard) getWizard()).getInstallData()
- .setUsePreviousInstallation(usePreviousDownload);
- }
-
- });
-
- Label label = new Label(composite, SWT.NONE);
- label.setText("Virtual image destination:");
- GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER)
- .applyTo(label);
-
- destinationTextField = new Text(composite, SWT.BORDER);
- destinationTextField
- .setToolTipText("Specify the location of Maemo SDK Virtual Image.");
- GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(
- destinationTextField);
-
- Button browserButton = createButton(composite, SWT.PUSH ,
- "Browse...");
- GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(
- browserButton);
- browserButton.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent evt) {
- DirectoryDialog dialog = new DirectoryDialog(DialogUtils
- .getShell(), SWT.OPEN);
- dialog
- .setText("Select the directory to save the Maemo SDK Virtual Image");
- String pathDirectory = dialog.open();
- if (pathDirectory != null) {
- destinationTextField.setText(pathDirectory);
- setDownloadFileLocalURL(pathDirectory);
- validatePage();
- }
- }
- });
- }
-
- /**
- * Create the contents of advanced area.
- *
- * @param composite
- * the parent composite.
- */
- private void createAdvancedContent(Composite composite) {
- Label label = new Label(composite, SWT.NONE);
- GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER).span(4, 1)
- .applyTo(label);
-
- advancedButton = new Button(composite, SWT.TOGGLE);
- GridDataFactory.swtDefaults().span(4, 1).applyTo(advancedButton);
- advancedButton.setText("Advanced >>");
- advancedButton.setSelection(false);
- advancedButton.setEnabled(false);
-
- advancedContent = new Composite(composite, SWT.NONE);
- GridLayoutFactory.fillDefaults().numColumns(4).applyTo(advancedContent);
-
- GridDataFactory.fillDefaults().grab(true, false).span(4, 1).applyTo(
- advancedContent);
- enableAdvancedContent(false);
-
- label = new Label(advancedContent, SWT.NONE);
- label.setText("Existing virtual image location:");
- GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER)
- .applyTo(label);
-
- existingVirtualImageTextField = new Text(advancedContent, SWT.BORDER);
- existingVirtualImageTextField
- .setToolTipText("Specify the location of existing compressed Maemo SDK Virtual Image.");
- GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(
- existingVirtualImageTextField);
-
- Button browserButton = createButton(advancedContent, SWT.PUSH, "Browse...");
- GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(
- browserButton);
- browserButton.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent evt) {
- FileDialog dialog = new FileDialog(DialogUtils.getShell(),
- SWT.OPEN);
- dialog.setFilterExtensions(new String[] { "*.zip" });
- dialog
- .setText("Select the location of compressed virtual image");
- String pathDirectory = dialog.open();
- if (pathDirectory != null) {
- existingVirtualImageTextField.setText(pathDirectory);
- ((NewMaemoSDKVMWizard) getWizard()).getInstallData()
- .setPathOfExistentVM(pathDirectory);
- validatePage();
- }
- }
- });
-
- advancedButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (advancedButton.getSelection()) {
- advancedButton.setText("<< Advanced");
- } else {
- advancedButton.setText("Advanced >>");
- }
- enableAdvancedContent(advancedButton.getSelection());
- }
- });
- }
-
- /**
- * Validate information of the wizard page, so we can check if it is
- * possible to proceed or not.
- */
- private void validatePage() {
- String imageLocation = destinationTextField.getText();
- String errorMessage = null;
- errorMessage = validatePathLocation(imageLocation);
- if (!downloadLatest.getSelection()
- && virtualImagesTable.getSelection().isEmpty()
- && !usePreviousDownloadButton.getSelection()) {
- errorMessage = "Select a virtual image to be installed on your host machine";
- }
- if (usePreviousDownloadButton.getSelection()) {
- String existingVirtualImageLocation = existingVirtualImageTextField
- .getText().trim();
- errorMessage = validatePathLocation(existingVirtualImageLocation);
- }
- setErrorMessage(errorMessage);
- setPageComplete(errorMessage == null);
- }
-
- /**
- * Check if the given path is valid.
- *
- * @param path
- * @return
- */
- private String validatePathLocation(String path) {
- String errorMessage = null;
- if (path.trim().equals("")) {
- errorMessage = "Please, insert a valid location.";
- } else {
- File imageLocationPath = new File(path);
- if (!imageLocationPath.exists())
- errorMessage = "The path inserted " + path
- + " does not exist. Please, insert a valid location.";
- }
- return errorMessage;
- }
-
- /**
- * Utility method to create button.
- *
- * @param composite
- * parent composite.
- * @param style
- * sytle of button.
- * @param text
- * the text of the button.
- * @return a button created from the given options.
- */
- private Button createButton(Composite composite, int style, String text) {
- Button button = new Button(composite, style);
- button.setText(text);
- return button;
- }
-
- private void doChangeVMChoice(MaemoSDKVMInfo data) {
- if (data != null) {
- MaemoSDKVMInstallData installData = ((NewMaemoSDKVMWizard) getWizard())
- .getInstallData();
- installData.setFileToDownload(data);
- String localURL = destinationTextField.getText();
- setDownloadFileLocalURL(localURL);
- }
- }
-
- private void setDownloadFileLocalURL(String pathDirectory) {
- if (pathDirectory != null) {
- File imageLocationPath = new File(pathDirectory);
- if (imageLocationPath.exists() && imageLocationPath.isDirectory())
- ((NewMaemoSDKVMWizard) getWizard()).getInstallData()
- .setInstallationPath(pathDirectory);
- }
- }
-
- /**
- * @param selection
- */
- protected void enableAdvancedContent(boolean selection) {
- advancedContent.setVisible(selection);
- ((GridData) advancedContent.getLayoutData()).exclude = !selection;
- getShell().pack();
- }
-
-}
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java)
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java (rev 0)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -0,0 +1,412 @@
+/*******************************************************************************
+ * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (INdT) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.vm.vmware.ui.wizards;
+
+import java.io.File;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMInfo;
+import org.maemo.esbox.internal.vm.vmware.Activator;
+import org.maemo.mica.common.ui.NetworkSettingsUI;
+import org.maemo.mica.common.ui.dialogs.DialogUtils;
+
+/**
+ * Page that displays general information about the Maemo SDK virtual image to
+ * be installed.
+ *
+ * @author raulherbster
+ *
+ */
+public class MaemoSDKVMSelectionWizardPage extends WizardPage {
+
+ private static final MaemoSDKVMInfo latestVMInstallData = getLatestVMInstallFile();
+
+ private static MaemoSDKVMInfo getLatestVMInstallFile() {
+ MaemoSDKVMInfo downloadFile = new MaemoSDKVMInfo();
+ downloadFile
+ .setDescription("Maemo Diablo SDK Virtual Image with Ubuntu Intrepid Server");
+ return downloadFile;
+ }
+
+ // Virtual images area
+ private Button downloadLatest;
+ private TableViewer virtualImagesTable;
+
+ // options area
+ private Button usePreviousDownloadButton;
+ private Text destinationTextField;
+
+ // advanced area
+ private Button advancedButton;
+ private Composite advancedContent;
+ private Text existingVirtualImageTextField;
+
+ /**
+ * Constructor.
+ *
+ * @param wizard
+ * the parent wizard.
+ */
+ protected MaemoSDKVMSelectionWizardPage(NewMaemoSDKVMWizard wizard) {
+ super("maemovm_selection", "Select Maemo SDK Virtual Image",
+ Activator.MAEMO_VM_WIZBAN_DESCRIPTOR);
+ setDescription("Select the Maemo SDK Virtual Image you want to install.");
+ setPageComplete(false);
+ setWizard(wizard);
+ // set latest maemo SDK VM
+ wizard.getInstallData().setFileToDownload(latestVMInstallData);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayoutFactory.fillDefaults().numColumns(4).applyTo(composite);
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
+ setControl(composite);
+
+ createVirtualImagesSelector(composite);
+
+ createOptionsContent(composite);
+
+ createAdvancedContent(composite);
+
+ virtualImagesTable.setInput(new Object[0]);
+
+ for (TableColumn column : virtualImagesTable.getTable().getColumns()) {
+ column.pack();
+ }
+ }
+
+ /**
+ * Create table that displays available Maemo SDK virtual image.
+ *
+ * @param composite
+ * parent composite.
+ */
+ private void createVirtualImagesSelector(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setText("Select an image:");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1)
+ .applyTo(label);
+ Link link = NetworkSettingsUI
+ .createStockNetworkSettingHyperlink(composite);
+ GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).span(2, 1)
+ .applyTo(link);
+
+ downloadLatest = createButton(composite, SWT.CHECK ,
+ "Download latest empty server image for Maemo");
+ downloadLatest.setSelection(true);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(4, 1)
+ .applyTo(downloadLatest);
+ downloadLatest.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ virtualImagesTable.getTable().setEnabled(
+ !downloadLatest.getSelection());
+ if (downloadLatest.getSelection())
+ doChangeVMChoice(latestVMInstallData);
+ validatePage();
+ }
+ });
+
+ virtualImagesTable = new TableViewer(composite, SWT.BORDER | SWT.SCROLL_PAGE);
+ virtualImagesTable
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ Object element = ((IStructuredSelection) event
+ .getSelection()).getFirstElement();
+ if (element instanceof MaemoSDKVMInfo) {
+ doChangeVMChoice((MaemoSDKVMInfo) element);
+ validatePage();
+ }
+ }
+
+ });
+
+ MaemoSDKVMInstallerContentLabelProvider platformProvider = new MaemoSDKVMInstallerContentLabelProvider();
+
+ virtualImagesTable.setContentProvider(platformProvider);
+ virtualImagesTable.setLabelProvider(platformProvider);
+
+ platformProvider.addListener(new ILabelProviderListener() {
+
+ public void labelProviderChanged(LabelProviderChangedEvent event) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if (!virtualImagesTable.getTable().isDisposed()) {
+ for (TableColumn column : virtualImagesTable
+ .getTable().getColumns()) {
+ column.pack();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ Table table = virtualImagesTable.getTable();
+ GridDataFactory.fillDefaults().grab(true, true).span(4, 1).applyTo(
+ table);
+
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ table.setEnabled(false);
+
+ TableColumn column = new TableColumn(table, SWT.LEFT);
+ column.setText("Name");
+
+ }
+
+ /**
+ * Create the contents with options to install Maemo SDK virtual image.
+ *
+ * @param composite
+ * parent composite.
+ */
+ public void createOptionsContent(Composite composite) {
+ usePreviousDownloadButton = createButton(composite, SWT.CHECK,
+ "Use previous download");
+ GridDataFactory.swtDefaults().span(4, 1).align(SWT.LEFT, SWT.CENTER)
+ .applyTo(usePreviousDownloadButton);
+ usePreviousDownloadButton
+ .setToolTipText("If checked, continue from a previous download of the virtual image if possible, else, always download.");
+ usePreviousDownloadButton.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent evt) {
+ boolean usePreviousDownload = usePreviousDownloadButton
+ .getSelection();
+ downloadLatest.setEnabled(!usePreviousDownload);
+ virtualImagesTable.getTable().setEnabled(
+ !usePreviousDownload && !downloadLatest.getSelection());
+ advancedButton.setEnabled(usePreviousDownload);
+ ((NewMaemoSDKVMWizard) getWizard()).getInstallData()
+ .setUsePreviousInstallation(usePreviousDownload);
+ }
+
+ });
+
+ Label label = new Label(composite, SWT.NONE);
+ label.setText("Virtual image destination:");
+ GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER)
+ .applyTo(label);
+
+ destinationTextField = new Text(composite, SWT.BORDER);
+ destinationTextField
+ .setToolTipText("Specify the location of Maemo SDK Virtual Image.");
+ GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(
+ destinationTextField);
+
+ Button browserButton = createButton(composite, SWT.PUSH ,
+ "Browse...");
+ GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(
+ browserButton);
+ browserButton.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent evt) {
+ DirectoryDialog dialog = new DirectoryDialog(DialogUtils
+ .getShell(), SWT.OPEN);
+ dialog
+ .setText("Select the directory to save the Maemo SDK Virtual Image");
+ String pathDirectory = dialog.open();
+ if (pathDirectory != null) {
+ destinationTextField.setText(pathDirectory);
+ setDownloadFileLocalURL(pathDirectory);
+ validatePage();
+ }
+ }
+ });
+ }
+
+ /**
+ * Create the contents of advanced area.
+ *
+ * @param composite
+ * the parent composite.
+ */
+ private void createAdvancedContent(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER).span(4, 1)
+ .applyTo(label);
+
+ advancedButton = new Button(composite, SWT.TOGGLE);
+ GridDataFactory.swtDefaults().span(4, 1).applyTo(advancedButton);
+ advancedButton.setText("Advanced >>");
+ advancedButton.setSelection(false);
+ advancedButton.setEnabled(false);
+
+ advancedContent = new Composite(composite, SWT.NONE);
+ GridLayoutFactory.fillDefaults().numColumns(4).applyTo(advancedContent);
+
+ GridDataFactory.fillDefaults().grab(true, false).span(4, 1).applyTo(
+ advancedContent);
+ enableAdvancedContent(false);
+
+ label = new Label(advancedContent, SWT.NONE);
+ label.setText("Existing virtual image location:");
+ GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER)
+ .applyTo(label);
+
+ existingVirtualImageTextField = new Text(advancedContent, SWT.BORDER);
+ existingVirtualImageTextField
+ .setToolTipText("Specify the location of existing compressed Maemo SDK Virtual Image.");
+ GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(
+ existingVirtualImageTextField);
+
+ Button browserButton = createButton(advancedContent, SWT.PUSH, "Browse...");
+ GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(
+ browserButton);
+ browserButton.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent evt) {
+ FileDialog dialog = new FileDialog(DialogUtils.getShell(),
+ SWT.OPEN);
+ dialog.setFilterExtensions(new String[] { "*.zip" });
+ dialog
+ .setText("Select the location of compressed virtual image");
+ String pathDirectory = dialog.open();
+ if (pathDirectory != null) {
+ existingVirtualImageTextField.setText(pathDirectory);
+ ((NewMaemoSDKVMWizard) getWizard()).getInstallData()
+ .setPathOfExistentVM(pathDirectory);
+ validatePage();
+ }
+ }
+ });
+
+ advancedButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (advancedButton.getSelection()) {
+ advancedButton.setText("<< Advanced");
+ } else {
+ advancedButton.setText("Advanced >>");
+ }
+ enableAdvancedContent(advancedButton.getSelection());
+ }
+ });
+ }
+
+ /**
+ * Validate information of the wizard page, so we can check if it is
+ * possible to proceed or not.
+ */
+ private void validatePage() {
+ String imageLocation = destinationTextField.getText();
+ String errorMessage = null;
+ errorMessage = validatePathLocation(imageLocation);
+ if (!downloadLatest.getSelection()
+ && virtualImagesTable.getSelection().isEmpty()
+ && !usePreviousDownloadButton.getSelection()) {
+ errorMessage = "Select a virtual image to be installed on your host machine";
+ }
+ if (usePreviousDownloadButton.getSelection()) {
+ String existingVirtualImageLocation = existingVirtualImageTextField
+ .getText().trim();
+ errorMessage = validatePathLocation(existingVirtualImageLocation);
+ }
+ setErrorMessage(errorMessage);
+ setPageComplete(errorMessage == null);
+ }
+
+ /**
+ * Check if the given path is valid.
+ *
+ * @param path
+ * @return
+ */
+ private String validatePathLocation(String path) {
+ String errorMessage = null;
+ if (path.trim().equals("")) {
+ errorMessage = "Please, insert a valid location.";
+ } else {
+ File imageLocationPath = new File(path);
+ if (!imageLocationPath.exists())
+ errorMessage = "The path inserted " + path
+ + " does not exist. Please, insert a valid location.";
+ }
+ return errorMessage;
+ }
+
+ /**
+ * Utility method to create button.
+ *
+ * @param composite
+ * parent composite.
+ * @param style
+ * sytle of button.
+ * @param text
+ * the text of the button.
+ * @return a button created from the given options.
+ */
+ private Button createButton(Composite composite, int style, String text) {
+ Button button = new Button(composite, style);
+ button.setText(text);
+ return button;
+ }
+
+ private void doChangeVMChoice(MaemoSDKVMInfo data) {
+ if (data != null) {
+ MaemoSDKVMInstallData installData = ((NewMaemoSDKVMWizard) getWizard())
+ .getInstallData();
+ installData.setFileToDownload(data);
+ String localURL = destinationTextField.getText();
+ setDownloadFileLocalURL(localURL);
+ }
+ }
+
+ private void setDownloadFileLocalURL(String pathDirectory) {
+ if (pathDirectory != null) {
+ File imageLocationPath = new File(pathDirectory);
+ if (imageLocationPath.exists() && imageLocationPath.isDirectory())
+ ((NewMaemoSDKVMWizard) getWizard()).getInstallData()
+ .setInstallationPath(pathDirectory);
+ }
+ }
+
+ /**
+ * @param selection
+ */
+ protected void enableAdvancedContent(boolean selection) {
+ advancedContent.setVisible(selection);
+ ((GridData) advancedContent.getLayoutData()).exclude = !selection;
+ getShell().pack();
+ }
+
+}
Deleted: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java
===================================================================
--- trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java 2009-08-19 18:08:38 UTC (rev 1976)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Raul Herbster (INdT) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.vm.vmware.ui.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMInstaller;
-import org.maemo.esbox.internal.vm.vmware.Activator;
-import org.maemo.mica.common.core.Policy;
-import org.maemo.mica.common.core.ui.IProgressReporter;
-import org.maemo.mica.internal.api.common.ui.wizards.WizardWorkProgressPageBase;
-
-/**
- * The Maemo SDK Virtual Image wizard provides an easy method to install SDK
- * Virtual Image for pre-installed VMWare Player/Fusion (download, install and
- * configure latest empty server image for Maemo)
- *
- * @author raulherbster
- *
- */
-public class NewMaemoSDKVMWizard extends Wizard implements INewWizard {
-
- private MaemoSDKVMSelectionWizardPage targetPage;
- private MaemoSDKVMInstallationWorkPage downloadUncompressWorkPage;
- private MaemoSDKVMConfigurationWizardPage configurationPage;
- private MaemoSDKVMLicenseWizardPage licensePage;
- private MaemoSDKVMInstallData installData;
-
- /**
- * Constructor
- */
- public NewMaemoSDKVMWizard() {
- initialize();
- // create an empty install data
- installData = new MaemoSDKVMInstallData();
- }
-
- /**
- * Initialize main information about this wizard.
- */
- private void initialize() {
- setNeedsProgressMonitor(true);
- setWindowTitle("Install Maemo SDK Virtual Machine");
- ImageDescriptor image = Activator.MAEMO_VM_WIZBAN_DESCRIPTOR;
- setDefaultPageImageDescriptor(image);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.Wizard#addPages()
- */
- public void addPages() {
- targetPage = new MaemoSDKVMSelectionWizardPage(this);
- addPage(targetPage);
- configurationPage = new MaemoSDKVMConfigurationWizardPage(this);
- addPage(configurationPage);
- licensePage = new MaemoSDKVMLicenseWizardPage(this);
- addPage(licensePage);
- downloadUncompressWorkPage = new MaemoSDKVMInstallationWorkPage(this);
- addPage(downloadUncompressWorkPage);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
- * org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * Get the work page to show information about installation process.
- *
- * @return the work page of this wizard.
- */
- public WizardWorkProgressPageBase getWorkPage() {
- return downloadUncompressWorkPage;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.Wizard#performFinish()
- */
- public boolean performFinish() {
- final IStatus status = doWork();
-
- final boolean success = (status.isOK() || status.matches(IStatus.INFO));
-
- String message = success ? "Installation succeeded"
- : "Installation encountered some errors";
-
- boolean goOn = getWorkPage().reportOperationStatus(
- "Maemo SDK Virtual Image installation results", message,
- status, true)
- && !status.matches(IStatus.CANCEL);
-
- return goOn;
- }
-
- protected IStatus doWork() {
-
- getWorkPage().showAndClearLog();
-
- final IStatus[] statuses = { Policy.getCancelStatus(Activator
- .getDefault()) };
- try {
- getContainer().run(true, true, new IRunnableWithProgress() {
-
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
-
- IStatus status = null;
-
- IProgressReporter reporter = getWorkPage().getProgressReporter();
-
- MaemoSDKVMInstaller vmInstaller = new MaemoSDKVMInstaller(installData, reporter);
-
- status = vmInstaller.installVirtualImage(((MaemoSDKVMInstallationWorkPage)getWorkPage()).getTimeout(), getShell(), monitor);
-
- if (status.matches(IStatus.CANCEL))
- status = Activator.createErrorStatus("The Maemo SDK virtual image installation was canceled.", null);
-
- if (status.matches(IStatus.CANCEL) || status.matches(IStatus.ERROR))
- reporter.appendStreamText(status.getMessage(), true);
-
- statuses[0] = status;
- }
-
- });
- } catch (Exception e) {
- Activator.getErrorLogger().logAndShowError(e.getMessage(),
- e.getCause());
- statuses[0] = Activator.createErrorStatus("Maemo SDK virtual image installation failed unexpectedly",
- e);
- }
- return statuses[0];
- }
-
- /**
- * Get the installation data that contains information to install Maemo SDK
- * virtual image.
- *
- * @return the installation data.
- */
- public MaemoSDKVMInstallData getInstallData() {
- return installData;
- }
-
-}
Copied: branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java (from rev 1976, trunk/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java)
===================================================================
--- branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java (rev 0)
+++ branches/work_Andre/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java 2009-08-19 21:23:20 UTC (rev 1978)
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2009 INdT, (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (INdT) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.vm.vmware.ui.wizards;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMInstaller;
+import org.maemo.esbox.internal.vm.vmware.Activator;
+import org.maemo.mica.common.core.Policy;
+import org.maemo.mica.common.core.ui.IProgressReporter;
+import org.maemo.mica.internal.api.common.ui.wizards.WizardWorkProgressPageBase;
+
+/**
+ * The Maemo SDK Virtual Image wizard provides an easy method to install SDK
+ * Virtual Image for pre-installed VMWare Player/Fusion (download, install and
+ * configure latest empty server image for Maemo)
+ *
+ * @author raulherbster
+ *
+ */
+public class NewMaemoSDKVMWizard extends Wizard implements INewWizard {
+
+ private MaemoSDKVMSelectionWizardPage targetPage;
+ private MaemoSDKVMInstallationWorkPage downloadUncompressWorkPage;
+ private MaemoSDKVMConfigurationWizardPage configurationPage;
+ private MaemoSDKVMLicenseWizardPage licensePage;
+ private MaemoSDKVMInstallData installData;
+
+ /**
+ * Constructor
+ */
+ public NewMaemoSDKVMWizard() {
+ initialize();
+ // create an empty install data
+ installData = new MaemoSDKVMInstallData();
+ }
+
+ /**
+ * Initialize main information about this wizard.
+ */
+ private void initialize() {
+ setNeedsProgressMonitor(true);
+ setWindowTitle("Install Maemo SDK Virtual Machine");
+ ImageDescriptor image = Activator.MAEMO_VM_WIZBAN_DESCRIPTOR;
+ setDefaultPageImageDescriptor(image);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ public void addPages() {
+ targetPage = new MaemoSDKVMSelectionWizardPage(this);
+ addPage(targetPage);
+ configurationPage = new MaemoSDKVMConfigurationWizardPage(this);
+ addPage(configurationPage);
+ licensePage = new MaemoSDKVMLicenseWizardPage(this);
+ addPage(licensePage);
+ downloadUncompressWorkPage = new MaemoSDKVMInstallationWorkPage(this);
+ addPage(downloadUncompressWorkPage);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
+ * org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * Get the work page to show information about installation process.
+ *
+ * @return the work page of this wizard.
+ */
+ public WizardWorkProgressPageBase getWorkPage() {
+ return downloadUncompressWorkPage;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ public boolean performFinish() {
+ final IStatus status = doWork();
+
+ final boolean success = (status.isOK() || status.matches(IStatus.INFO));
+
+ String message = success ? "Installation succeeded"
+ : "Installation encountered some errors";
+
+ boolean goOn = getWorkPage().reportOperationStatus(
+ "Maemo SDK Virtual Image installation results", message,
+ status, true)
+ && !status.matches(IStatus.CANCEL);
+
+ return goOn;
+ }
+
+ protected IStatus doWork() {
+
+ getWorkPage().showAndClearLog();
+
+ final IStatus[] statuses = { Policy.getCancelStatus(Activator
+ .getDefault()) };
+ try {
+ getContainer().run(true, true, new IRunnableWithProgress() {
+
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+
+ IStatus status = null;
+
+ IProgressReporter reporter = getWorkPage().getProgressReporter();
+
+ MaemoSDKVMInstaller vmInstaller = new MaemoSDKVMInstaller(installData, reporter);
+
+ status = vmInstaller.installVirtualImage(((MaemoSDKVMInstallationWorkPage)getWorkPage()).getTimeout(), getShell(), monitor);
+
+ if (status.matches(IStatus.CANCEL))
+ status = Activator.createErrorStatus("The Maemo SDK virtual image installation was canceled.", null);
+
+ if (status.matches(IStatus.CANCEL) || status.matches(IStatus.ERROR))
+ reporter.appendStreamText(status.getMessage(), true);
+
+ statuses[0] = status;
+ }
+
+ });
+ } catch (Exception e) {
+ Activator.getErrorLogger().logAndShowError(e.getMessage(),
+ e.getCause());
+ statuses[0] = Activator.createErrorStatus("Maemo SDK virtual image installation failed unexpectedly",
+ e);
+ }
+ return statuses[0];
+ }
+
+ /**
+ * Get the installation data that contains information to install Maemo SDK
+ * virtual image.
+ *
+ * @return the installation data.
+ */
+ public MaemoSDKVMInstallData getInstallData() {
+ return installData;
+ }
+
+}
More information about the Esbox-commits
mailing list