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 com
.intellij
.ide
.util
.importProject
;
18 import com
.intellij
.openapi
.progress
.ProcessCanceledException
;
19 import com
.intellij
.openapi
.progress
.ProgressIndicator
;
20 import org
.jetbrains
.annotations
.Nullable
;
23 * @author Eugene Zhuravlev
26 public class ProgressIndicatorWrapper
{
28 private final ProgressIndicator myIndicator
;
30 public ProgressIndicatorWrapper(@Nullable ProgressIndicator indicator
) {
31 myIndicator
= indicator
;
34 public boolean isCanceled() {
35 return myIndicator
!= null && myIndicator
.isCanceled();
38 public void setText(final String text
) {
39 if (myIndicator
!= null) {
40 myIndicator
.setText(text
);
44 public void setText2(final String text
) {
45 if (myIndicator
!= null) {
46 myIndicator
.setText2(text
);
50 public void setFraction(final double fraction
) {
51 if (myIndicator
!= null) {
52 myIndicator
.setFraction(fraction
);
56 public void pushState() {
57 if (myIndicator
!= null) {
58 myIndicator
.pushState();
62 public void popState() {
63 if (myIndicator
!= null) {
64 myIndicator
.popState();
68 public void setIndeterminate(final boolean indeterminate
) {
69 if (myIndicator
!= null) {
70 myIndicator
.setIndeterminate(indeterminate
);
74 public void checkCanceled() throws ProcessCanceledException
{
75 if (myIndicator
!= null) {
76 myIndicator
.checkCanceled();