org.jboss.forge.addon.ui.result.NavigationResult Java Examples
The following examples show how to use
org.jboss.forge.addon.ui.result.NavigationResult.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DevOpsEditCommand.java From fabric8-forge with Apache License 2.0 | 5 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { NavigationResultBuilder builder = NavigationResultBuilder.create(); if (needFabric8Setup) { builder.add(Fabric8SetupStep.class); } if (needOptionalStep) { builder.add(DevOpsEditOptionalStep.class); } builder.add(DevOpsEditStep.class); return builder.build(); }
Example #2
Source File: ScaffoldableEntitySelectionWizard.java From angularjs-addon with Eclipse Public License 1.0 | 5 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { UIContext uiContext = context.getUIContext(); Map<Object, Object> attributeMap = uiContext.getAttributeMap(); ResourceCollection resourceCollection = new ResourceCollection(); if (targets.getValue() != null) { for (JavaClassSource klass : targets.getValue()) { Project project = getSelectedProject(uiContext); JavaSourceFacet javaSource = project.getFacet(JavaSourceFacet.class); Resource<?> resource = javaSource.getJavaResource(klass); if (resource != null) { resourceCollection.addToCollection(resource); } } } attributeMap.put(ResourceCollection.class, resourceCollection); Boolean shouldGenerateRestResources = generateRestResources.getValue(); if (shouldGenerateRestResources.equals(Boolean.TRUE)) { return Results.navigateTo(JSONRestResourceFromEntityCommand.class); } return null; }
Example #3
Source File: AngularScaffoldProvider.java From angularjs-addon with Eclipse Public License 1.0 | 5 votes |
@Override public NavigationResult getGenerationFlow(ScaffoldGenerationContext generationContext) { NavigationResultBuilder builder = NavigationResultBuilder.create(); builder.add(ScaffoldableEntitySelectionWizard.class); return builder.build(); }
Example #4
Source File: AngularScaffoldProvider.java From angularjs-addon with Eclipse Public License 1.0 | 5 votes |
@Override public NavigationResult getSetupFlow(ScaffoldSetupContext setupContext) { Project project = setupContext.getProject(); NavigationResultBuilder builder = NavigationResultBuilder.create(); List<Class<? extends UICommand>> setupCommands = new ArrayList<>(); if (!project.hasFacet(JPAFacet.class)) { builder.add(JPASetupWizard.class); } if (!project.hasFacet(CDIFacet.class)) { setupCommands.add(CDISetupCommand.class); } if (!project.hasFacet(EJBFacet.class)) { setupCommands.add(EJBSetupWizard.class); } if (!project.hasFacet(ServletFacet.class)) { // TODO: FORGE-1296. Ensure that this wizard only sets up Servlet 3.0+ setupCommands.add(ServletSetupWizard.class); } if (!project.hasFacet(RestFacet.class)) { setupCommands.add(RestSetupWizard.class); } if (setupCommands.size() > 0) { Metadata compositeSetupMetadata = Metadata.forCommand(setupCommands.get(0)) .name("Setup Facets") .description("Setup all dependent facets for the AngularJS scaffold."); builder.add(compositeSetupMetadata, setupCommands); } return builder.build(); }
Example #5
Source File: ThorntailSetupFlow.java From thorntail-addon with Eclipse Public License 1.0 | 5 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { NavigationResultBuilder builder = NavigationResultBuilder.create(); builder.add(Metadata.forCommand(SetupCommand.class).name("Thorntail: Setup") .description("Setup Thorntail in your web application"), Arrays.asList(SetupCommand.class, AddFractionCommand.class)); builder.add(SetupFractionsStep.class); return builder.build(); }
Example #6
Source File: Fabric8SetupStep.java From fabric8-forge with Apache License 2.0 | 5 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { Boolean value = integrationTest.getValue(); if (value != null && value) { return NavigationResultBuilder.create().add(NewIntegrationTestClassCommand.class).build(); } return null; }
Example #7
Source File: DevOpsEditStep.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { return null; }
Example #8
Source File: SpringBootSetupFlow.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { return NavigationResultBuilder.create().add(SpringBootNewProjectCommand.class).build(); }
Example #9
Source File: SpringBootNewProjectCommand.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { return null; }
Example #10
Source File: ConfigureComponentPropertiesStep.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { return null; }
Example #11
Source File: ConfigureEndpointPropertiesStep.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { return null; }
Example #12
Source File: CamelEditNodeXmlCommand.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap(); // always refresh these as the end user may have edited the instance name String xmlResourceName = xml.getValue(); attributeMap.put("xml", xmlResourceName); attributeMap.put("mode", "edit"); attributeMap.put("kind", "xml"); LOG.info("Edit selected index: " + node.getSelectedIndex()); NodeDto editNode = preSelectedNode; if (editNode == null && node != null) { int selectedIdx = node.getSelectedIndex(); if (selectedIdx != -1) { editNode = nodes.get(selectedIdx); } } String key = editNode != null ? editNode.getKey() : null; // must be same node to allow reusing existing navigation result String previous = getNodeKey(attributeMap.get("node")); if (previous != null && previous.equals(key)) { NavigationResult navigationResult = (NavigationResult) attributeMap.get("navigationResult"); if (navigationResult != null) { return navigationResult; } } LOG.info("Edit node " + editNode + " pattern " + editNode.getPattern()); attributeMap.put("node", key); String nodeName = editNode.getPattern(); attributeMap.put("nodeName", nodeName); attributeMap.put("pattern", editNode.getPattern()); // if its "from" or "to" then lets edit the node as an endpoint if (("from".equals(editNode.getPattern()) || "to".equals(editNode.getPattern()))) { return nextEditEndpoint(context, xmlResourceName, key, editNode); } else { return nextEditEip(context, xmlResourceName, key, editNode, nodeName); } }
Example #13
Source File: CamelEditNodeXmlCommand.java From fabric8-forge with Apache License 2.0 | 4 votes |
private NavigationResult nextEditEndpoint(UINavigationContext context, String xmlResourceName, String key, NodeDto editNode) throws Exception { Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap(); // find all endpoints xmlCompleter = createXmlEndpointsCompleter(context.getUIContext(), xmlResourceName::equals); String uri = editNode.getProperty("uri"); LOG.info("Endpoint uri " + uri); CamelEndpointDetails detail = xmlCompleter.getEndpointDetail(uri); LOG.info("Endpoint detail " + detail); if (detail == null) { return null; } attributeMap.put("componentName", detail.getEndpointComponentName()); attributeMap.put("instanceName", detail.getEndpointInstance()); attributeMap.put("endpointUri", detail.getEndpointUri()); attributeMap.put("lineNumber", detail.getLineNumber()); attributeMap.put("lineNumberEnd", detail.getLineNumberEnd()); attributeMap.put("mode", "edit"); attributeMap.put("xml", detail.getFileName()); attributeMap.put("kind", "xml"); // we need to figure out how many options there is so we can as many steps we need String camelComponentName = detail.getEndpointComponentName(); uri = detail.getEndpointUri(); String json = getCamelCatalog().componentJSonSchema(camelComponentName); if (json == null) { throw new IllegalArgumentException("Could not find catalog entry for component name: " + camelComponentName); } LOG.info("Component json: " + json); boolean consumerOnly = detail.isConsumerOnly(); boolean producerOnly = detail.isProducerOnly(); UIContext ui = context.getUIContext(); List<InputOptionByGroup> groups = createUIInputsForCamelEndpoint(camelComponentName, uri, MAX_OPTIONS, consumerOnly, producerOnly, getCamelCatalog(), componentFactory, converterFactory, ui); // need all inputs in a list as well List<InputComponent> allInputs = new ArrayList<>(); for (InputOptionByGroup group : groups) { allInputs.addAll(group.getInputs()); } LOG.info(allInputs.size() + " input fields in the UI wizard"); NavigationResultBuilder builder = Results.navigationBuilder(); int pages = groups.size(); for (int i = 0; i < pages; i++) { boolean last = i == pages - 1; InputOptionByGroup current = groups.get(i); ConfigureEndpointPropertiesStep step = new ConfigureEndpointPropertiesStep(projectFactory, dependencyInstaller, getCamelCatalog(), camelComponentName, current.getGroup(), allInputs, current.getInputs(), last, i, pages); builder.add(step); } NavigationResult navigationResult = builder.build(); attributeMap.put("navigationResult", navigationResult); return navigationResult; }
Example #14
Source File: ConfigureEipPropertiesStep.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { return null; }
Example #15
Source File: CamelProjectAddComponentCommand.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { NavigationResultBuilder builder = Results.navigationBuilder(); builder.add(new CamelProjectAddComponentStep(filter, componentName, projectFactory, dependencyInstaller, getCamelCatalog())); return builder.build(); }
Example #16
Source File: DevOpsPipelineCommand.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { NavigationResultBuilder builder = NavigationResultBuilder.create(); builder.add(DevOpsEditStep.class); return builder.build(); }
Example #17
Source File: Fabric8SetupCommand.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { return Results.navigateTo(Fabric8SetupStep.class); }
Example #18
Source File: FunktionArchetypeSelectionWizardStep.java From fabric8-forge with Apache License 2.0 | 4 votes |
@Override public NavigationResult next(UINavigationContext context) throws Exception { return null; }