001 /*
002 * Copyright 2002-2007 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005 * use this file except in compliance with the License. You may obtain a copy of
006 * the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013 * License for the specific language governing permissions and limitations under
014 * the License.
015 */
016 package org.springframework.richclient.application.statusbar;
017
018 import org.springframework.richclient.core.Message;
019 import org.springframework.richclient.factory.ControlFactory;
020 import org.springframework.richclient.progress.ProgressMonitor;
021
022 /**
023 * StatusBar abstraction.
024 *
025 * @author Peter De Bruycker
026 */
027 public interface StatusBar extends ControlFactory {
028 /**
029 * Returns the <code>ProgressMonitor</code> in use by this
030 * <code>StatusBar</code>
031 *
032 * @return the progress monitor
033 */
034 ProgressMonitor getProgressMonitor();
035
036 /**
037 * Sets the message of this status bar.
038 *
039 * @param message
040 * the message, <code>null</code> clears the message
041 */
042 void setMessage(String message);
043
044 /**
045 * Sets the message of this status bar.
046 *
047 * @param message
048 * the message, <code>null</code> clears the message
049 */
050 void setMessage(Message message);
051
052 /**
053 * Sets the error message of this status bar.
054 * <p>
055 * An error message is usualy painted in another color,
056 * <code>StatusBar</code> implementations are free to choose the way they
057 * display the error message
058 *
059 * @param message
060 * the error message, <code>null</code> clears the error
061 * message
062 */
063 void setErrorMessage(String message);
064
065 /**
066 * Sets the error message of this status bar.
067 * <p>
068 * An error message is usualy painted in another color,
069 * <code>StatusBar</code> implementations are free to choose the way they
070 * display the error message
071 *
072 * @param message
073 * the error message, <code>null</code> clears the error
074 * message
075 */
076 void setErrorMessage(Message message);
077
078 /**
079 * Sets the visible state of this status bar.
080 *
081 * @param visible
082 * true or false
083 */
084 void setVisible(boolean visible);
085
086 /**
087 * Provides a hint whether the current running operation can be canceled.
088 *
089 * @param enabled
090 * true or false
091 */
092 void setCancelEnabled(boolean enabled);
093
094 /**
095 * Clears the messages of this status bar.
096 */
097 void clear();
098 }