org.symbian.tools.mtw.ui/src/org/symbian/tools/tmw/ui/project/IProjectTemplate.java
author Eugene Ostroukhov <eugeneo@symbian.org>
Fri, 13 Aug 2010 17:26:00 -0700
changeset 464 0b02f3d6f52c
parent 463 aea4c83725d8
child 465 87920e15f8eb
permissions -rw-r--r--
Project template work-in-progress
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
463
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     1
/**
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     2
 * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     3
 * All rights reserved.
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     8
 *
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     9
 * Initial Contributors:
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    10
 * Symbian Foundation - initial contribution.
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    11
 * Contributors:
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    12
 * Description:
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    13
 * Overview:
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    14
 * Details:
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    15
 * Platforms/Drives/Compatibility:
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    16
 * Assumptions/Requirement/Pre-requisites:
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    17
 * Failures and causes:
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    18
 */
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    19
package org.symbian.tools.tmw.ui.project;
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    20
464
0b02f3d6f52c Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 463
diff changeset
    21
import java.util.Map;
0b02f3d6f52c Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 463
diff changeset
    22
463
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    23
import org.eclipse.core.resources.IProject;
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    24
import org.eclipse.core.runtime.IProgressMonitor;
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    25
import org.eclipse.swt.graphics.Image;
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    26
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    27
import org.symbian.tools.tmw.core.runtimes.IMobileWebRuntime;
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    28
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    29
/**
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    30
 * This interface will allow extending new mobile web application wizard
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    31
 * with "smart" templates that have complex logic.
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    32
 * 
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    33
 * @author Eugene Ostroukhov (eugeneo@symbian.org)
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    34
 */
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    35
public interface IProjectTemplate {
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    36
    /**
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    37
     * Attributes that are common for different templates for different 
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    38
     * runtimes. They are included here to improve compatibility and reuse.
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    39
     */
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    40
    public interface CommonKeys {
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    41
        String application_id = "widgetName";
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    42
        String application_name = "widgetId";
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    43
        String project_name = "projectName";
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    44
        String main_html = "mainHtml";
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    45
        String main_css = "mainCss";
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    46
        String main_js = "mainJs";
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    47
    }
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    48
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    49
    /**
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    50
     * @return template "weight" that determines how high the template will 
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    51
     * be in a templates list. This is purely for visualization as IDE vendors
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    52
     * might want more basic templates higher in the list to improve the 
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    53
     * learning curve.
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    54
     */
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    55
    int getWeight();
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    56
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    57
    /**
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    58
     * @return icon that will be used in the UI to represent the template
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    59
     */
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    60
    Image getIcon();
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    61
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    62
    /**
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    63
     * @return template name. It is only used in the UI and is not stored in
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    64
     * project metadata.
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    65
     */
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    66
    String getName();
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    67
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    68
    /**
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    69
     * @return template description that will be used in UI
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    70
     */
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    71
    String getDescription();
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    72
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    73
    /**
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    74
     * @return array of the supported runtimes
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    75
     */
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    76
    IMobileWebRuntime[] getSupportedRuntimes();
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    77
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    78
    /**
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    79
     * @return facets that should be enable so this project template works
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    80
     */
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    81
    IProjectFacetVersion[] getRequiredFacets();
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    82
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    83
    /**
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    84
     * Initializes project with template contents
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    85
     */
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    86
    void init(IProject project, IProjectTemplateContext context, IProgressMonitor monitor);
464
0b02f3d6f52c Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 463
diff changeset
    87
0b02f3d6f52c Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 463
diff changeset
    88
    /**
0b02f3d6f52c Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 463
diff changeset
    89
     * Returns default template parameter values
0b02f3d6f52c Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 463
diff changeset
    90
     */
0b02f3d6f52c Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 463
diff changeset
    91
    Map<String, String> getDefaultParameterValues();
463
aea4c83725d8 Project template work-in-progress
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    92
}