Javadoc fixes and using superclass when injecting WindowFocusListener
This commit is contained in:
parent
6cf8c462b9
commit
8247e18fce
@ -49,7 +49,7 @@ public class LocalDB {
|
||||
/**
|
||||
* Constructs an empty local database.
|
||||
*
|
||||
* @param client the user that is logged in with this client
|
||||
* @param sender the user that is logged in with this client
|
||||
* @since Envoy v0.1-alpha
|
||||
*/
|
||||
public LocalDB(User sender) {
|
||||
@ -118,7 +118,9 @@ public class LocalDB {
|
||||
* Creates a {@link Message} object serializable to XML.
|
||||
*
|
||||
* @param textContent The content (text) of the message
|
||||
* @param recipient The recipient of the message
|
||||
* @return prepared {@link Message} object
|
||||
* @since Envoy v0.1-alpha
|
||||
*/
|
||||
public Message createMessage(String textContent, User recipient) {
|
||||
Message.Metadata metaData = objectFactory.createMessageMetadata();
|
||||
|
@ -8,6 +8,7 @@ import java.awt.SystemTray;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.TrayIcon;
|
||||
import java.awt.TrayIcon.MessageType;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.util.HashSet;
|
||||
@ -47,10 +48,13 @@ public class StatusTrayIcon implements EventHandler {
|
||||
* Creates a {@link StatusTrayIcon} with the Envoy logo, a tool tip and a pop-up
|
||||
* menu.
|
||||
*
|
||||
* @param focusTarget the {@link Window} which focus determines if message
|
||||
* notifications are displayed
|
||||
* @throws EnvoyException if the currently used OS does not support the System
|
||||
* Tray API
|
||||
* @since Envoy v0.2-alpha
|
||||
*/
|
||||
public StatusTrayIcon(ChatWindow chatWindow) throws EnvoyException {
|
||||
public StatusTrayIcon(Window focusTarget) throws EnvoyException {
|
||||
if (!SystemTray.isSupported()) throw new EnvoyException("The Envoy tray icon is not supported.");
|
||||
|
||||
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
@ -68,7 +72,7 @@ public class StatusTrayIcon implements EventHandler {
|
||||
trayIcon.setPopupMenu(popup);
|
||||
|
||||
// Only display messages if the chat window is not focused
|
||||
chatWindow.addWindowFocusListener(new WindowAdapter() {
|
||||
focusTarget.addWindowFocusListener(new WindowAdapter() {
|
||||
|
||||
@Override
|
||||
public void windowGainedFocus(WindowEvent e) {
|
||||
|
Reference in New Issue
Block a user