Package org.eclipse.egit.ui.internal.repository.tree

Examples of org.eclipse.egit.ui.internal.repository.tree.RemoteNode


      Set<String> configNames = rep.getConfig().getSubsections(
          RepositoriesView.REMOTE);

      for (String configName : configNames) {
        remotes.add(new RemoteNode(node, repo, configName));
      }

      return remotes.toArray();
    }
View Full Code Here


* Removes a remote
*/
public class RemoveRemoteCommand extends
    RepositoriesViewCommandHandler<RemoteNode> {
  public Object execute(ExecutionEvent event) throws ExecutionException {
    final RemoteNode node = getSelectedNodes(event).get(0);
    final String configName = node.getObject();

    boolean ok = MessageDialog.openConfirm(getShell(event),
        UIText.RepositoriesView_ConfirmDeleteRemoteHeader, NLS.bind(
            UIText.RepositoriesView_ConfirmDeleteRemoteMessage,
            configName));
    if (ok) {
      StoredConfig config = node.getRepository().getConfig();
      config.unsetSection(RepositoriesView.REMOTE, configName);
      try {
        config.save();
      } catch (IOException e1) {
        Activator.handleError(UIText.RepositoriesView_ErrorHeader, e1,
View Full Code Here

  private RemoteConfig getRemoteConfig(RepositoryTreeNode node)
      throws ExecutionException {
    if (node instanceof FetchNode)
      try {
        RemoteNode remote = (RemoteNode) node.getParent();
        return  new RemoteConfig(node.getRepository().getConfig(),
            remote.getObject());
      } catch (URISyntaxException e) {
        throw new ExecutionException(e.getMessage());
      }

    if (node instanceof RemoteNode)
      try {
        RemoteNode remote = (RemoteNode) node;
        return new RemoteConfig(node.getRepository().getConfig(),
            remote.getObject());
      } catch (URISyntaxException e) {
        throw new ExecutionException(e.getMessage());
      }

    if (node instanceof RepositoryNode)
View Full Code Here

  private static final String PUSHURL = "pushurl"; //$NON-NLS-1$

  public Object execute(ExecutionEvent event) throws ExecutionException {
    FetchNode node = getSelectedNodes(event).get(0);
    RemoteNode remote = (RemoteNode) node.getParent();

    StoredConfig config = node.getRepository().getConfig();
    String fetchUrl = config.getString(REMOTE, remote.getObject(), URL);
    config.unset(REMOTE, remote.getObject(), FETCH);
    config.unset(REMOTE, remote.getObject(), URL);
    // the push URL may still be needed for fetch
    if (fetchUrl != null) {
      boolean hasPush = config.getStringList(REMOTE, remote.getObject(),
          PUSH).length > 0;
      if (hasPush) {
        String[] pushurls = config.getStringList(REMOTE, remote
            .getObject(), PUSHURL);
        // if there are not specific push urls,
        // copy the former fetch url into push url
        if (pushurls.length == 0)
          config.setString(REMOTE, remote.getObject(), PUSHURL,
              fetchUrl);
      }
    }

    try {
View Full Code Here

*/
public class ConfigureGerritRemoteCommand extends
    RepositoriesViewCommandHandler<RemoteNode> {

  public Object execute(ExecutionEvent event) throws ExecutionException {
    final RemoteNode node = getSelectedNodes(event).get(0);
    Repository repository = node.getRepository();
    final String remoteName = node.getObject();

    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
        .getShell();
    ConfigureGerritWizard configureGerritWizard = new ConfigureGerritWizard(
        repository, remoteName);
View Full Code Here

    if (node instanceof RepositoryNode)
      return SimpleConfigurePushDialog.getConfiguredRemote(node
          .getRepository());

    if (node instanceof RemoteNode || node instanceof PushNode) {
      RemoteNode remoteNode;
      if (node instanceof PushNode)
        remoteNode = (RemoteNode) node.getParent();
      else
        remoteNode = (RemoteNode) node;

      try {
        RemoteConfig config = new RemoteConfig(remoteNode
            .getRepository().getConfig(), remoteNode.getObject());
        boolean fetchConfigured = !config.getFetchRefSpecs().isEmpty();
        boolean pushConfigured = !config.getPushRefSpecs().isEmpty();
        if (fetchConfigured || pushConfigured)
          return config;
        else
View Full Code Here

* Deletes the Push
*/
public class DeletePushCommand extends RepositoriesViewCommandHandler<PushNode> {
  public Object execute(ExecutionEvent event) throws ExecutionException {
    PushNode node = getSelectedNodes(event).get(0);
    RemoteNode remote = (RemoteNode) node.getParent();
    StoredConfig config = node.getRepository().getConfig();
    config.unset("remote", remote.getObject(), "pushurl"); //$NON-NLS-1$ //$NON-NLS-2$
    config.unset("remote", remote.getObject(), "push"); //$NON-NLS-1$ //$NON-NLS-2$
    try {
      config.save();
    } catch (IOException e1) {
      Activator.handleError(e1.getMessage(), e1, true);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.internal.repository.tree.RemoteNode

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.