Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.URIish


  public boolean performFinish() {
    try {
      AddRemotePage remotePage = getAddRemotePage();
      if (remotePage != null) {
        storeCredentials(remotePage);
        URIish uri = remotePage.getSelection().getURI();
        configureNewRemote(uri);
      }
      if (pushBranchPage.isConfigureUpstreamSelected())
        configureUpstream();
      startPush();
View Full Code Here


    return Arrays.asList(refSpec);
  }

  private void storeCredentials(AddRemotePage remotePage) {
    if (remotePage.getStoreInSecureStore()) {
      URIish uri = remotePage.getSelection().getURI();
      if (uri != null)
        SecureStoreUtils.storeCredentials(
            remotePage.getCredentials(), uri);
    }
  }
View Full Code Here

                InterruptedException {
              ListRemoteOperation listOp;
              try {
                listOp = new ListRemoteOperation(
                    repository,
                    new URIish(uriText),
                    Activator
                        .getDefault()
                        .getPreferenceStore()
                        .getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT));
              } catch (URISyntaxException e) {
View Full Code Here

    String taskName = NLS
        .bind(UIText.FetchGerritChangePage_FetchingTaskName,
            spec.getSource());
    monitor.setTaskName(taskName);
    FetchResult fetchRes = new FetchOperationUI(repository,
        new URIish(uri), specs, timeout, false).execute(monitor);

    monitor.worked(1);
    return new RevWalk(repository).parseCommit(fetchRes.getAdvertisedRef(
        spec.getSource()).getObjectId());
  }
View Full Code Here

        else
          wiz = new SelectUriWizard(false);
        if (new WizardDialog(getShell(), wiz).open() == Window.OK) {
          if (commonUriText.getText().length() > 0)
            try {
              config.removeURI(new URIish(commonUriText.getText()));
            } catch (URISyntaxException ex) {
              Activator.handleError(ex.getMessage(), ex, true);
            }
          config.addURI(wiz.getUri());
          updateControls();
        }
      }
    });

    deleteCommonUri = new Button(sameUriDetails, SWT.PUSH);
    deleteCommonUri
        .setText(UIText.SimpleConfigurePushDialog_DeleteUriButton);
    deleteCommonUri.setEnabled(false);
    deleteCommonUri.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        config.removeURI(config.getURIs().get(0));
        updateControls();
      }
    });

    commonUriText.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        deleteCommonUri
            .setEnabled(commonUriText.getText().length() > 0);
      }
    });

    ExpandableComposite pushUriArea = new ExpandableComposite(main,
        ExpandableComposite.TREE_NODE
            | ExpandableComposite.CLIENT_INDENT);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(pushUriArea);
    pushUriArea.setExpanded(!config.getPushURIs().isEmpty());
    pushUriArea.addExpansionListener(new ExpansionAdapter() {

      public void expansionStateChanged(ExpansionEvent e) {
        main.layout(true, true);
        main.getShell().pack();
      }
    });
    pushUriArea.setText(UIText.SimpleConfigurePushDialog_PushUrisLabel);
    final Composite pushUriDetails = new Composite(pushUriArea, SWT.NONE);
    pushUriArea.setClient(pushUriDetails);
    pushUriDetails.setLayout(new GridLayout(2, false));
    GridDataFactory.fillDefaults().grab(true, true).applyTo(pushUriDetails);
    uriViewer = new TableViewer(pushUriDetails, SWT.BORDER | SWT.MULTI);
    GridDataFactory.fillDefaults().grab(true, true)
        .minSize(SWT.DEFAULT, 30).applyTo(uriViewer.getTable());
    uriViewer.setContentProvider(ArrayContentProvider.getInstance());

    final Composite uriButtonArea = new Composite(pushUriDetails, SWT.NONE);
    GridLayoutFactory.fillDefaults().applyTo(uriButtonArea);
    GridDataFactory.fillDefaults().grab(false, true).applyTo(uriButtonArea);

    Button addUri = new Button(uriButtonArea, SWT.PUSH);
    addUri.setText(UIText.SimpleConfigurePushDialog_AddPushUriButton);
    GridDataFactory.fillDefaults().applyTo(addUri);
    addUri.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        SelectUriWizard wiz = new SelectUriWizard(false);
        if (new WizardDialog(getShell(), wiz).open() == Window.OK) {
          config.addPushURI(wiz.getUri());
          updateControls();
        }
      }

    });

    final Button changeUri = new Button(uriButtonArea, SWT.PUSH);
    changeUri.setText(UIText.SimpleConfigurePushDialog_ChangePushUriButton);
    GridDataFactory.fillDefaults().applyTo(changeUri);
    changeUri.setEnabled(false);
    changeUri.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        URIish uri = (URIish) ((IStructuredSelection) uriViewer
            .getSelection()).getFirstElement();
        SelectUriWizard wiz = new SelectUriWizard(false, uri
            .toPrivateString());
        if (new WizardDialog(getShell(), wiz).open() == Window.OK) {
          config.removePushURI(uri);
          config.addPushURI(wiz.getUri());
          updateControls();
        }
      }
    });
    final Button deleteUri = new Button(uriButtonArea, SWT.PUSH);
    deleteUri.setText(UIText.SimpleConfigurePushDialog_DeletePushUriButton);
    GridDataFactory.fillDefaults().applyTo(deleteUri);
    deleteUri.setEnabled(false);
    deleteUri.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        URIish uri = (URIish) ((IStructuredSelection) uriViewer
            .getSelection()).getFirstElement();
        config.removePushURI(uri);
        updateControls();
      }
    });
View Full Code Here

  private String getResult(RefUpdateElement element) {
    StringBuilder result = new StringBuilder(EMPTY_STRING);
    PushOperationResult pushOperationResult = element
        .getPushOperationResult();
    final URIish uri = element.getUri();
    result.append(UIText.PushResultTable_repository);
    result.append(SPACE);
    result.append(uri.toString());
    result.append(Text.DELIMITER);
    result.append(Text.DELIMITER);
    String message = element.getRemoteRefUpdate().getMessage();
    if (message != null)
      result.append(message).append(Text.DELIMITER);
View Full Code Here

        else
          wiz = new SelectUriWizard(true);
        if (new WizardDialog(getShell(), wiz).open() == Window.OK) {
          if (commonUriText.getText().length() > 0)
            try {
              config.removeURI(new URIish(commonUriText.getText()));
            } catch (URISyntaxException ex) {
              Activator.handleError(ex.getMessage(), ex, true);
            }
          config.addURI(wiz.getUri());
          updateControls();
View Full Code Here

  }

  private void revalidateImpl(final RepositorySelection newRepoSelection) {
    final ListRemoteOperation listRemotesOp;
    try {
      final URIish uri;
      uri = newRepoSelection.getURI(pushPage);
      int timeout = Activator.getDefault().getPreferenceStore().getInt(
          UIPreferences.REMOTE_CONNECTION_TIMEOUT);
      listRemotesOp = new ListRemoteOperation(local, uri, timeout);
      if (credentials != null)
View Full Code Here

  private void showNewRemoteDialog() {
    AddRemoteWizard wizard = new AddRemoteWizard(repository);
    WizardDialog dialog = new WizardDialog(getShell(), wizard);
    int result = dialog.open();
    if (result == Window.OK) {
      URIish uri = wizard.getUri();
      String remoteName = wizard.getRemoteName();
      addRemotePage = wizard.getAddRemotePage();
      setSelectedRemote(remoteName, uri);
    }
  }
View Full Code Here

    return sourceText.getText();
  }

  private List<Ref> getRemoteRefs() {
    if (remoteRefs == null) {
      URIish uriToCheck;
      List<Ref> proposals = new ArrayList<Ref>();
      uriToCheck = config.getURIs().get(0);
      final ListRemoteOperation lop = new ListRemoteOperation(repository,
          uriToCheck, Activator.getDefault().getPreferenceStore()
              .getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT));
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.URIish

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.