Package org.jboss.errai.forge.config

Examples of org.jboss.errai.forge.config.ProjectConfig


  protected void performOperation(Project project, Feature feature) throws Exception {
    try {
      facetFactory.install(project, feature.getFeatureClass());

      final ProjectConfig projectConfig = project.getFacet(ProjectConfig.class);
      SerializableSet installed = projectConfig.getProjectProperty(ProjectProperty.INSTALLED_FEATURES,
              SerializableSet.class);
      if (installed == null)
        installed = new SerializableSet();

      installed.add(feature.getShortName());

      projectConfig.setProjectProperty(ProjectProperty.INSTALLED_FEATURES, installed);
    }
    catch (Exception e) {
      throw new Exception("Could not install " + feature.getLongName(), e);
    }
  }
View Full Code Here


    builder.add(logicalModuleName);
  }

  @Override
  public Result execute(UIExecutionContext context) throws Exception {
    final ProjectConfig projectConfig = holder.getProject().getFacet(ProjectConfig.class);
    projectConfig.setProjectProperty(ProjectProperty.MODULE_LOGICAL, logicalModuleName.getValue());
    projectConfig.setProjectProperty(ProjectProperty.MODULE_FILE,
            ModuleSelect.moduleLogicalNameToFile(logicalModuleName.getValue(), holder.getProject()));

    return Results.success();
  }
View Full Code Here

  }

  @Override
  public Result execute(UIExecutionContext context) throws Exception {
    if (!isCreateNew(moduleSelect.getValue())) {
      final ProjectConfig projectConfig = holder.getProject().getFacet(ProjectConfig.class);
      projectConfig.setProjectProperty(ProjectProperty.MODULE_LOGICAL, moduleSelect.getValue());
      projectConfig.setProjectProperty(ProjectProperty.MODULE_FILE,
              moduleLogicalNameToFile(moduleSelect.getValue(), holder.getProject()));
    }

    return Results.success();
  }
View Full Code Here

    builder.add(moduleName);
  }

  @Override
  public Result execute(UIExecutionContext context) throws Exception {
    final ProjectConfig projectConfig = holder.getProject().getFacet(ProjectConfig.class);
    final String logicalName = projectConfig.getProjectProperty(ProjectProperty.MODULE_LOGICAL, String.class);

    String newName = moduleName.getValue();
    if (newName == null || newName.equals("")) {
      newName = logicalName;
    }
    projectConfig.setProjectProperty(ProjectProperty.MODULE_NAME, newName);

    factory.install(holder.getProject(), CoreFacet.class);
    if (!newName.equals(logicalName))
      holder.getProject().getFacet(ModuleCoreFacet.class).setModuleName(newName);
View Full Code Here

    builder.add(versionSelect);
  }

  @Override
  public Result execute(UIExecutionContext context) throws Exception {
    final ProjectConfig projectConfig = holder.getProject().getFacet(ProjectConfig.class);
    projectConfig.setProjectProperty(ProjectProperty.ERRAI_VERSION, versionSelect.getValue());

    return Results.success();
  }
View Full Code Here

  @Override
  protected FeatureFilter getFilter() {
    return new FeatureFilter() {
      @Override
      public boolean filter(Feature feature, Project project) {
        final ProjectConfig projectConfig = project
                .getFacet(ProjectConfig.class);
        final SerializableSet installed = projectConfig.getProjectProperty(
                ProjectProperty.INSTALLED_FEATURES, SerializableSet.class);

        return project.hasFacet(feature.getFeatureClass())
                && installed != null && installed.contains(feature.getShortName());
      }
View Full Code Here

      final BaseAggregatorFacet facet = mutable.getFacet(feature.getFeatureClass());

      if (!facet.uninstallRequirements() || !mutable.uninstall(facet))
        throw new Exception(String.format("Could not uninstall %s from %s.", facet.getClass(), project));

      final ProjectConfig projectConfig = project.getFacet(ProjectConfig.class);
      SerializableSet installed = projectConfig.getProjectProperty(ProjectProperty.INSTALLED_FEATURES,
              SerializableSet.class);
      if (installed == null)
        installed = new SerializableSet();
     
      installed.remove(feature.getShortName());
     
      projectConfig.setProjectProperty(ProjectProperty.INSTALLED_FEATURES, installed);
    }
    catch (Exception e) {
      throw new Exception("Could not remove " + feature.getLongName(), e);
    }
  }
View Full Code Here

   * @throws UninstallationExecption
   *           Thrown if this class is still required by another facet.
   */
  @SuppressWarnings("unchecked")
  public boolean uninstallRequirements() throws UninstallationExecption, IllegalStateException {
    final ProjectConfig config = getProject().getFacet(ProjectConfig.class);
    final SerializableSet installedFeatureNames = config.getProjectProperty(ProjectProperty.INSTALLED_FEATURES,
            SerializableSet.class);
    final Set<Class<? extends ProjectFacet>> directlyInstalled = new HashSet<Class<? extends ProjectFacet>>();

    for (final String featureName : installedFeatureNames) {
      directlyInstalled.add(reflections.getFeatureShort(featureName).getFeatureClass());
View Full Code Here

  private final String FILLER_VALUE = "$$_MODULE_JS_FILE_$$";

  @Override
  protected String getResourceContent() throws Exception {
    final StringBuilder builder = readResource(templateName);
    final ProjectConfig config = getProject().getFacet(ProjectConfig.class);
    final String moduleName = config.getProjectProperty(ProjectProperty.MODULE_NAME, String.class);
    // Replace filler with actual module js file
    replace(builder, FILLER_VALUE, getJsFilePath(moduleName));

    return builder.toString();
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.forge.config.ProjectConfig

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.