2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.jetbrains
.idea
.svn
.actions
;
18 import com
.intellij
.openapi
.progress
.ProgressIndicator
;
19 import org
.jetbrains
.idea
.svn
.SvnBundle
;
20 import org
.jetbrains
.idea
.svn
.SvnUtil
;
21 import org
.tmatesoft
.svn
.core
.wc
.ISVNEventHandler
;
22 import org
.tmatesoft
.svn
.core
.wc
.SVNEvent
;
23 import org
.tmatesoft
.svn
.core
.wc
.SVNEventAction
;
25 public class CopyEventHandler
implements ISVNEventHandler
{
26 private final ProgressIndicator myProgress
;
28 public CopyEventHandler(ProgressIndicator progress
) {
29 myProgress
= progress
;
32 public void handleEvent(SVNEvent event
, double p
) {
33 final String path
= SvnUtil
.getPathForProgress(event
);
37 if (event
.getAction() == SVNEventAction
.COMMIT_ADDED
) {
38 myProgress
.setText2(SvnBundle
.message("progress.text2.adding", path
));
40 else if (event
.getAction() == SVNEventAction
.COMMIT_DELETED
) {
41 myProgress
.setText2(SvnBundle
.message("progress.text2.deleting", path
));
43 else if (event
.getAction() == SVNEventAction
.COMMIT_MODIFIED
) {
44 myProgress
.setText2(SvnBundle
.message("progress.text2.sending", path
));
46 else if (event
.getAction() == SVNEventAction
.COMMIT_REPLACED
) {
47 myProgress
.setText2(SvnBundle
.message("progress.text2.replacing", path
));
49 else if (event
.getAction() == SVNEventAction
.COMMIT_DELTA_SENT
) {
50 myProgress
.setText2(SvnBundle
.message("progress.text2.transmitting.delta", path
));
54 public void checkCancelled() {