Update git submodules
[LibreOffice.git] / framework / qa / complex / loadAllDocuments / StatusIndicator.java
blobc1edbffd1e1ba19a51d6577ffa867a0ec92c558a
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 package complex.loadAllDocuments;
20 // __________ Imports __________
24 // __________ Implementation __________
26 /**
27 * Implements a simple status indicator, which
28 * provide information about state of a load request.
29 * It can be used as an argument e.g. for loadComponentFromURL().
31 public class StatusIndicator implements com.sun.star.task.XStatusIndicator
34 private boolean m_bWasUsed ;
38 /**
39 * ctor
40 * It's initialize an object of this class with default values.
42 public StatusIndicator()
44 m_bWasUsed = false;
49 /**
50 * It starts the progress and set the initial text and range.
52 * @param sText
53 * the initial text for showing
55 * @param nRange
56 * the new range for following progress
58 public void start( /*IN*/String sText, /*IN*/int nRange )
60 synchronized(this)
62 m_bWasUsed = true;
64 impl_show();
69 /**
70 * Finish the progress and reset internal members.
72 public void end()
74 synchronized(this)
76 m_bWasUsed = true;
78 impl_show();
83 /**
84 * Set the new description text.
86 * @param sText
87 * the new text for showing
89 public void setText( /*IN*/String sText )
91 synchronized(this)
93 m_bWasUsed = true;
95 impl_show();
101 * Set the new progress value.
103 * @param nValue
104 * the new progress value
105 * Must fit the range!
107 public void setValue( /*IN*/int nValue )
109 synchronized(this)
111 m_bWasUsed = true;
113 impl_show();
119 * Reset text and progress value to her defaults.
121 public void reset()
123 synchronized(this)
125 m_bWasUsed = true;
127 impl_show();
133 * Internal helper to show the status.
134 * Currently it's implement as normal text out on stdout.
135 * But of course other things are possible here too.
136 * e.g. a dialog
138 private void impl_show()
142 public boolean wasUsed() {
143 return m_bWasUsed;