Example usage for org.eclipse.jgit.api SubmoduleAddCommand setProgressMonitor

List of usage examples for org.eclipse.jgit.api SubmoduleAddCommand setProgressMonitor

Introduction

In this page you can find the example usage for org.eclipse.jgit.api SubmoduleAddCommand setProgressMonitor.

Prototype

public SubmoduleAddCommand setProgressMonitor(ProgressMonitor monitor) 

Source Link

Document

The progress monitor associated with the clone operation.

Usage

From source file:org.eclipse.egit.core.op.SubmoduleAddOperation.java

License:Open Source License

public void execute(IProgressMonitor monitor) throws CoreException {
    IWorkspaceRunnable action = new IWorkspaceRunnable() {

        public void run(IProgressMonitor pm) throws CoreException {
            final SubmoduleAddCommand add = Git.wrap(repo).submoduleAdd();
            add.setProgressMonitor(new EclipseGitProgressTransformer(pm));
            add.setPath(path);/*from   w w  w.j a va2s .c o  m*/
            add.setURI(uri);
            try {
                if (add.call() != null)
                    repo.notifyIndexChanged();
            } catch (GitAPIException e) {
                throw new TeamException(e.getLocalizedMessage(), e.getCause());
            }
        }
    };
    ResourcesPlugin.getWorkspace().run(action, monitor != null ? monitor : new NullProgressMonitor());
}