33 import org.eclipse.core.runtime.CoreException; |
33 import org.eclipse.core.runtime.CoreException; |
34 import org.eclipse.core.runtime.IPath; |
34 import org.eclipse.core.runtime.IPath; |
35 import org.eclipse.core.runtime.IProgressMonitor; |
35 import org.eclipse.core.runtime.IProgressMonitor; |
36 import org.eclipse.core.runtime.NullProgressMonitor; |
36 import org.eclipse.core.runtime.NullProgressMonitor; |
37 import org.eclipse.core.runtime.Path; |
37 import org.eclipse.core.runtime.Path; |
38 import org.eclipse.jface.preference.IPreferenceStore; |
|
39 import org.symbian.tools.mtw.core.MTWCore; |
38 import org.symbian.tools.mtw.core.MTWCore; |
40 import org.symbian.tools.mtw.core.projects.IMTWProject; |
39 import org.symbian.tools.mtw.core.projects.IMTWProject; |
41 import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime; |
40 import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime; |
42 import org.symbian.tools.wrttools.wizards.deploy.DeploymentTarget; |
|
43 |
41 |
44 public class WRTProject implements IMTWProject { |
42 public class WRTProject implements IMTWProject { |
45 private static final String PROP_DEPLOYMENT_TARGET_NAME = "deployment.target.name"; |
|
46 |
|
47 private static final String PROP_DEPLOYMENT_TARGET_TYPE = "deployment.target.type"; |
|
48 private static final String PROP_PREFERED_SCREEN = "preferred.screen.size"; |
43 private static final String PROP_PREFERED_SCREEN = "preferred.screen.size"; |
49 private static final IPath PROPERTIES_FILE = new Path(".settings").append(Activator.PLUGIN_ID + ".properties"); |
44 private static final IPath PROPERTIES_FILE = new Path(".settings").append(Activator.PLUGIN_ID + ".properties"); |
50 public static final String WRT11_RUNTIME = "org.symbian.wrt11"; |
45 public static final String WRT11_RUNTIME = "org.symbian.wrt11"; |
51 private final IProject project; |
46 private final IProject project; |
52 |
47 |
125 } catch (CoreException e) { |
120 } catch (CoreException e) { |
126 Activator.log(e); |
121 Activator.log(e); |
127 } |
122 } |
128 } |
123 } |
129 |
124 |
130 public void setDeploymentTarget(DeploymentTarget target) { |
|
131 Properties props = getProps(); |
|
132 props.setProperty(PROP_DEPLOYMENT_TARGET_NAME, target.getName()); |
|
133 props.setProperty(PROP_DEPLOYMENT_TARGET_TYPE, target.getType()); |
|
134 IPreferenceStore store = Activator.getDefault().getPreferenceStore(); |
|
135 store.setValue(PROP_DEPLOYMENT_TARGET_NAME, target.getName()); |
|
136 store.setValue(PROP_DEPLOYMENT_TARGET_TYPE, target.getType()); |
|
137 saveProperties(props); |
|
138 } |
|
139 |
|
140 public void setPreferredScreenSize(String screenSize) { |
125 public void setPreferredScreenSize(String screenSize) { |
141 Properties props = getProps(); |
126 Properties props = getProps(); |
142 if (screenSize != null) { |
127 if (screenSize != null) { |
143 props.put(PROP_PREFERED_SCREEN, screenSize); |
128 props.put(PROP_PREFERED_SCREEN, screenSize); |
144 } else { |
129 } else { |