2 * Copyright (C) 2007-2012 Argeo GmbH
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
.argeo
.eclipse
.ui
;
18 import org
.argeo
.jcr
.JcrMonitor
;
19 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
22 * Wraps an Eclipse {@link IProgressMonitor} so that it can be passed to
23 * framework agnostic Argeo routines.
25 public class EclipseJcrMonitor
implements JcrMonitor
{
26 private final IProgressMonitor progressMonitor
;
28 public EclipseJcrMonitor(IProgressMonitor progressMonitor
) {
29 this.progressMonitor
= progressMonitor
;
32 public void beginTask(String name
, int totalWork
) {
33 progressMonitor
.beginTask(name
, totalWork
);
37 progressMonitor
.done();
40 public boolean isCanceled() {
41 return progressMonitor
.isCanceled();
44 public void setCanceled(boolean value
) {
45 progressMonitor
.setCanceled(value
);
48 public void setTaskName(String name
) {
49 progressMonitor
.setTaskName(name
);
52 public void subTask(String name
) {
53 progressMonitor
.subTask(name
);
56 public void worked(int work
) {
57 progressMonitor
.worked(work
);