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

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


     */
    private String getJSFVersion(final IProject project)
    {
        try
        {
            final IFacetedProject facetedProject = ProjectFacetsManager.create(project);
            final Set facets = facetedProject.getProjectFacets();

            for (final Iterator it = facets.iterator(); it.hasNext();)
            {
                final IProjectFacetVersion  facetVersion =
                    (IProjectFacetVersion) it.next();
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

            // (I.E. the JST Web facet is installed)
            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;
                    }
                }
            }
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

    final Set projects = ProjectFacetsManager.getFacetedProjects(EARFacetUtils.EAR_FACET);
    final Iterator it = projects.iterator();
    final File root = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
    while (it.hasNext())
    {
      final IFacetedProject fp = (IFacetedProject) it.next();
      final IProject p = fp.getProject();

      final String ear = new File(root, p.getName() + ".ear").getAbsolutePath();

      SysOutProgressMonitor.out.println("Exporting project '" + p.getName() + "' to: " + ear);
View Full Code Here

    final Set projects = ProjectFacetsManager.getFacetedProjects(WebFacetUtils.WEB_FACET);
    final Iterator it = projects.iterator();
    final File root = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
    while (it.hasNext())
    {
      final IFacetedProject fp = (IFacetedProject) it.next();
      final IProject p = fp.getProject();

      final String war = new File(root, p.getName() + ".war").getAbsolutePath();

      SysOutProgressMonitor.out.println("Exporting project '" + p.getName() + "' to: " + war);
View Full Code Here

     
      if (monitor == null) {
        monitor = new NullProgressMonitor();
      }
     
      final IFacetedProject facetedProject = ProjectFacetsManager.create(project, true, monitor);
     
      if (facetedProject == null) {
        Logger.log(Logger.ERROR, "Unable to create faceted composer project.");
        return null;
      }
     
     
     
      IProjectFacet coreFacet = ProjectFacetsManager.getProjectFacet(PHPFacetsConstants.PHP_CORE_COMPONENT);
      IProjectFacet composerFacet = ProjectFacetsManager.getProjectFacet(ComposerFacetConstants.COMPOSER_COMPONENT);
     
      // install the fixed facets
     
      if (!facetedProject.hasProjectFacet(coreFacet)) {
        facetedProject.installProjectFacet(coreFacet.getDefaultVersion(), null, monitor);
        facetedProject.installProjectFacet(PHPFacets.convertToFacetVersion(version), null, monitor);
      }
     
      if (!facetedProject.hasProjectFacet(composerFacet)) {
        facetedProject.installProjectFacet(composerFacet.getVersion(ComposerFacetConstants.COMPOSER_COMPONENT_VERSION_1), composerFacet, monitor);
      }

      return facetedProject;
     
    } catch (CoreException ex) {
View Full Code Here

    try {
      if (monitor == null) {
        monitor = new NullProgressMonitor();
      }
     
      final IFacetedProject facetedProject = ProjectFacetsManager.create(project, true, monitor);
     
      IProjectFacet composerFacet = ProjectFacetsManager.getProjectFacet(ComposerFacetConstants.COMPOSER_COMPONENT);
     
      facetedProject.uninstallProjectFacet(composerFacet.getVersion(ComposerFacetConstants.COMPOSER_COMPONENT_VERSION_1), composerFacet, monitor);
    } catch (CoreException ex) {
      Logger.logException(ex.getMessage(), ex);
    }
  }
View Full Code Here

    }

    IProject[] ears = J2EEProjectUtilities.getReferencingEARProjects(project);
    IProjectFacet facet = ProjectFacetsManager.getProjectFacet(FACET_ID);
    for (int i = 0; i < ears.length; i++) {
      IFacetedProject fp = ProjectFacetsManager.create(ears[i]);
      if (!fp.hasProjectFacet(facet)) {
        try {
          createDeploymentPlanCreationOp(ears[i], config).execute(monitor, null);
        } catch (ExecutionException e) {
          e.printStackTrace();
        }
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.