当前位置: 首页>>代码示例>>Java>>正文


Java SVNCancelException类代码示例

本文整理汇总了Java中org.tmatesoft.svn.core.SVNCancelException的典型用法代码示例。如果您正苦于以下问题:Java SVNCancelException类的具体用法?Java SVNCancelException怎么用?Java SVNCancelException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SVNCancelException类属于org.tmatesoft.svn.core包,在下文中一共展示了SVNCancelException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildSvnEventHandler

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
private ISVNEventHandler buildSvnEventHandler ( String desc, BufferedWriter outputWriter ) {
	lineCount = 0;
	return new ISVNEventHandler() {

		@Override
		public void checkCancelled ()
				throws SVNCancelException {

		}

		@Override
		public void handleEvent ( SVNEvent event, double progress )
				throws SVNException {
			// logger.debug("progess: " + progress + " " + event);
			if ( event.getURL() == null && event.getFile() != null ) {
				updateProgress( outputWriter, desc + event.getFile().getName() );
			} else if ( event.getURL() != null ) {
				updateProgress( outputWriter, desc + event.getURL() );
			} else {
				updateProgress( outputWriter, desc + event );
			}
		}
	};
}
 
开发者ID:csap-platform,项目名称:csap-core,代码行数:25,代码来源:SourceControlManager.java

示例2: createStatusClient

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
public SVNStatusClient createStatusClient() {
  final SVNStatusClient result = myVcs.createStatusClient();
  result.setFilesProvider(myFileProvider);
  result.setEventHandler(new ISVNEventHandler() {
    public void handleEvent(SVNEvent event, double progress) throws SVNException {
      //
    }

    public void checkCancelled() throws SVNCancelException {
      if (myIndicator != null) {
        myIndicator.checkCanceled();
      }
    }
  });
  return result;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:StatusWalkerPartnerImpl.java

示例3: checkCancelled

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
public void checkCancelled() throws SVNCancelException {
  if (myCheckCancel && myProgress != null) {
    try {
      myProgress.checkCanceled();
    }
    catch (ProcessCanceledException ex) {
      throw new SVNCancelException();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:IdeaCommitHandler.java

示例4: checkCancelled

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
public void checkCancelled() throws SVNCancelException {
  if (myProgressIndicator != null) {
    myProgressIndicator.checkCanceled();
    if (myProgressIndicator.isCanceled()) {
      SVNErrorManager.cancel(SvnBundle.message("exception.text.update.operation.cancelled"), SVNLogType.DEFAULT);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:UpdateEventHandler.java

示例5: getWithPassiveImpl

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
private SVNAuthentication getWithPassiveImpl(SvnAuthenticationManager passive) throws SVNException {
  try {
    return passive.getFirstAuthentication(myKind, myRealm, myUrl);
  }
  catch (SVNCancelException e) {
    return null;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CredentialsAuthenticator.java

示例6: checkCancelled

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
public boolean checkCancelled() {
  if (!myWasCancelled && myCommand.getCanceller() != null) {
    try {
      myCommand.getCanceller().checkCancelled();
    }
    catch (SVNCancelException e) {
      // indicates command should be cancelled
      myWasCancelled = true;
    }
  }

  return myWasCancelled;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:CommandExecutor.java

示例7: createUpgradeHandler

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
private static ProgressTracker createUpgradeHandler(@NotNull final ProgressIndicator indicator,
                                                     @NotNull final String cleanupMessage,
                                                     @NotNull final String upgradeMessage) {
  return new ProgressTracker() {
    @Override
    public void consume(ProgressEvent event) throws SVNException {
      if (event.getFile() != null) {
        if (EventAction.UPGRADED_PATH.equals(event.getAction())) {
          indicator.setText2("Upgraded path " + VcsUtil.getPathForProgressPresentation(event.getFile()));
        }
        // fake event indicating cleanup start
        if (EventAction.UPDATE_STARTED.equals(event.getAction())) {
          indicator.setText(cleanupMessage);
        }
        // fake event indicating upgrade start
        if (EventAction.UPDATE_COMPLETED.equals(event.getAction())) {
          indicator.setText(upgradeMessage);
        }
      }
    }

    @Override
    public void checkCancelled() throws SVNCancelException {
      indicator.checkCanceled();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:SvnFormatWorker.java

示例8: createEventHandler

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
@NotNull
public ProgressTracker createEventHandler() {
  return new ProgressTracker() {
    @Override
    public void consume(ProgressEvent event) throws SVNException {
    }

    @Override
    public void checkCancelled() throws SVNCancelException {
      SvnRecursiveStatusWalker.this.checkCanceled();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:SvnRecursiveStatusWalker.java

示例9: checkCancelled

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
@Override
public void checkCancelled() throws SVNCancelException {
  final ProgressManager pm = ProgressManager.getInstance();
  final ProgressIndicator pi = pm.getProgressIndicator();
  if (pi != null) {
    if (pi.isCanceled()) throw new SVNCancelException();
  }
  ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
  if (indicator != null && indicator.isCanceled()) {
    throw new SVNCancelException();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:PrimitivePool.java

示例10: checkCancelled

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
public void checkCancelled() throws SVNCancelException {
  try {
    getRef().checkCancelled();
  } catch (ProcessCanceledException e) {
    throw new SVNCancelException();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:QuicklyDisposableISVNCanceller.java

示例11: checkCancelled

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
public void checkCancelled() throws SVNCancelException {
  if (cancelFlag) {
    cancelFlag = false;
    invokeLater(1); // reset progressBar
    throw new SVNCancelException();
  }
}
 
开发者ID:open744,项目名称:terramaster,代码行数:8,代码来源:Svn.java

示例12: doInBackground

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
private void doInBackground(Project project, VirtualFile vf, String url, boolean checkout, String target) {
  final SvnVcs vcs = SvnVcs.getInstance(project);
  try {
    final File ioFile = new File(vf.getPath());
    if (addToExternalProperty(vcs, ioFile, target, url)) return;
    final VcsDirtyScopeManager dirtyScopeManager = VcsDirtyScopeManager.getInstance(project);
    final FilePathImpl filePath = new FilePathImpl(ioFile, true);
    dirtyScopeManager.fileDirty(filePath);
    if (checkout) {
      // +-
      final SVNUpdateClient client = vcs.createUpdateClient();
      client.setEventHandler(new ISVNEventHandler() {
        @Override
        public void handleEvent(SVNEvent event, double progress) throws SVNException {
        }

        @Override
        public void checkCancelled() throws SVNCancelException {
          final ProgressIndicator pi = ProgressManager.getInstance().getProgressIndicator();
          if (pi != null && pi.isCanceled()) throw new SVNCancelException();
        }
      });
      client.doUpdate(ioFile, SVNRevision.HEAD, SVNDepth.UNKNOWN, false, false);
      vf.refresh(true, true, new Runnable() {
        @Override
        public void run() {
          dirtyScopeManager.dirDirtyRecursively(filePath);
        }
      });
    }
  }
  catch (SVNException e1) {
    AbstractVcsHelper.getInstance(project).showError(new VcsException(e1), "Create External");
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:36,代码来源:CreateExternalAction.java

示例13: checkCancelled

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
public void checkCancelled() throws SVNCancelException {
  final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
  if (indicator != null && indicator.isCanceled()) {
    throw new SVNCancelException();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:SvnProgressCanceller.java

示例14: checkCancelled

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
public void checkCancelled() throws SVNCancelException {
  if (myIndicator != null && myIndicator.isCanceled()) {
    throw new SVNCancelException(SVNErrorMessage.create(SVNErrorCode.CANCELLED, "Operation cancelled"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:CheckoutEventHandler.java

示例15: MyLogEntryHandler

import org.tmatesoft.svn.core.SVNCancelException; //导入依赖的package包/类
public MyLogEntryHandler(SvnVcs vcs, final String url,
                             final SVNRevision pegRevision,
                             String lastPath,
                             final ThrowableConsumer<VcsFileRevision, SVNException> result,
                             SVNURL repoRootURL, Charset charset)
      throws SVNException, VcsException {
      myVcs = vcs;
      myLastPathCorrector = new SvnPathThroughHistoryCorrection(lastPath);
      myLastPath = lastPath;
      myCharset = charset;
      myIndicator = ProgressManager.getInstance().getProgressIndicator();
      myResult = result;
      myPegRevision = pegRevision;
      myUrl = url;
      myRepositoryRoot = repoRootURL;
      myTracker = new SvnMergeSourceTracker(new ThrowableConsumer<Pair<LogEntry, Integer>, SVNException>() {
        @Override
        public void consume(final Pair<LogEntry, Integer> svnLogEntryIntegerPair) throws SVNException {
          final LogEntry logEntry = svnLogEntryIntegerPair.getFirst();

          if (myIndicator != null) {
            if (myIndicator.isCanceled()) {
              SVNErrorManager.cancel(SvnBundle.message("exception.text.update.operation.cancelled"), SVNLogType.DEFAULT);
            }
            myIndicator.setText2(SvnBundle.message("progress.text2.revision.processed", logEntry.getRevision()));
          }
          LogEntryPath entryPath = null;
          String copyPath = null;
          final int mergeLevel = svnLogEntryIntegerPair.getSecond();

          if (! myLastPathCorrector.isRoot()) {
            myLastPathCorrector.consume(logEntry);
            entryPath = myLastPathCorrector.getDirectlyMentioned();
            copyPath = null;
            if (entryPath != null) {
              copyPath = entryPath.getCopyPath();
            } else {
              // if there are no path with exact match, check whether parent or child paths had changed
              // "entry path" is allowed to be null now; if it is null, last path would be taken for revision construction

              // Separate LogEntry is issued for each "merge source" revision. These "merge source" revisions are treated as child
              // revisions of some other revision - this way we construct merge hierarchy.
              // mergeLevel >= 0 indicates that we are currently processing some "merge source" revision. This "merge source" revision
              // contains changes from some other branch - so checkForChildChanges() and checkForParentChanges() return "false".
              // Because of this case we apply these methods only for non-"merge source" revisions - this means mergeLevel < 0.
              // TODO: Do not apply path filtering even for log entries on the first level => just output of 'svn log' should be returned.
              // TODO: Looks like there is no cases when we issue 'svn log' for some parent paths or some other cases where we need such
              // TODO: filtering. Check user feedback on this.
//              if (mergeLevel < 0 && !checkForChildChanges(logEntry) && !checkForParentChanges(logEntry)) return;
            }
          }

          final SvnFileRevision revision = createRevision(logEntry, copyPath, entryPath);
          if (mergeLevel >= 0) {
            addToListByLevel((SvnFileRevision)myPrevious, revision, mergeLevel);
          }
          else {
            myResult.consume(revision);
            myPrevious = revision;
          }
          if (myThrowCancelOnMeetPathCreation && myUrl.equals(revision.getURL()) && entryPath != null && entryPath.getType() == 'A') {
            throw new SVNCancelException();
          }
        }

      });
    }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:68,代码来源:SvnHistoryProvider.java


注:本文中的org.tmatesoft.svn.core.SVNCancelException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。