01: /*
02: * Created on 16/01/2007
03: *
04: * Swing Components - visit http://sf.net/projects/gfd
05: *
06: * Copyright (C) 2007 Igor Regis da Silva Simões
07: *
08: * This program is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public License
10: * as published by the Free Software Foundation; either version 2
11: * of the License, or (at your option) any later version.
12: *
13: * This program is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * GNU General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public License
19: * along with this program; if not, write to the Free Software
20: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21: *
22: */
23: package br.com.igor.beans;
24:
25: import javax.swing.JComponent;
26: import javax.swing.JProgressBar;
27:
28: public class PopupMessageView extends JComponent implements MessageView {
29:
30: private MessagePanel popMessagePanel = new PopupMessagePanel();
31:
32: public void finishUse() {
33: //------------------------------------------------
34: // TODO Auto-generated method stub
35:
36: }
37:
38: public void finishUse(long segundos) {
39: //------------------------------------------------
40: // TODO Auto-generated method stub
41:
42: }
43:
44: public MessagePanel getMessagePanel() {
45: return popMessagePanel;
46: }
47:
48: public MessageView showMessage(String title, String message,
49: boolean showProgress) {
50: getMessagePanel().setMessage(message, showProgress);
51: return this ;
52: }
53:
54: private class PopupMessagePanel extends MultiLineToolTip implements
55: MessagePanel {
56: public PopupMessagePanel() {
57: setOpaque(false);
58: }
59:
60: /**
61: * A message can be appended to the view
62: */
63: public void addMessage(String message) {
64: setTipText(getTipText() + "\n" + message);
65: }
66:
67: /**
68: * Set a message clearing the current one
69: * @param boolean popup has no effect here
70: */
71: public void setMessage(String message, boolean popup) {
72: setTipText(message);
73: }
74:
75: /**
76: * We do not provide progress bar
77: * @deprecated
78: */
79: public JProgressBar getProgressBar() {
80: return null;
81: }
82:
83: /**
84: * We don't blink
85: * @deprecated
86: */
87: public void piscar(boolean popup) {
88: }
89:
90: /**
91: * We don't provide progress bar
92: * @deprecated
93: */
94: public void showProgress(boolean show) {
95: }
96:
97: }
98: }
|