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.ArrayList;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import io.fabric8.forge.camel.commands.project.completer.CurrentLineCompleter;
import io.fabric8.forge.camel.commands.project.completer.RouteBuilderEndpointsCompleter;
import io.fabric8.forge.camel.commands.project.completer.XmlEndpointsCompleter;
import io.fabric8.forge.camel.commands.project.helper.PoorMansLogger;
import io.fabric8.forge.camel.commands.project.model.CamelEndpointDetails;
import io.fabric8.forge.camel.commands.project.model.InputOptionByGroup;
import org.jboss.forge.addon.projects.dependencies.DependencyInstaller;
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.input.InputComponentFactory;
import org.jboss.forge.addon.ui.input.UISelectOne;
import org.jboss.forge.addon.ui.metadata.UICommandMetadata;
import org.jboss.forge.addon.ui.metadata.WithAttributes;
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.result.navigation.NavigationResultBuilder;
import org.jboss.forge.addon.ui.util.Categories;
import org.jboss.forge.addon.ui.util.Metadata;
import org.jboss.forge.addon.ui.wizard.UIWizard;
import static io.fabric8.forge.camel.commands.project.helper.CamelCommandsHelper.createUIInputsForCamelEndpoint;
public class CamelEditEndpointCommand extends AbstractCamelProjectCommand implements UIWizard {
private static final PoorMansLogger LOG = new PoorMansLogger(false);
private static final int MAX_OPTIONS = 20;
@Inject
@WithAttributes(label = "Endpoints", required = true, description = "The endpoints from the project")
private UISelectOne endpoints;
@Inject
private InputComponentFactory componentFactory;
@Inject
private DependencyInstaller dependencyInstaller;
private RouteBuilderEndpointsCompleter javaCompleter;
private XmlEndpointsCompleter xmlCompleter;
private CurrentLineCompleter currentLineCompleter;
@Override
public UICommandMetadata getMetadata(UIContext context) {
return Metadata.forCommand(CamelEditEndpointCommand.class).name(
"Camel: Edit Endpoint").category(Categories.create(CATEGORY))
.description("Edit Camel endpoint in the current file");
}
@Override
public boolean isEnabled(UIContext context) {
boolean answer = super.isEnabled(context);
if (answer) {
// we are only enabled if there is a file open in the editor
final String currentFile = getSelectedFile(context);
answer = currentFile != null;
}
return answer;
}
@Override
public void initializeUI(UIBuilder builder) throws Exception {
Map