Package org.eclipse.wst.common.project.facet.core

Examples of org.eclipse.wst.common.project.facet.core.IFacetedProject


    return this.storage.getDefaultWebFolder();
  }

  @Override
  public boolean hasWebFacet() {
    final IFacetedProject faceted = this.getFacetedProject();
    if (faceted != null) {
      final IProjectFacet webFacet = ProjectFacetsManager
          .getProjectFacet(FACET_ID);
      return faceted.hasProjectFacet(webFacet);
    }
    return false;
  }
View Full Code Here


    return false;
  }

  @Override
  public void activateWebFacet() throws CoreException {
    final IFacetedProject faceted = this.getFacetedProject();
    if (faceted != null) {
      final IProjectFacet webFacet = ProjectFacetsManager
          .getProjectFacet(FACET_ID);
      if (faceted.hasProjectFacet(webFacet)) {
        return;
      }
      final IProjectFacetVersion version = webFacet.getVersion(FACET_VERSION_1_0);
      faceted.installProjectFacet(version, null, new NullProgressMonitor());
      try {
        this.storage = new SettingsPhpProjectStorage(project);
      } catch (BackingStoreException e) {
        throw new CoreException(new Status(IStatus.ERROR, PEXServerPlugin.PLUGIN_ID, "Error reading preferences", e)); //$NON-NLS-1$
      }
View Full Code Here

      if (receiver instanceof IProject) {
        project = (IProject) receiver;
      }
     
      if (project != null) {
        IFacetedProject faceted;
        try {
          faceted = ProjectFacetsManager.create(project);
        } catch (CoreException e) {
          return false;
        }
        if (faceted != null) {
          final IProjectFacet facet = ProjectFacetsManager.getProjectFacet(value);
          return faceted.hasProjectFacet(facet);
        }
      }
    }
    return false;
  }
View Full Code Here

 
  public static boolean isClickProject(IProject project){
    IVirtualComponent component = ComponentCore.createComponent(project);
    try {
      if(WebArtifactEdit.isValidWebModule(component)){
        IFacetedProject facetedProject = ProjectFacetsManager.create(project);
        Object facets[] = facetedProject.getProjectFacets().toArray();
        for(int i=0;i<facets.length;i++){
          IProjectFacetVersion facet = (IProjectFacetVersion)facets[i];
          if(facet.getProjectFacet().getId().equals("click")){
            return true;
          }
View Full Code Here

    // Add the ATF nature as well.
    ATFNature.addNature(project, new NullProgressMonitor());

    // Installs the static web project facet.
    IFacetedProject faceted = ProjectFacetsManager.create(project);
    IFacetedProjectTemplate tpl = ProjectFacetsManager
        .getTemplate("template.wst.web");
    Set<IProjectFacet> facets = tpl.getFixedProjectFacets();

    // There should be only one fixed facet. If there's more, this code will
    // need to be reviewed.
    Assert.assertEquals(1, facets.size());
    IProjectFacet facet = facets.iterator().next();

    // Creates the data model for configuring the facet.
    IDataModel config = DataModelFactory
        .createDataModel(new SimpleWebFacetProjectCreationDataModelProvider());

    config = initConfig(config, facet.getDefaultVersion(),
        IFacetedProject.Action.Type.INSTALL, projectName);

    faceted.installProjectFacet(facet.getDefaultVersion(), config,
        new NullProgressMonitor());

    return project;
  }
View Full Code Here

{
    @Override
    public IProjectFacetVersion getProjectFacetVersion()
    {
        final IProjectFacet tapestryFacet = ProjectFacetsManager.getProjectFacet( "jst.tapestry" ); //$NON-NLS-1$
        final IFacetedProject fproj = getFacetedProject();
        return fproj.getInstalledVersion( tapestryFacet );
    }
View Full Code Here

    {
        //check for null or inaccessible project
        if (project != null && project.isAccessible()) {
            //check for JSF facet on project
            try {
                IFacetedProject facetedProject = ProjectFacetsManager.create(project);
                if (facetedProject != null) {
                    Set projectFacets = facetedProject.getProjectFacets();
                    Iterator itProjectFacets = projectFacets.iterator();
                    while (itProjectFacets.hasNext()) {
                        IProjectFacetVersion projectFacetVersion = (IProjectFacetVersion)itProjectFacets.next();
                        if (IJSFCoreConstants.JSF_CORE_FACET_ID.equals(projectFacetVersion.getProjectFacet().getId()))
                        {
View Full Code Here

      return FacetModuleCoreSupport.DEFAULT_SERVLET_VERSION;

    // In the absence of any facet information, assume the highest level
    float version = FacetModuleCoreSupport.DEFAULT_SERVLET_VERSION;
    try {
      IFacetedProject faceted = ProjectFacetsManager.create(project);
      if (faceted != null && ProjectFacetsManager.isProjectFacetDefined(JST_WEB_MODULE)) {
        IProjectFacet webModuleFacet = ProjectFacetsManager.getProjectFacet(JST_WEB_MODULE);
        if (faceted.hasProjectFacet(webModuleFacet)) {
          version = Float.parseFloat(faceted.getInstalledVersion(webModuleFacet).getVersionString());
        }
      }
    }
    catch (NumberFormatException e) {
      Logger.logException(e);
View Full Code Here

    if (project == null)
      return false;
   
    try {
      if (ProjectFacetsManager.isProjectFacetDefined(JST_WEB_MODULE)) {
        IFacetedProject faceted = ProjectFacetsManager.create(project);
        IProjectFacet webModuleFacet = ProjectFacetsManager.getProjectFacet(JST_WEB_MODULE);
        if (faceted != null && faceted.hasProjectFacet(webModuleFacet)) {
          return true;
        }
      }
    }
    catch (CoreException e) {
View Full Code Here

    {
        //check for null or inaccessible project
        if (project != null && project.isAccessible()) {
            //check for JSF facet on project
            try {
                IFacetedProject facetedProject = ProjectFacetsManager.create(project);
                if (facetedProject != null) {
                    Set projectFacets = facetedProject.getProjectFacets();
                    Iterator itProjectFacets = projectFacets.iterator();
                    while (itProjectFacets.hasNext()) {
                        IProjectFacetVersion projectFacetVersion = (IProjectFacetVersion)itProjectFacets.next();
                        if (ITapestryCoreConstants.Tapestry_CORE_FACET_ID.equals(projectFacetVersion.getProjectFacet().getId()))
                        {
View Full Code Here

TOP

Related Classes of org.eclipse.wst.common.project.facet.core.IFacetedProject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.