Package org.eclipse.egit.ui.internal.dialogs

Examples of org.eclipse.egit.ui.internal.dialogs.AbstractBranchSelectionDialog


    branchEditButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent selectionEvent) {
        String txt = branchText.getText();
        String refToMark = "".equals(txt) ? null : Constants.R_HEADS + txt; //$NON-NLS-1$
        AbstractBranchSelectionDialog dlg = new BranchEditDialog(
            checkoutGroup.getShell(), repository, refToMark);
        if (dlg.open() == Window.OK) {
          branchText.setText(Repository.shortenRefName(dlg
              .getRefName()));
        } else {
          // force calling branchText's modify listeners
          branchText.setText(branchText.getText());
        }
View Full Code Here


    });
    return dialogResult[0];
  }

  private String getTargetWithDialogInUI() {
    AbstractBranchSelectionDialog dialog;
    switch (mode) {
    case MODE_CHECKOUT:
      dialog = new CheckoutDialog(getShell(), repository);
      break;
    case MODE_CREATE:
      CreateBranchWizard wiz;
      try {
        if (base == null)
          base = repository.getFullBranch();
        wiz = new CreateBranchWizard(repository, base);
      } catch (IOException e) {
        wiz = new CreateBranchWizard(repository);
      }
      new WizardDialog(getShell(), wiz).open();
      return null;
    case MODE_DELETE:
      new DeleteBranchDialog(getShell(), repository).open();
      return null;
    case MODE_RENAME:
      new RenameBranchDialog(getShell(), repository).open();
      return null;
    default:
      return null;
    }

    if (dialog.open() != Window.OK) {
      return null;
    }
    return dialog.getRefName();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.internal.dialogs.AbstractBranchSelectionDialog

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.