
io.fabric8.forge.addon.utils.CommandHelpers Maven / Gradle / Ivy
/**
* 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.addon.utils;
import io.fabric8.utils.Files;
import io.fabric8.utils.Strings;
import org.jboss.forge.addon.projects.Project;
import org.jboss.forge.addon.resource.Resource;
import org.jboss.forge.addon.resource.util.ResourceUtil;
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.UISelection;
import org.jboss.forge.addon.ui.input.InputComponent;
import org.jboss.forge.addon.ui.input.UIInput;
import org.jboss.forge.addon.ui.result.CompositeResult;
import org.jboss.forge.addon.ui.result.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static io.fabric8.forge.addon.utils.Files.joinPaths;
/**
*/
public class CommandHelpers {
private static final transient Logger LOG = LoggerFactory.getLogger(CommandHelpers.class);
/**
* A helper function to add the components to the builder and return a list of all the components
*/
public static List addInputComponents(UIBuilder builder, InputComponent... components) {
List inputComponents = new ArrayList<>();
for (InputComponent component : components) {
builder.add(component);
inputComponents.add(component);
}
return inputComponents;
}
public static void putComponentValuesInAttributeMap(UIExecutionContext context, List inputComponents) {
if (inputComponents != null) {
Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy