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

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


    }

    public void installFacet(String facetId, String facetVersion) throws CoreException {

        IFacetedProject facetedProject = ProjectFacetsManager.create(project);
        IProjectFacet slingBundleFacet = ProjectFacetsManager.getProjectFacet(facetId);
        IProjectFacetVersion projectFacetVersion = slingBundleFacet.getVersion(facetVersion);

        facetedProject.installProjectFacet(projectFacetVersion, null, new NullProgressMonitor());

    }
View Full Code Here


public class ConfigurationHelper {

  public static void convertToContentPackageProject(IProject aContentProject,
      IProgressMonitor monitor, IPath jcr_root) throws CoreException {
    IProjectFacet slingContentFacet = ProjectFacetsManager.getProjectFacet("sling.content");
    IFacetedProject fp2 = ProjectFacetsManager.create(aContentProject, true, null);
    fp2.installProjectFacet(slingContentFacet.getLatestVersion(), null, null);
   
    ProjectUtil.setSyncDirectoryPath(aContentProject, jcr_root);
    aContentProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
  }
View Full Code Here

    aContentProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
  }

  public static void convertToBundleProject(IProject aBundleProject)
      throws CoreException {
    IProjectFacet slingContentFacet = ProjectFacetsManager.getProjectFacet("sling.bundle");
    IFacetedProject fp2 = ProjectFacetsManager.create(aBundleProject, true, null);
    fp2.installProjectFacet(slingContentFacet.getLatestVersion(), null, null);
    aBundleProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
  }
View Full Code Here

        }
    IFacetedProject facetedProject = (IFacetedProject) project.getAdapter(IFacetedProject.class);
    if (facetedProject==null ) {
      return false;
    }
    IProjectFacet facet = ProjectFacetsManager.getProjectFacet(facetId);
    return facetedProject.hasProjectFacet(facet);
  }
View Full Code Here

  protected boolean isValidModule(IProject project) {
    try {
      IFacetedProject facetedProject = ProjectFacetsManager.create(project);
      if (facetedProject == null)
        return false;
      IProjectFacet webFacet = ProjectFacetsManager.getProjectFacet(PHPFacetsConstants.PHP_CORE_COMPONENT);
      return facetedProject.hasProjectFacet(webFacet);
    } catch (Exception e) {
      return false;
    }
  }
View Full Code Here

  @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

  @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

          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

    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

TOP

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

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.