org.symbian.tools.mtw.ui/src/org/symbian/tools/tmw/ui/project/IProjectTemplateContext.java
--- a/org.symbian.tools.mtw.ui/src/org/symbian/tools/tmw/ui/project/IProjectTemplateContext.java Fri Aug 13 17:26:00 2010 -0700
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/tmw/ui/project/IProjectTemplateContext.java Mon Aug 16 16:23:25 2010 -0700
@@ -20,6 +20,7 @@
import java.io.InputStream;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -33,10 +34,43 @@
* @author Eugene Ostroukhov (eugeneo@symbian.org)
*/
public interface IProjectTemplateContext extends IProjectSetupAction {
+ /**
+ * @return runtime that the project targets
+ */
IMobileWebRuntime getRuntime();
+
+ /**
+ * @param parameter name of the parameter
+ * @return parameter value. In most cases parameters will be string values
+ * but template developers can use any types
+ */
Object getParameter(String parameter);
+
+ /**
+ * @return array of parameter names
+ */
String[] getParameterNames();
+
void putParameter(String key, Object value);
- void addFile(IProject project, IPath name, InputStream contents, IProgressMonitor monitor)
- throws CoreException;
+
+ /**
+ * Allows the framework to reduce dependance on exact project layout. I.e.
+ * some IDEs may want to introduce separation of the web resources and
+ * JavaScript source files.
+ *
+ * @param project project to add file to
+ * @param name file path relative to application root
+ * @param contents stream with file contents
+ * @param monitor progress monitor
+ * @throws CoreException
+ */
+ void addFile(IProject project, IPath name, InputStream contents, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Allows binding to parameter value from UI.
+ *
+ * @param name parameter value
+ * @return observable that may be used to bind value
+ */
+ IObservableValue getParameterObservable(String name);
}