org.symbian.tools.mtw.ui/src/org/symbian/tools/tmw/ui/project/IProjectTemplateContext.java
changeset 465 87920e15f8eb
parent 463 aea4c83725d8
child 466 129c94e78375
equal deleted inserted replaced
464:0b02f3d6f52c 465:87920e15f8eb
    18  */
    18  */
    19 package org.symbian.tools.tmw.ui.project;
    19 package org.symbian.tools.tmw.ui.project;
    20 
    20 
    21 import java.io.InputStream;
    21 import java.io.InputStream;
    22 
    22 
       
    23 import org.eclipse.core.databinding.observable.value.IObservableValue;
    23 import org.eclipse.core.resources.IProject;
    24 import org.eclipse.core.resources.IProject;
    24 import org.eclipse.core.runtime.CoreException;
    25 import org.eclipse.core.runtime.CoreException;
    25 import org.eclipse.core.runtime.IPath;
    26 import org.eclipse.core.runtime.IPath;
    26 import org.eclipse.core.runtime.IProgressMonitor;
    27 import org.eclipse.core.runtime.IProgressMonitor;
    27 import org.symbian.tools.tmw.core.projects.IProjectSetupAction;
    28 import org.symbian.tools.tmw.core.projects.IProjectSetupAction;
    31  * Provides template values.
    32  * Provides template values.
    32  * 
    33  * 
    33  * @author Eugene Ostroukhov (eugeneo@symbian.org)
    34  * @author Eugene Ostroukhov (eugeneo@symbian.org)
    34  */
    35  */
    35 public interface IProjectTemplateContext extends IProjectSetupAction {
    36 public interface IProjectTemplateContext extends IProjectSetupAction {
       
    37     /**
       
    38      * @return runtime that the project targets
       
    39      */
    36     IMobileWebRuntime getRuntime();
    40     IMobileWebRuntime getRuntime();
       
    41 
       
    42     /**
       
    43      * @param parameter name of the parameter
       
    44      * @return parameter value. In most cases parameters will be string values 
       
    45      * but template developers can use any types
       
    46      */
    37     Object getParameter(String parameter);
    47     Object getParameter(String parameter);
       
    48 
       
    49     /**
       
    50      * @return array of parameter names
       
    51      */
    38     String[] getParameterNames();
    52     String[] getParameterNames();
       
    53 
    39     void putParameter(String key, Object value);
    54     void putParameter(String key, Object value);
    40     void addFile(IProject project, IPath name, InputStream contents, IProgressMonitor monitor)
    55 
    41             throws CoreException;
    56     /**
       
    57      * Allows the framework to reduce dependance on exact project layout. I.e. 
       
    58      * some IDEs may want to introduce separation of the web resources and 
       
    59      * JavaScript source files.
       
    60      * 
       
    61      * @param project project to add file to
       
    62      * @param name file path relative to application root
       
    63      * @param contents stream with file contents
       
    64      * @param monitor progress monitor
       
    65      * @throws CoreException
       
    66      */
       
    67     void addFile(IProject project, IPath name, InputStream contents, IProgressMonitor monitor) throws CoreException;
       
    68 
       
    69     /**
       
    70      * Allows binding to parameter value from UI.
       
    71      * 
       
    72      * @param name parameter value
       
    73      * @return observable that may be used to bind value
       
    74      */
       
    75     IObservableValue getParameterObservable(String name);
    42 }
    76 }