Package org.eclipse.egit.core.op

Examples of org.eclipse.egit.core.op.SubmoduleAddOperation


    AddSubmoduleWizard wizard = new AddSubmoduleWizard(repo);
    WizardDialog dialog = new WizardDialog(getShell(event), wizard);
    if (dialog.open() == Window.OK) {
      final String path = wizard.getPath();
      final String uri = wizard.getUri().toPrivateASCIIString();
      final SubmoduleAddOperation op = new SubmoduleAddOperation(repo,
          path, uri);
      Job job = new WorkspaceJob(MessageFormat.format(
          UIText.SubmoduleAddCommand_JobTitle, path, uri)) {

        @Override
        public IStatus runInWorkspace(IProgressMonitor monitor) {
          monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
          try {
            op.execute(monitor);
          } catch (CoreException e) {
            Activator.logError(UIText.SubmoduleAddCommand_AddError,
                e);
          }
          return Status.OK_STATUS;
        }

        @Override
        public boolean belongsTo(Object family) {
          if (JobFamilies.SUBMODULE_ADD.equals(family))
            return true;
          return super.belongsTo(family);
        }
      };
      job.setUser(true);
      job.setRule(op.getSchedulingRule());
      job.schedule();
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.op.SubmoduleAddOperation

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.