Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright 2005-2015 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.fabric8.forge.camel.commands.project;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import io.fabric8.forge.addon.utils.CamelProjectHelper;
import io.fabric8.forge.addon.utils.LineNumberHelper;
import io.fabric8.forge.camel.commands.project.helper.PoorMansLogger;
import org.apache.camel.catalog.CamelCatalog;
import org.apache.camel.util.IntrospectionSupport;
import org.apache.camel.util.ObjectHelper;
import org.jboss.forge.addon.dependencies.Dependency;
import org.jboss.forge.addon.projects.Project;
import org.jboss.forge.addon.projects.ProjectFactory;
import org.jboss.forge.addon.projects.facets.ResourcesFacet;
import org.jboss.forge.addon.projects.facets.WebResourcesFacet;
import org.jboss.forge.addon.resource.FileResource;
import org.jboss.forge.addon.ui.context.UIBuilder;
import org.jboss.forge.addon.ui.context.UIContext;
import org.jboss.forge.addon.ui.context.UIExecutionContext;
import org.jboss.forge.addon.ui.context.UINavigationContext;
import org.jboss.forge.addon.ui.input.InputComponent;
import org.jboss.forge.addon.ui.metadata.UICommandMetadata;
import org.jboss.forge.addon.ui.result.NavigationResult;
import org.jboss.forge.addon.ui.result.Result;
import org.jboss.forge.addon.ui.result.Results;
import org.jboss.forge.addon.ui.util.Categories;
import org.jboss.forge.addon.ui.util.Metadata;
import org.jboss.forge.addon.ui.wizard.UIWizardStep;
import org.jboss.forge.roaster.model.util.Strings;
import static io.fabric8.forge.camel.commands.project.helper.CamelCatalogHelper.getModelJavaType;
import static io.fabric8.forge.camel.commands.project.helper.CamelCatalogHelper.isModelDefaultValue;
import static io.fabric8.forge.camel.commands.project.helper.CamelCatalogHelper.isModelExpressionKind;
import static io.fabric8.forge.camel.commands.project.helper.CamelXmlHelper.dumpModelAsXml;
public abstract class ConfigureEipPropertiesStep extends AbstractCamelProjectCommand implements UIWizardStep {
private static final PoorMansLogger LOG = new PoorMansLogger(false);
private final CamelCatalog camelCatalog;
private final String eipName;
private final String group;
private final List allInputs;
private final List inputs;
private final boolean last;
private final int index;
private final int total;
public ConfigureEipPropertiesStep(ProjectFactory projectFactory,
CamelCatalog camelCatalog,
String eipName, String group,
List allInputs,
List inputs,
boolean last, int index, int total) {
this.projectFactory = projectFactory;
this.camelCatalog = camelCatalog;
this.eipName = eipName;
this.group = group;
this.allInputs = allInputs;
this.inputs = inputs;
this.last = last;
// we want to 1-based
this.index = index + 1;
this.total = total;
}
public String getGroup() {
return group;
}
public int getIndex() {
return index;
}
public int getTotal() {
return total;
}
public String getEipName() {
return eipName;
}
@Override
public UICommandMetadata getMetadata(UIContext context) {
return Metadata.forCommand(ConfigureEipPropertiesStep.class).name(
"Camel: EIP options").category(Categories.create(CATEGORY))
.description(String.format("Configure %s options (%s of %s)", group, index, total));
}
@Override
@SuppressWarnings("unchecked")
public void initializeUI(UIBuilder builder) throws Exception {
if (inputs != null) {
for (InputComponent input : inputs) {
builder.add(input);
}
}
}
@Override
public NavigationResult next(UINavigationContext context) throws Exception {
return null;
}
@Override
public Result execute(UIExecutionContext context) throws Exception {
Map