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

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


  public static final IProjectFacet FACET = ProjectFacetsManager
      .getProjectFacet(ID_MODULE_STANDALONE);

  public boolean hasFacet() {
    try {
      IFacetedProject facetedProject = ProjectFacetsManager
          .create(project);
      return facetedProject != null
          && facetedProject.hasProjectFacet(FACET);
    } catch (CoreException e) {
      CloudFoundryPlugin.log(e);
      return false;
    }
  }
View Full Code Here


  }

  public void addFacet(IProgressMonitor monitor) {
    if (canAddFacet()) {
      try {
        IFacetedProject facetedProject = ProjectFacetsManager
            .create(project);
        if (facetedProject == null) {
          facetedProject = ProjectFacetsManager.create(project, true,
              monitor);
        }
        if (facetedProject != null) {
          facetedProject.installProjectFacet(
              FACET.getDefaultVersion(), null, null);
        }
      } catch (CoreException e) {
        CloudFoundryPlugin.log(e);
      }
View Full Code Here

  }

  public void removeFacet() {
    if (hasFacet()) {
      try {
        IFacetedProject facetedProject = ProjectFacetsManager
            .create(project);
        if (facetedProject != null) {
          facetedProject.uninstallProjectFacet(
              FACET.getDefaultVersion(), null, null);
        }
      } catch (CoreException e) {
        CloudFoundryPlugin.log(e);
      }
View Full Code Here

        createOrUpdateFile(Path.fromPortableString("src/META-INF/MANIFEST.MF"), new ByteArrayInputStream(out.toByteArray()));
    }

    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

  }

  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

  private static boolean containsFacet(IProject project, String facetId) {
        // deleted modules can trigger a publish call without having an attached project
        if (project == null) {
            return false;
        }
    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

    @Override
    protected IModule createModule(IProject project) {

        try {
            IFacetedProject facetedProject = ProjectFacetsManager.create(project);
            if (facetedProject == null) {
                return null;
            }
            for (IProjectFacetVersion facet : facetedProject.getProjectFacets()) {
                if (facet.getProjectFacet().getId().equals(SLING_BUNDLE_FACET_ID)) {
                    return createModule(project.getName(), project.getName(), SLING_BUNDLE_FACET_ID, "1.0", project);
                }
            }
        } catch (CoreException ce) {
View Full Code Here

    @Override
    protected IModule createModule(IProject project) {

        try {
            IFacetedProject facetedProject = ProjectFacetsManager.create(project);
            if (facetedProject == null) {
                return null;
            }
            for (IProjectFacetVersion facet : facetedProject.getProjectFacets()) {
                if (facet.getProjectFacet().getId().equals(SLING_CONTENT_FACET_ID)) {
                    return createModule(project.getName(), project.getName(), SLING_CONTENT_FACET_ID, "1.0", project);
                }
            }
        } catch (CoreException ce) {
View Full Code Here

   *            org.eclipse.core.resources.IProject
   * @return boolean
   */
  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

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.