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

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


            // Account for the additional entry in the combo that
            // has no mapped entry in the predefined list
            int predefIndex = selectionIndex - 1;

            ServiceCommand value = predefIndex >= 0 && predefIndex < predefined.size() ? predefined
                .get(predefIndex) : null;
            setPredefinedCommand(value);
          }
        }
      });
View Full Code Here


   */
  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()));
              return;
            }
            else {
              // Delete the old command
              if (serviceCommandToEdit != null) {
                deleteCommand(serviceCommandToEdit);
              }

              CommandTerminal updatedTerminal = wizard.applyTerminalToAllCommands() ? editedCommand
                  .getCommandTerminal() : null;

              setServiceCommandInput(service, editedCommand);
              applyTerminalToAllCommands(updatedTerminal);
            }
View Full Code Here

          switch (controlData) {
          case Add:
            addOrEditCommand(true);
            break;
          case Delete:
            ServiceCommand toDelete = getSelectedCommand();
            deleteCommand(toDelete);
            break;
          case Edit:
            addOrEditCommand(false);
            break;
View Full Code Here

    // the button operations may result in selection changes
    refreshButtons();
  }

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

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

    }

    public String getText(Object element) {
      if (element instanceof ServiceCommand) {
        ServiceCommand command = (ServiceCommand) element;
        return command.getDisplayName();
      }
      return super.getText(element);
    }
View Full Code Here

      UIJob uiJob = new UIJob(Messages.LaunchTunnelCommandAction_JOB_PROMPT) {

        @Override
        public IStatus runInUIThread(IProgressMonitor monitor) {
          Shell shell = PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();
          final ServiceCommand resolvedCommand = new CommandOptionsUIHandler(shell, serviceCommand,
              descriptor).promptForValues();

          // Once prompted, launch it asynchronously outside the UI
          // thread as it may be a long
          // running process that may block the thread while waiting
View Full Code Here

TOP

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

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.