[Esbox-commits] r1543 - branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/nokiabin
eswartz at garage.maemo.org
eswartz at garage.maemo.org
Wed May 6 18:35:40 EEST 2009
Author: eswartz
Date: 2009-05-06 18:35:39 +0300 (Wed, 06 May 2009)
New Revision: 1543
Modified:
branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/nokiabin/SDKTargetSelectionPage.java
Log:
Fix NPE in not getting the ISDK from the wizard page (the user doesn't have to check the SDK node)
Modified: branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/nokiabin/SDKTargetSelectionPage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/nokiabin/SDKTargetSelectionPage.java 2009-05-06 14:50:21 UTC (rev 1542)
+++ branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/nokiabin/SDKTargetSelectionPage.java 2009-05-06 15:35:39 UTC (rev 1543)
@@ -22,8 +22,6 @@
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
@@ -35,7 +33,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.maemo.esbox.internal.scratchbox.sb1.Activator;
-import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
import org.maemo.mica.common.core.sdk.ISDK;
import org.maemo.mica.common.core.sdk.ISDKTarget;
import org.maemo.mica.common.project.core.IBuildTargetFilter;
@@ -233,22 +230,10 @@
* @return
*/
public ISDK getScratchboxSDK() {
- final ISDK[] sdk = new ISDK[1];
-
- Activator.getDefault().getWorkbench().getDisplay().syncExec(
- new Runnable() {
- public void run() {
- for (TreePath path : ((TreeSelection)targetTree.getSelection()).getPaths()) {
- Object obj = path.getFirstSegment();
- if (ISDK.class.isAssignableFrom(obj
- .getClass())) {
- sdk[0] = (IScratchbox1SDK) obj;
- }
- }
-
- }
- });
- return sdk[0];
+ for (ISDKTarget target : getTargets()) {
+ return target.getSDK();
+ }
+ return null;
}
/**
More information about the Esbox-commits
mailing list