当前位置: 首页>>代码示例>>Java>>正文


Java UIOutput类代码示例

本文整理汇总了Java中org.jboss.forge.addon.ui.output.UIOutput的典型用法代码示例。如果您正苦于以下问题:Java UIOutput类的具体用法?Java UIOutput怎么用?Java UIOutput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UIOutput类属于org.jboss.forge.addon.ui.output包,在下文中一共展示了UIOutput类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext executionContext) throws Exception
{
   UIProvider provider = executionContext.getUIContext().getProvider();
   UIOutput output = provider.getOutput();
   PrintStream out = output.out();
   for (FractionDescriptor fraction : WildFlySwarmFacet.getAllFractionDescriptors())
   {
      if (!fraction.isInternal())
      {
         String msg = String.format("%s: %s (%s)", fraction.getArtifactId(), fraction.getName(),
                  fraction.getDescription());
         out.println(msg);
      }
   }
   return Results.success();
}
 
开发者ID:forge,项目名称:wildfly-swarm-addon,代码行数:18,代码来源:ListFractionsCommand.java

示例2: execute

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
   Project project = getSelectedProject(context);
   UIOutput output = context.getUIContext().getProvider().getOutput();
   PackagingFacet packagingFacet = project.getFacet(PackagingFacet.class);
   try
   {
      packagingFacet.createBuilder().addArguments("wildfly-swarm:run").runTests(false).build(output.out(),
               output.err());
   }
   catch (BuildException ie)
   {
      if (!(ie.getCause() instanceof InterruptedException))
      {
         return Results.fail("Error while running the build", ie.getCause());
      }
   }
   return Results.success();
}
 
开发者ID:forge,项目名称:wildfly-swarm-addon,代码行数:21,代码来源:RunCommand.java

示例3: initDependencies

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
private List<SpringBootDependencyDTO> initDependencies(UIOutput uiOutput) throws Exception
{
   List<SpringBootDependencyDTO> list = new ArrayList<>();

   for (Object dep : fetchDependencies(uiOutput))
   {
      Map<String,Object> group = (Map) dep;
      String groupName = removeDoubleQuotes(group.get("name"));
      List<Map<String,String>> content;
      // Add this test as the json file & yaml file uses a different key
      if (group.get("content") != null)
      {
         content = (List) group.get("content");
      }
      else
      {
         content = (List) group.get("values");
      }
      for (Object row : content)
      {
         Map<String, Object> item = (Map) row;
         String id = removeDoubleQuotes(item.get("id"));
         String name = removeDoubleQuotes(item.get("name"));
         String description = removeDoubleQuotes(item.get("description"));
         list.add(new SpringBootDependencyDTO(groupName, id, name, description));
      }
   }
   return list;
}
 
开发者ID:forge,项目名称:springboot-addon,代码行数:30,代码来源:SetupProjectCommand.java

示例4: getOut

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
public PrintStream getOut() {
    UIOutput output = getOutput();
    if (output != null) {
        return output.out();
    } else {
        return System.out;
    }
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:9,代码来源:AbstractDevOpsCommand.java

示例5: execute

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext executionContext) throws Exception {
    UIProvider provider = executionContext.getUIContext().getProvider();
    UIOutput output = provider.getOutput();
    PrintStream out = output.out();
    for (VertxDependency dep : VertxMavenFacet.getAllDependencies()) {
        String msg = String.format("%s: %s (%s)", dep.getArtifactId(), dep.getName(), dep.getDescription());
        out.println(msg);
    }
    return Results.success();
}
 
开发者ID:cescoffier,项目名称:vertx-forge-addon,代码行数:12,代码来源:ListDependenciesCommand.java

示例6: execute

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    Project project = getSelectedProject(context);
    Model model = getMapperContext(project).getTargetModel();
    UIOutput output = context.getUIContext().getProvider().getOutput();
    if (model != null) {
        model.print(output.out());
    } else {
        output.out().println("No active mapping in session");
    }

    return Results.success();
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:14,代码来源:ViewTargetModelCommand.java

示例7: execute

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    Project project = getSelectedProject(context);
    Model model = getMapperContext(project).getSourceModel();
    UIOutput output = context.getUIContext().getProvider().getOutput();
    if (model != null) {
        model.print(output.out());
    } else {
        output.out().println("No active mapping in session");
    }

    return Results.success();
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:14,代码来源:ViewSourceModelCommand.java

示例8: execute

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    Project project = getSelectedProject(context);
    Model model = loadModel(project, modelName.getValue());
    UIOutput output = context.getUIContext().getProvider().getOutput();
    model.print(output.out());
    return Results.success();
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:9,代码来源:ViewModelCommand.java

示例9: getOutput

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public UIOutput getOutput() {
    return output;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:5,代码来源:RestUIProvider.java

示例10: getOutput

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public UIOutput getOutput() {
	return output;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:5,代码来源:RestUIProvider.java

示例11: getOutput

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
public UIOutput getOutput() {
    UIProvider provider = getUiProvider();
    return provider != null ? provider.getOutput() : null;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:5,代码来源:AbstractDevOpsCommand.java

示例12: execute

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext executionContext) throws Exception
{
   UIProgressMonitor progressMonitor = executionContext.getProgressMonitor();
   UIOutput output = executionContext.getUIContext().getProvider().getOutput();
   FractionUsageAnalyzer analyzer = WildFlySwarmFacet.getFractionUsageAnalyzer();
   DirectoryResource value = inputDir.getValue();
   analyzer.source(value.getUnderlyingResourceObject());
   Project project = getSelectedProject(executionContext);
   int total = 1;
   if (build.getValue())
      total++;
   if (depend.getValue())
      total++;
   progressMonitor.beginTask("Detecting fractions", total);
   if (build.getValue())
   {
      PackagingFacet packaging = project.getFacet(PackagingFacet.class);
      progressMonitor.setTaskName("Building the project...");
      FileResource<?> finalArtifact = packaging.createBuilder().build(output.out(), output.err())
               .reify(FileResource.class);
      analyzer.source(finalArtifact.getUnderlyingResourceObject());
      progressMonitor.worked(1);
   }
   Collection<FractionDescriptor> detectedFractions = analyzer.detectNeededFractions();
   output.info(output.out(), "Detected fractions: " + detectedFractions);
   progressMonitor.worked(1);
   if (depend.getValue() && detectedFractions.size() > 0)
   {
      progressMonitor.setTaskName("Adding missing fractions as project dependencies...");
      WildFlySwarmFacet facet = project.getFacet(WildFlySwarmFacet.class);
      detectedFractions.removeAll(facet.getInstalledFractions());
      // detectedFractions.remove(fractionList.getFractionDescriptor(Swarm.DEFAULT_FRACTION_GROUPID, "container"));
      if (detectedFractions.isEmpty())
      {
         output.warn(output.out(), "Project already contains all the installed fractions. Doing nothing.");
      }
      else
      {
         output.info(output.out(), "Installing the following dependencies: " + detectedFractions);
         facet.installFractions(detectedFractions);
      }
      progressMonitor.worked(1);
   }
   progressMonitor.done();
   return Results.success();
}
 
开发者ID:forge,项目名称:wildfly-swarm-addon,代码行数:48,代码来源:DetectFractionsCommand.java

示例13: getOutput

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public UIOutput getOutput()
{
    return output;
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:6,代码来源:UIProviderImpl.java

示例14: execute

import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
    if (!this.promptMessages.isEmpty())
    {
        for (ValidationResult message : promptMessages)
        {
            UIOutput output = context.getUIContext().getProvider().getOutput();
            output.warn(output.out(), message.getMessage());
        }

        if (context.getPrompt().promptBoolean("Would you like to continue?", true) == false)
        {
            return Results.fail("Aborted by the user.");
        }
    }

    WindupConfiguration windupConfiguration = new WindupConfiguration();
    for (Entry<ConfigurationOption, InputComponent<?, ?>> entry : this.inputOptions.entrySet())
    {
        ConfigurationOption option = entry.getKey();
        String name = option.getName();
        Object value = getValueForInput(option, entry.getValue());
        windupConfiguration.setOptionValue(name, value);
    }

    windupConfiguration.useDefaultDirectories();

    Boolean overwrite = (Boolean) windupConfiguration.getOptionMap().get(OverwriteOption.NAME);
    if (overwrite == null)
    {
        overwrite = false;
    }

    if (!overwrite && pathNotEmpty(windupConfiguration.getOutputDirectory().toFile()))
    {
        String promptMsg = "Overwrite all contents of \"" + windupConfiguration.getOutputDirectory().toString()
                    + "\" (anything already in the directory will be deleted)?";
        if (!context.getPrompt().promptBoolean(promptMsg, false))
        {
            String outputPath = windupConfiguration.getOutputDirectory().toString();
            return Results.fail("Files exist in " + outputPath + ", but --overwrite not specified. Aborting!");
        }
    }

    /*
     * Put this in the context for debugging, and unit tests (or anything else that needs it).
     */
    context.getUIContext().getAttributeMap().put(WindupConfiguration.class, windupConfiguration);

    FileUtils.deleteQuietly(windupConfiguration.getOutputDirectory().toFile());
    Path graphPath = windupConfiguration.getOutputDirectory().resolve("graph");
    try (GraphContext graphContext = graphContextFactory.create(graphPath))
    {
        context.getUIContext().getAttributeMap().put(GraphContext.class, graphContext);
        UIProgressMonitor uiProgressMonitor = context.getProgressMonitor();
        WindupProgressMonitor progressMonitor = new WindupProgressMonitorAdapter(uiProgressMonitor);
        windupConfiguration
                    .setProgressMonitor(progressMonitor)
                    .setGraphContext(graphContext);
        processor.execute(windupConfiguration);

        uiProgressMonitor.done();

        Path indexHtmlPath = windupConfiguration.getOutputDirectory().resolve("index.html").normalize().toAbsolutePath();
        return Results.success("Report created: " + indexHtmlPath + System.getProperty("line.separator")
                    + "              Access it at this URL: " + indexHtmlPath.toUri());
    }
}
 
开发者ID:windup,项目名称:windup,代码行数:70,代码来源:WindupCommand.java


注:本文中的org.jboss.forge.addon.ui.output.UIOutput类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。