/*
* Created on 16/01/2007
*
* Swing Components - visit http://sf.net/projects/gfd
*
* Copyright (C) 2007 Igor Regis da Silva Simes
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
package br.com.gfpshare.beans;
import javax.swing.JComponent;
import javax.swing.JProgressBar;
public class PopupMessageView extends JComponent implements MessageView
{
private MessagePanel popMessagePanel = new PopupMessagePanel();
public void finishUse()
{
//------------------------------------------------
// TODO Auto-generated method stub
}
public void finishUse(long segundos)
{
//------------------------------------------------
// TODO Auto-generated method stub
}
public MessagePanel getMessagePanel()
{
return popMessagePanel;
}
public MessageView showMessage(String title, String message, boolean showProgress)
{
getMessagePanel().setMessage(message, showProgress);
return this;
}
private class PopupMessagePanel extends MultiLineToolTip implements MessagePanel
{
public PopupMessagePanel()
{
setOpaque(false);
}
/**
* A message can be appended to the view
*/
public void addMessage(String message)
{
setTipText(getTipText() + "\n" + message);
}
/**
* Set a message clearing the current one
* @param boolean popup has no effect here
*/
public void setMessage(String message, boolean popup)
{
setTipText(message);
}
/**
* We do not provide progress bar
* @deprecated
*/
@Deprecated
public JProgressBar getProgressBar()
{
return null;
}
/**
* We don't blink
* @deprecated
*/
@Deprecated
public void piscar(boolean popup)
{
}
/**
* We don't provide progress bar
* @deprecated
*/
@Deprecated
public void showProgress(boolean show)
{
}
}
}
|