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

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


        IJAXBUtilsProvider provider = null;
        if (plan != null) {
        IProject project = plan.getProject();
        try {
          IFacetedProject fp = ProjectFacetsManager.create(project);
          if (fp == null) return null;
          IRuntime runtime = FacetUtil.getRuntime(fp.getPrimaryRuntime());
          if (runtime == null) return null;
          String version = runtime.getRuntimeType().getVersion();
          provider = (IJAXBUtilsProvider) providers.get(version);
        } catch (CoreException e) {
                    Trace.tracePoint("CoreException", "JAXBUtils.getProvider");
View Full Code Here


            if(fix) {
                IProject project = fei.getFile().getProject();
                IDataModel model = DataModelFactory.createDataModel(new ImportDeploymentPlanDataModelProvider());
                model.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, project.getName());
                try {
                    IFacetedProject facetedProject = ProjectFacetsManager.create(project);
                    model.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, facetedProject.getPrimaryRuntime());
                    IDataModelOperation op = new ImportDeploymentPlanOperation(model);
                    op.execute(new NullProgressMonitor(), null);
                } catch (Exception e) {
                   throw new PartInitException(e.getMessage());
                }
View Full Code Here

    if (currentLoader == null) {
      IEditorInput input = getEditorInput();
      if (input instanceof IFileEditorInput) {
        IProject project = ((IFileEditorInput) input).getFile().getProject();
        try {
          IFacetedProject fp = ProjectFacetsManager.create(project);
          if (fp == null) return null;
          IRuntime runtime = FacetUtil.getRuntime(fp.getPrimaryRuntime());
          if (runtime == null) return null;
          String version = runtime.getRuntimeType().getVersion();
          currentLoader = (IGeronimoFormContentLoader) loaders.get(version);
        } catch (CoreException e) {
                    Trace.tracePoint("CoreException", "SharedDeploymentPlanEditor.getLoader");
View Full Code Here

    if (isFacetedProject(project)) {
      try {
        final IProjectFacetVersion facetedVersion = convertToFacetVersion(version);
        final IProjectFacet phpFacet = ProjectFacetsManager
            .getProjectFacet(PHPFacetsConstants.PHP_COMPONENT);
        final IFacetedProject faceted = ProjectFacetsManager
            .create(project);
        if (!facetedVersion.equals(faceted
            .getInstalledVersion(phpFacet))) {
          final Set<IFacetedProject.Action> actions = new HashSet<IFacetedProject.Action>();
          actions.add(new IFacetedProject.Action(
              IFacetedProject.Action.Type.VERSION_CHANGE,
              facetedVersion, null));
          faceted.modify(actions, new NullProgressMonitor());
        }
      } catch (CoreException ex) {
        return new Status(IStatus.ERROR, PHPCorePlugin.ID,
            Messages.PHPFacets_SettingVersionFailed, ex);
      } catch (IllegalArgumentException ex) {
View Full Code Here

   *            the project
   * @return true if the php core facet is installed.
   */
  public static boolean isFacetedProject(IProject project) {
    try {
      final IFacetedProject faceted = ProjectFacetsManager
          .create(project);
      if (faceted != null) {
        IProjectFacet coreFacet = ProjectFacetsManager
            .getProjectFacet(PHPFacetsConstants.PHP_CORE_COMPONENT);
        IProjectFacet phpFacet = ProjectFacetsManager
            .getProjectFacet(PHPFacetsConstants.PHP_COMPONENT);
        if (faceted.hasProjectFacet(coreFacet)
            && faceted.hasProjectFacet(phpFacet)) {
          return true;
        }
      }
    } catch (CoreException ex) {
      // silently ignore
View Full Code Here

   *            the php faceted project
   * @return the php version
   */
  public static PHPVersion getPhpVersionFromFacets(IProject project) {
    try {
      final IFacetedProject faceted = ProjectFacetsManager
          .create(project);
      if (faceted != null) {
        IProjectFacet phpFacet = ProjectFacetsManager
            .getProjectFacet(PHPFacetsConstants.PHP_COMPONENT);
        final IProjectFacetVersion version = faceted
            .getInstalledVersion(phpFacet);
        if (PHPFacetsConstants.PHP_COMPONENT_VERSION_4.equals(version
            .getVersionString())) {
          return PHPVersion.PHP4;
        }
View Full Code Here

   * @throws CoreException
   */
  public static void createFacetedProject(IProject project,
      PHPVersion phpVersion, IProgressMonitor monitor)
      throws CoreException {
    final IFacetedProject facetedProject = ProjectFacetsManager.create(
        project, true, monitor);

    // set the fixed facets (they will not be removable by the user)
    // the php.component facet will be set to the correct version
    // programmatically
    final Set<IProjectFacet> fixedFacets = new HashSet<IProjectFacet>();
    IProjectFacet coreFacet = ProjectFacetsManager
        .getProjectFacet(PHPFacetsConstants.PHP_CORE_COMPONENT);
    fixedFacets.add(coreFacet);
    IProjectFacet phpFacet = ProjectFacetsManager
        .getProjectFacet(PHPFacetsConstants.PHP_COMPONENT);
    fixedFacets.add(phpFacet);
    facetedProject.setFixedProjectFacets(fixedFacets);

    // install the fixed facets
    facetedProject.installProjectFacet(coreFacet.getDefaultVersion(), null,
        monitor);
    facetedProject.installProjectFacet(convertToFacetVersion(phpVersion),
        null, monitor);
  }
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

    }
  
    IProject project = mavenProjectFacade.getProject();
    //If no application-client.xml found, don't change existing facet version
    try {
        IFacetedProject fProject = ProjectFacetsManager.create(project);
        if (fProject != null && fProject.hasProjectFacet(IJ2EEFacetConstants.APPLICATION_CLIENT_FACET)) {
          return fProject.getProjectFacetVersion(IJ2EEFacetConstants.APPLICATION_CLIENT_FACET);
        }
    } catch (Exception e) {
        LOG.warn(NLS.bind(Messages.Error_Reading_Project_Facet, project.getName()), e);
    }     
View Full Code Here

   
    if (!isConfigurationEnabled(mavenProjectFacade, monitor)) {
      return;
    }
   
      final IFacetedProject fproj = ProjectFacetsManager.create(project);
    if (fproj != null) {
      if (fproj.hasProjectFacet(JSF_FACET)) {
        //everything already installed.
        //Since there's no support for version update -yet- we stop here
        return;
      }
     
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.