@Override public Result execute(UIExecutionContext context) throws Exception { context.getUIContext().getAttributeMap().put("chatRoom", chatRoom.getValue()); context.getUIContext().getAttributeMap().put("issueProjectName", issueProjectName.getValue()); context.getUIContext().getAttributeMap().put("codeReview", codeReview.getValue()); return null; }
@Override public Result execute(UIExecutionContext context) throws Exception { StringBuilder sb = new StringBuilder(); GitIgnoreResource gitIgnore = gitIgnoreResource(context.getUIContext()); for (String pattern : gitIgnore.getPatterns()) { sb.append(pattern).append("\n"); } return Results.success(sb.toString()); }
@Override public Result execute(UIExecutionContext context) throws Exception { Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap(); LOG.info("devops tab has attributes:: " + attributeMap); try { return Results.success(""); } catch (IllegalArgumentException e) { return Results.fail(e.getMessage()); } }
@Override public Result execute(UIExecutionContext context) throws Exception { context.getUIContext().getAttributeMap().put("hasJenkinsFile", hasJenkinsFile); // store the pipeline in a special place to avoid weird web console painting context.getUIContext().getAttributeMap().put("selectedPipeline", pipeline.getValue()); // execute and save Project project = getSelectedProject(context); return DevOpsSave.execute(context, project, namespace); }
public static void putComponentValuesInAttributeMap(UIExecutionContext context, List<InputComponent> inputComponents) { if (inputComponents != null) { Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap(); for (InputComponent inputComponent : inputComponents) { String name = inputComponent.getName(); Object value = inputComponent.getValue(); if (value != null) { attributeMap.put(name, value); } } } }
protected void updateConfiguration(UIExecutionContext context, ProjectConfig config) { Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap(); ProjectConfigs.configureProperties(config, attributeMap); Object pipelineValue = attributeMap.get("selectedPipeline"); if (pipelineValue instanceof PipelineDTO) { PipelineDTO pipeline = (PipelineDTO) pipelineValue; if (pipeline != null) { config.setPipeline(pipeline.getValue()); } } }
private static void updateConfiguration(UIExecutionContext context, ProjectConfig config) { Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap(); ProjectConfigs.configureProperties(config, attributeMap); Object pipelineValue = attributeMap.get("selectedPipeline"); if (pipelineValue instanceof PipelineDTO) { PipelineDTO pipeline = (PipelineDTO) pipelineValue; if (pipeline != null) { config.setPipeline(pipeline.getValue()); } } }
@Override public Result execute(UIExecutionContext context) throws Exception { final UIContext uiContext = context.getUIContext(); JPADataSource dataSource = (JPADataSource) uiContext.getAttributeMap().get(JPADataSource.class); updateDataSource(dataSource); final Properties properties = new Properties(); setProperties(properties, dataSource); final Project project = helper.getProject(uiContext); SpringBootHelper.writeToApplicationProperties(project, properties); return null; }
@Override public Result execute(UIExecutionContext context) throws Exception { UIContext uiContext = context.getUIContext(); GitIgnoreResource resource = gitIgnoreResource(uiContext); uiContext.setSelection(resource); return Results.success(); }
@Override public Result execute(UIExecutionContext context) throws Exception { StopWatch watch = new StopWatch(); UIContext uiContext = context.getUIContext(); ProjectOverviewDTO projectOverview = getProjectOverview(uiContext); String result = formatResult(projectOverview); log.info("execute took " + watch.taken()); return Results.success(result); }
@Override public Result execute(UIExecutionContext context) throws Exception { GitIgnoreResource gitIgnore = gitIgnoreResource(context.getUIContext()); gitIgnore.removePattern(pattern.getValue()); return Results.success("Pattern removed from the .gitignore in the current directory"); }
@Override public Result execute(UIExecutionContext context) throws Exception { Shell shell = (Shell) context.getUIContext().getProvider(); shell.getConsole().clear(); return Results.success(); }
@Override public Result execute(UIExecutionContext context) throws Exception { UIContext uiContext = context.getUIContext(); Shell shell = (Shell) uiContext.getProvider(); shell.getConsole().stop(); forge.stop(); uiContext.getAttributeMap().put("org.jboss.forge.exit", Boolean.TRUE); return Results.success(); } }
@Override public Result execute(UIExecutionContext context) throws Exception { GitIgnoreResource gitIgnore = gitIgnoreResource(context.getUIContext()); gitIgnore.addPattern(pattern.getValue()); return Results.success("Pattern added to the .gitignore in the current directory"); }
@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(); }
@Override public Result execute(final UIExecutionContext context) throws Exception { final Project project = getSelectedProject(context.getUIContext()); configureGwtMockitoRunner(project); produceTestFile(project); addTestDependencies(project); return Results.success(); }
@Override public Result execute(final UIExecutionContext executionContext) throws Exception { final UIOutput output = executionContext.getUIContext().getProvider().getOutput(); AddonWatchService addonWatchService = getAddonWatchService(); addonWatchService.start(); addonWatchService.getMonitoredAddons() .forEach(addonId -> output.info(output.out(), "Monitoring changes on " + addonId)); return Results.success(); }
@Override public Result execute(UIExecutionContext uiExecutionContext) throws Exception { facet.setVertxVersion(vertxVersion.getValue()); facet.setFaceted(getSelectedProject(uiExecutionContext.getUIContext())); facet.install(); return Results.success("Vert.x project created successfully"); }
@Override public Result execute(UIExecutionContext context) throws Exception { JavaResource javaResource = (JavaResource) context.getUIContext().getInitialSelection().get(); JavaClassSource commandClass = javaResource.getJavaType(); commandClass = createCommand(commandClass, named.getValue(), categories.getValue()); javaResource.setContents(commandClass); return Results.success("Annotated UICommand created"); }
@Override public Result execute(UIExecutionContext context) throws Exception { final PrintStream out = context.getUIContext().getProvider().getOutput().out(); final FileResource<?> js = script.getValue(); final Boolean canOverwrite = overwrite.getValue(); final Manifest mf = getManifest(); return copyFileToAssetDir(js.getUnderlyingResourceObject(), mf, canOverwrite, onSuccess, onError ); }