本文整理汇总了Java中org.jboss.forge.addon.ui.result.Results.navigationBuilder方法的典型用法代码示例。如果您正苦于以下问题:Java Results.navigationBuilder方法的具体用法?Java Results.navigationBuilder怎么用?Java Results.navigationBuilder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.forge.addon.ui.result.Results
的用法示例。
在下文中一共展示了Results.navigationBuilder方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: next
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public NavigationResult next(UINavigationContext context) throws Exception {
NavigationResultBuilder nrb = Results.navigationBuilder();
nrb.add(CreateMappingCommand.class);
nrb.add(ConfigureCamelStep.class);
return nrb.build();
}
示例2: nextEditEndpoint
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
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;
}
示例3: next
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public NavigationResult next(UINavigationContext context) throws Exception {
NavigationResultBuilder builder = Results.navigationBuilder();
builder.add(new CamelProjectAddComponentStep(filter, componentName, projectFactory, dependencyInstaller, getCamelCatalog()));
return builder.build();
}
示例4: next
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public NavigationResult next(UINavigationContext context) throws Exception {
Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap();
// avoid building this NavigationResult multiple times by forge as that causes problems
NavigationResult navigationResult = (NavigationResult) attributeMap.get("navigationResult");
if (navigationResult != null) {
return navigationResult;
}
UIContext ui = context.getUIContext();
ConnectionCatalogDto dto = loadCamelConnectionDto(getSelectedProject(context));
if (dto == null) {
return null;
}
// there may be custom components so load them from classpath
Project project = getSelectedProjectOrNull(context.getUIContext());
if (project != null) {
discoverCustomCamelComponentsOnClasspathAndAddToCatalog(camelCatalog, project);
}
ComponentDto component = createComponentDto(camelCatalog, dto.getBaseScheme());
if (component == null) {
return null;
}
boolean isConsumerOnly = "From".equals(dto.getSource());
boolean isProducerOnly = "To".equals(dto.getSource());
String camelComponentName = dto.getBaseScheme();
String name = dto.getName();
// what are the current chosen options
Set<String> chosenOptions = new LinkedHashSet<>();
if (dto.getEndpointOptions() != null) {
for (String option : dto.getEndpointOptions()) {
chosenOptions.add(option);
}
}
List<InputOptionByGroup> groups = createUIInputsForCamelEndpoint(camelComponentName, null, null, MAX_OPTIONS,
isConsumerOnly, isProducerOnly, true, chosenOptions, false,
camelCatalog, componentFactory, converterFactory, ui);
// need all inputs in a list as well
List<InputComponent> allInputs = new ArrayList<>();
for (InputOptionByGroup group : groups) {
allInputs.addAll(group.getInputs());
}
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);
ChooseConnectorOptionsStep step = new ChooseConnectorOptionsStep(projectFactory, name,
current.getGroup(), allInputs, current.getInputs(), last, i, pages);
builder.add(step);
}
navigationResult = builder.build();
attributeMap.put("navigationResult", navigationResult);
return navigationResult;
}
示例5: next
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public NavigationResult next(UINavigationContext context) throws Exception {
Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap();
// avoid building this NavigationResult multiple times by forge as that causes problems
NavigationResult navigationResult = (NavigationResult) attributeMap.get("navigationResult");
if (navigationResult != null) {
return navigationResult;
}
UIContext ui = context.getUIContext();
ConnectionCatalogDto dto = loadCamelConnectionDto(getSelectedProject(context));
if (dto == null) {
return null;
}
// there may be custom components so load them from classpath
Project project = getSelectedProjectOrNull(context.getUIContext());
if (project != null) {
discoverCustomCamelComponentsOnClasspathAndAddToCatalog(camelCatalog, project);
}
ComponentDto component = createComponentDto(camelCatalog, dto.getBaseScheme());
if (component == null) {
return null;
}
boolean isConsumerOnly = "From".equals(dto.getSource());
boolean isProducerOnly = "To".equals(dto.getSource());
String camelComponentName = dto.getBaseScheme();
String name = dto.getName();
// what are the current chosen options
Map<String, String> currentValues = new LinkedHashMap<>();
if (dto.getEndpointValues() != null) {
currentValues.putAll(dto.getEndpointValues());
}
List<InputOptionByGroup> groups = createUIInputsForCamelEndpoint(camelComponentName, currentValues, null, MAX_OPTIONS,
isConsumerOnly, isProducerOnly, false, null, true,
camelCatalog, componentFactory, converterFactory, ui);
// need all inputs in a list as well
List<InputComponent> allInputs = new ArrayList<>();
for (InputOptionByGroup group : groups) {
allInputs.addAll(group.getInputs());
}
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);
EditConnectorOptionsStep step = new EditConnectorOptionsStep(projectFactory, camelCatalog, name, camelComponentName,
current.getGroup(), allInputs, current.getInputs(), last, i, pages);
builder.add(step);
}
navigationResult = builder.build();
attributeMap.put("navigationResult", navigationResult);
return navigationResult;
}
示例6: next
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public NavigationResult next(UINavigationContext context) throws Exception {
Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap();
// avoid building this NavigationResult multiple times by forge as that causes problems
NavigationResult navigationResult = (NavigationResult) attributeMap.get("navigationResult");
if (navigationResult != null) {
return navigationResult;
}
UIContext ui = context.getUIContext();
ConnectionCatalogDto dto = loadCamelConnectionDto(getSelectedProject(context));
if (dto == null) {
return null;
}
// there may be custom components so load them from classpath
Project project = getSelectedProjectOrNull(context.getUIContext());
if (project != null) {
discoverCustomCamelComponentsOnClasspathAndAddToCatalog(camelCatalog, project);
}
ComponentDto component = createComponentDto(camelCatalog, dto.getBaseScheme());
if (component == null) {
return null;
}
String camelComponentName = dto.getBaseScheme();
String name = dto.getName();
// what are the current chosen options
Map<String, String> currentValues = new LinkedHashMap<>();
if (dto.getComponentValues() != null) {
currentValues.putAll(dto.getComponentValues());
}
List<InputOptionByGroup> groups = createUIInputsForCamelComponent(camelComponentName, currentValues, MAX_OPTIONS,
false, null, true, camelCatalog, componentFactory, converterFactory, ui);
// need all inputs in a list as well
List<InputComponent> allInputs = new ArrayList<>();
for (InputOptionByGroup group : groups) {
allInputs.addAll(group.getInputs());
}
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);
EditComponentOptionsStep step = new EditComponentOptionsStep(projectFactory, camelCatalog, name, camelComponentName,
current.getGroup(), allInputs, current.getInputs(), last, i, pages);
builder.add(step);
}
navigationResult = builder.build();
attributeMap.put("navigationResult", navigationResult);
return navigationResult;
}