本文整理汇总了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();
}
示例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();
}
示例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;
}
示例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;
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例9: getOutput
import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public UIOutput getOutput() {
return output;
}
示例10: getOutput
import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public UIOutput getOutput() {
return output;
}
示例11: getOutput
import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
public UIOutput getOutput() {
UIProvider provider = getUiProvider();
return provider != null ? provider.getOutput() : null;
}
示例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();
}
示例13: getOutput
import org.jboss.forge.addon.ui.output.UIOutput; //导入依赖的package包/类
@Override
public UIOutput getOutput()
{
return output;
}
示例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());
}
}