org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/project/WRTIDEProjectProvider.java
changeset 455 5da55957c779
child 461 7a8f9fa8d278
equal deleted inserted replaced
454:38d6944cff88 455:5da55957c779
       
     1 /**
       
     2  * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the License "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Symbian Foundation - initial contribution.
       
    11  * Contributors:
       
    12  * Description:
       
    13  * Overview:
       
    14  * Details:
       
    15  * Platforms/Drives/Compatibility:
       
    16  * Assumptions/Requirement/Pre-requisites:
       
    17  * Failures and causes:
       
    18  */
       
    19 package org.symbian.tools.wrttools.core.project;
       
    20 
       
    21 import java.util.Map;
       
    22 import java.util.WeakHashMap;
       
    23 
       
    24 import org.eclipse.core.resources.IProject;
       
    25 import org.symbian.tools.mtw.core.projects.IMTWProject;
       
    26 import org.symbian.tools.mtw.core.projects.IMTWProjectProvider;
       
    27 import org.symbian.tools.wrttools.WRTProject;
       
    28 import org.symbian.tools.wrttools.util.ProjectUtils;
       
    29 
       
    30 public class WRTIDEProjectProvider implements IMTWProjectProvider {
       
    31     private final Map<IProject, IMTWProject> projects = new WeakHashMap<IProject, IMTWProject>();
       
    32 
       
    33     public IMTWProject create(IProject project) {
       
    34         IMTWProject p = projects.get(project);
       
    35         if (p == null) {
       
    36             p = new WRTProject(project);
       
    37             projects.put(project, p);
       
    38         }
       
    39         return p;
       
    40     }
       
    41 
       
    42     public boolean isSupportedProject(IProject project) {
       
    43         return ProjectUtils.hasWrtNature(project);
       
    44     }
       
    45 
       
    46 }