Search in sources :

Example 1 with PullOperationUI

use of org.eclipse.egit.ui.internal.pull.PullOperationUI in project dbeaver by serge-rider.

the class GITUpdateHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    Repository[] repos = this.getRepositories(event);
    if (ArrayUtils.isEmpty(repos)) {
        return null;
    } else {
        Set<Repository> repositories = new LinkedHashSet<>(Arrays.asList(repos));
        PullOperationUI pullOperationUI = new PullOperationUI(repositories);
        pullOperationUI.start();
        return null;
    }
}
Also used : LinkedHashSet(java.util.LinkedHashSet) Repository(org.eclipse.jgit.lib.Repository) PullOperationUI(org.eclipse.egit.ui.internal.pull.PullOperationUI)

Example 2 with PullOperationUI

use of org.eclipse.egit.ui.internal.pull.PullOperationUI in project dbeaver by dbeaver.

the class GITUpdateHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    Repository[] repos = this.getRepositories(event);
    if (ArrayUtils.isEmpty(repos)) {
        return null;
    } else {
        Set<Repository> repositories = new LinkedHashSet<>(Arrays.asList(repos));
        PullOperationUI pullOperationUI = new PullOperationUI(repositories);
        pullOperationUI.start();
        return null;
    }
}
Also used : LinkedHashSet(java.util.LinkedHashSet) Repository(org.eclipse.jgit.lib.Repository) PullOperationUI(org.eclipse.egit.ui.internal.pull.PullOperationUI)

Example 3 with PullOperationUI

use of org.eclipse.egit.ui.internal.pull.PullOperationUI in project egit by eclipse.

the class PullAction method getSubscriberOperation.

@Override
protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
    return new SynchronizeModelOperation(configuration, elements) {

        @Override
        public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            GitSynchronizeDataSet gsds = (GitSynchronizeDataSet) getConfiguration().getProperty(SYNCHRONIZATION_DATA);
            Set<Repository> repositories = new HashSet<>();
            for (GitSynchronizeData gsd : gsds) repositories.add(gsd.getRepository());
            PullOperationUI pull = new PullOperationUI(repositories);
            pull.execute(monitor);
        }
    };
}
Also used : SynchronizeModelOperation(org.eclipse.team.ui.synchronize.SynchronizeModelOperation) GitSynchronizeData(org.eclipse.egit.core.synchronize.dto.GitSynchronizeData) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) Repository(org.eclipse.jgit.lib.Repository) GitSynchronizeDataSet(org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet) PullOperationUI(org.eclipse.egit.ui.internal.pull.PullOperationUI) HashSet(java.util.HashSet)

Example 4 with PullOperationUI

use of org.eclipse.egit.ui.internal.pull.PullOperationUI in project egit by eclipse.

the class PullFromUpstreamActionHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    Repository[] repos = getRepositories(event);
    if (repos.length == 0)
        return null;
    Set<Repository> repositories = new LinkedHashSet<>(Arrays.asList(repos));
    new PullOperationUI(repositories).start();
    return null;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) Repository(org.eclipse.jgit.lib.Repository) PullOperationUI(org.eclipse.egit.ui.internal.pull.PullOperationUI)

Aggregations

PullOperationUI (org.eclipse.egit.ui.internal.pull.PullOperationUI)4 Repository (org.eclipse.jgit.lib.Repository)4 LinkedHashSet (java.util.LinkedHashSet)3 HashSet (java.util.HashSet)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 GitSynchronizeData (org.eclipse.egit.core.synchronize.dto.GitSynchronizeData)1 GitSynchronizeDataSet (org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet)1 SynchronizeModelOperation (org.eclipse.team.ui.synchronize.SynchronizeModelOperation)1