本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNWCClient.setEventHandler方法的典型用法代码示例。如果您正苦于以下问题:Java SVNWCClient.setEventHandler方法的具体用法?Java SVNWCClient.setEventHandler怎么用?Java SVNWCClient.setEventHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tmatesoft.svn.core.wc.SVNWCClient
的用法示例。
在下文中一共展示了SVNWCClient.setEventHandler方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: add
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入方法依赖的package包/类
/**
* TODO: Implement correct support for includeIgnored parameter. Also check that correct depth will be used for all cases (when another
* TODO: overload of doAdd() is used) as, for instance, SVNDepth.recurseFromDepth(EMPTY) = false, SVNDepth.fromRecursive(false) = FILES.
*/
@Override
public void add(@NotNull File file,
@Nullable Depth depth,
boolean makeParents,
boolean includeIgnored,
boolean force,
@Nullable ProgressTracker handler) throws VcsException {
try {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
client.doAdd(file, force,
false, // directory should already be created
makeParents, // not used but will be passed as makeParents value
Depth.isRecursive(depth));
}
catch (SVNException e) {
throw new VcsException(e);
}
}
示例2: upgrade
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入方法依赖的package包/类
@Override
public void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ProgressTracker handler) throws VcsException {
validateFormat(format, getSupportedFormats());
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
try {
cleanupIfNecessary(path, format, client, handler);
upgrade(path, format, client, handler);
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}
示例3: revert
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入方法依赖的package包/类
@Override
public void revert(@NotNull Collection<File> paths, @Nullable Depth depth, @Nullable ProgressTracker handler) throws VcsException {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
try {
client.doRevert(ArrayUtil.toObjectArray(paths, File.class), toDepth(depth), null);
}
catch (SVNException e) {
throw new VcsException(e);
}
}
示例4: delete
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入方法依赖的package包/类
@Override
public void delete(@NotNull File path, boolean force, boolean dryRun, @Nullable ProgressTracker handler) throws VcsException {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
try {
client.doDelete(path, force, dryRun);
}
catch (SVNException e) {
throw new VcsException(e);
}
}
示例5: cleanup
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入方法依赖的package包/类
@Override
public void cleanup(@NotNull File path, @Nullable ProgressTracker handler) throws VcsException {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
try {
client.doCleanup(path);
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}
示例6: getClient
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入方法依赖的package包/类
@NotNull
private SVNWCClient getClient(@Nullable ProgressTracker handler) {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
return client;
}
示例7: run
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入方法依赖的package包/类
public void run(@NotNull final ProgressIndicator indicator) {
ProjectLevelVcsManager.getInstanceChecked(myProject).startBackgroundVcsOperation();
indicator.setIndeterminate(true);
final boolean supportsChangelists = myNewFormat.supportsChangelists();
if (supportsChangelists) {
myBeforeChangeLists = ChangeListManager.getInstance(myProject).getChangeListsCopy();
}
final SVNWCClient wcClient = myVcs.createWCClient();
wcClient.setEventHandler(new ISVNEventHandler() {
@Override
public void handleEvent(SVNEvent event, double progress) throws SVNException {
if (SVNEventAction.UPGRADED_PATH.equals(event.getAction()) && event.getFile() != null) {
indicator.setText2("Upgraded path " + VcsUtil.getPathForProgressPresentation(event.getFile()));
}
}
@Override
public void checkCancelled() throws SVNCancelException {
indicator.checkCanceled();
}
});
try {
for (WCInfo wcInfo : myWcInfos) {
File path = new File(wcInfo.getPath());
if (! wcInfo.isIsWcRoot()) {
path = SvnUtil.getWorkingCopyRoot(path);
}
try {
if (WorkingCopyFormat.ONE_DOT_SEVEN.equals(myNewFormat)) {
indicator.setText(SvnBundle.message("action.Subversion.cleanup.progress.text", path.getAbsolutePath()));
wcClient.doCleanup(path);
}
indicator.setText(SvnBundle.message("action.change.wcopy.format.task.progress.text", path.getAbsolutePath(),
SvnUtil.formatRepresentation(wcInfo.getFormat()), SvnUtil.formatRepresentation(myNewFormat)));
wcClient.doSetWCFormat(path, myNewFormat.getFormat());
} catch (Throwable e) {
myExceptions.add(e);
}
}
}
finally {
ProjectLevelVcsManager.getInstance(myProject).stopBackgroundVcsOperation();
// to map to native
if (supportsChangelists) {
SvnVcs.getInstance(myProject).processChangeLists(myBeforeChangeLists);
}
ApplicationManager.getApplication().getMessageBus().syncPublisher(SvnVcs.WC_CONVERTED).run();
}
}