Examples of ProjectConfig


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

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

    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

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

  }

  @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

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

    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

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

    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

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

  @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

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

      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

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

   * @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

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

  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

Examples of se.sics.cooja.ProjectConfig

    addRemovePane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));

    button = new JButton("View resulting config");
    button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        ProjectConfig config;
        try {
          // Create default configuration
          config = new ProjectConfig(true);
        } catch (FileNotFoundException ex) {
          logger.fatal("Could not find default project config file: "
              + GUI.PROJECT_DEFAULT_CONFIG_FILENAME);
          return;
        } catch (IOException ex) {
          logger.fatal("Error when reading default project config file: "
              + GUI.PROJECT_DEFAULT_CONFIG_FILENAME);
          return;
        }

        // Add the fixed project configurations
        if (fixedProjectsList != null) {
          for (String projectDir : fixedProjectsList.getItems()) {
            try {
              config.appendProjectDir(new File(projectDir));
            } catch (Exception ex) {
              logger.fatal("Error when merging configurations: " + ex);
              return;
            }
          }
        }

        // Add the project directory configurations
        for (String projectDir : changableProjectsList.getItems()) {
          try {
            config.appendProjectDir(new File(projectDir));
          } catch (Exception ex) {
            logger.fatal("Error when merging configurations: " + ex);
            return;
          }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.