Package org.cloudfoundry.ide.eclipse.server.core.internal.tunnel

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.tunnel.ServerService


  protected void setServerInput() {

    if (services != null && !services.isEmpty()) {
      serviceViewer.setInput(services);
      ServerService initialSelection = services.get(0);
      if (serviceContext != null) {
        for (ServerService serv : services) {
          if (serv.getServiceInfo().equals(serviceContext)) {
            initialSelection = serv;
            break;
View Full Code Here


   * selected command. False will ONLY edit an existing command, if one is
   * currently selected. Otherwise it will add a new command.
   */
  protected void addOrEditCommand(boolean add) {

    ServerService service = getSelectedService();
    if (service != null) {
      ServiceCommand serviceCommandToEdit = !add ? getSelectedCommand() : null;

      ServiceCommandWizard wizard = new ServiceCommandWizard(serviceCommands, service, serviceCommandToEdit);
      Shell shell = getShell();

      if (shell != null) {
        WizardDialog dialog = new WizardDialog(shell, wizard);
        if (dialog.open() == Window.OK) {

          ServiceCommand editedCommand = wizard.getEditedServiceCommand();

          if (editedCommand != null) {
            // Add the new one
            boolean added = new ServiceCommandManager(serviceCommands).addCommand(service.getServiceInfo(),
                editedCommand);

            if (!added) {
              notifyStatusChange(CloudFoundryPlugin.getErrorStatus(Messages.ServiceTunnelCommandPart_ERROR_FAIL_TO_ADD
                  + editedCommand.getDisplayName()));
View Full Code Here

    }
  }

  protected void deleteCommand(ServiceCommand toDelete) {
    ServerService serverService = getSelectedService();
    if (toDelete != null && serverService != null) {
      List<ServiceCommand> commands = serverService.getCommands();
      List<ServiceCommand> newCommands = new ArrayList<ServiceCommand>();
      if (commands != null) {
        for (ServiceCommand existingCommand : commands) {
          if (!existingCommand.equals(toDelete)) {
            newCommands.add(existingCommand);
          }
        }

      }
      serverService.setCommands(newCommands);

      setServiceCommandInput(serverService, null);

    }
  }
View Full Code Here

          }
        }
      }
      else if (source == serviceViewer) {
        ServerService serverService = getSelectedService();
        setServiceCommandInput(serverService, null);
      }
    }

    // Be sure to grab the latest selections AFTER any of the button
View Full Code Here

    refreshButtons();
  }

  protected void refreshButtons() {
    ServiceCommand selectedCommand = getSelectedCommand();
    ServerService serviceWrapper = getSelectedService();

    if (selectedCommand != null) {
      addCommandButton.setEnabled(true);
      deleteCommandButton.setEnabled(true);
      editCommandButton.setEnabled(true);
View Full Code Here

TOP

Related Classes of org.cloudfoundry.ide.eclipse.server.core.internal.tunnel.ServerService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.