SPARK-1296 added the ChatFramToFrontListener to fix build ;)

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12281 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Holger Bergunde
2011-04-26 14:29:30 +00:00
committed by holger.bergunde
parent fae878b7e5
commit fd7a7aa36e
3 changed files with 25 additions and 3 deletions

View File

@ -55,7 +55,7 @@ public class ChatFrame extends JFrame implements WindowFocusListener {
private boolean focused; private boolean focused;
private JCheckBox alwaysOnTopItem; private JCheckBox alwaysOnTopItem;
private ChatFrame chatFrame = this; private ChatFrame chatFrame = this;
private Collection<ChatFrameToFronListener> _windowToFrontListeners = new ArrayList<ChatFrameToFronListener>(); private Collection<ChatFrameToFrontListener> _windowToFrontListeners = new ArrayList<ChatFrameToFrontListener>();
/** /**
* Creates default ChatFrame. * Creates default ChatFrame.
@ -252,7 +252,7 @@ public class ChatFrame extends JFrame implements WindowFocusListener {
private void fireWindowOnTopListeners(boolean active) { private void fireWindowOnTopListeners(boolean active) {
for (ChatFrameToFronListener fl: _windowToFrontListeners) for (ChatFrameToFrontListener fl: _windowToFrontListeners)
{ {
fl.updateStatus(active); fl.updateStatus(active);
} }

View File

@ -0,0 +1,22 @@
package org.jivesoftware.spark.ui;
/**
* Interface for all chatroom that get triggered if another chatroom or part of spark changes if the chat frame should always stay on top
* (Observer Pattern)
* @author Holger Bergunde
*
*/
public interface ChatFrameToFrontListener {
/**
* Update. From now on the chat frame will stay on top, or not
* @param active
*/
void updateStatus(boolean active);
/**
* the observer should register on this chatframe component
* @param chatframe
*/
void registeredToFrame(ChatFrame chatframe);
}

View File

@ -84,7 +84,7 @@ import org.jivesoftware.sparkimpl.settings.local.SettingsManager;
/** /**
* The base implementation of all ChatRoom conversations. You would implement this class to have most types of Chat. * The base implementation of all ChatRoom conversations. You would implement this class to have most types of Chat.
*/ */
public abstract class ChatRoom extends BackgroundPanel implements ActionListener, PacketListener, DocumentListener, ConnectionListener, FocusListener, ContextMenuListener, ChatFrameToFronListener { public abstract class ChatRoom extends BackgroundPanel implements ActionListener, PacketListener, DocumentListener, ConnectionListener, FocusListener, ContextMenuListener, ChatFrameToFrontListener {
private static final long serialVersionUID = 7981019929515888299L; private static final long serialVersionUID = 7981019929515888299L;
private final JPanel chatPanel; private final JPanel chatPanel;
private final JSplitPane splitPane; private final JSplitPane splitPane;