//# 0 errors, 196 messages
//#
/*
    //#SystrayPlugin.java:1:1: class: com.dmdirc.addons.systray.SystrayPlugin
    //#SystrayPlugin.java:1:1: method: com.dmdirc.addons.systray.SystrayPlugin.com.dmdirc.addons.systray.SystrayPlugin__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.addons.systray;

import com.dmdirc.ui.IconManager;
import com.dmdirc.Main;
import com.dmdirc.actions.ActionManager;
import com.dmdirc.actions.interfaces.ActionType;
import com.dmdirc.actions.CoreActionType;
import com.dmdirc.addons.ui_swing.MainFrame;
import com.dmdirc.config.IdentityManager;
import com.dmdirc.config.prefs.PreferencesCategory;
import com.dmdirc.config.prefs.PreferencesManager;
import com.dmdirc.config.prefs.PreferencesSetting;
import com.dmdirc.config.prefs.PreferencesType;
import com.dmdirc.config.prefs.validator.ValidationResponse;
import com.dmdirc.plugins.Plugin;
import com.dmdirc.ui.messages.Styliser;

import java.awt.AWTException;
import java.awt.Frame;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

/**
 * The Systray plugin shows DMDirc in the user's system tray, and allows
 * notifications to be disabled.
 * @author chris
 */
public final class SystrayPlugin extends Plugin implements ActionListener,
        MouseListener, com.dmdirc.interfaces.ActionListener {
    
    /** The command we registered. */
    private PopupCommand command;
    
    /** The tray icon we're currently using. */
    private final TrayIcon icon;
    
    /** Creates a new system tray plugin. */
    public SystrayPlugin() {
        super();
    //#SystrayPlugin.java:67: method: void com.dmdirc.addons.systray.SystrayPlugin.com.dmdirc.addons.systray.SystrayPlugin()
    //#SystrayPlugin.java:67: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.plugins.Plugin()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void com.dmdirc.addons.systray.SystrayPlugin()
    //#    unanalyzed callee: void com.dmdirc.plugins.Plugin()
    //#input(void com.dmdirc.addons.systray.SystrayPlugin()): this
    //#output(void com.dmdirc.addons.systray.SystrayPlugin()): new TrayIcon(SystrayPlugin#4) num objects
    //#output(void com.dmdirc.addons.systray.SystrayPlugin()): this.icon
    //#new obj(void com.dmdirc.addons.systray.SystrayPlugin()): new TrayIcon(SystrayPlugin#4)
    //#presumption(void com.dmdirc.addons.systray.SystrayPlugin()): com.dmdirc.ui.IconManager:getIconManager(...)@78 != null
    //#post(void com.dmdirc.addons.systray.SystrayPlugin()): this.icon == &new TrayIcon(SystrayPlugin#4)
    //#post(void com.dmdirc.addons.systray.SystrayPlugin()): new TrayIcon(SystrayPlugin#4) num objects == 1
        final MenuItem show = new MenuItem("Show/hide");
        final MenuItem quit = new MenuItem("Quit");
        
        final PopupMenu menu = new PopupMenu();
        menu.add(show);
        menu.add(quit);
        
        show.addActionListener(this);
        quit.addActionListener(this);
        
        icon = new TrayIcon(IconManager.getIconManager().getImage("logo"), 
    //#SystrayPlugin.java:78: Warning: method not available - call not analyzed
    //#    call on IconManager com.dmdirc.ui.IconManager:getIconManager()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void com.dmdirc.addons.systray.SystrayPlugin()
    //#    unanalyzed callee: IconManager com.dmdirc.ui.IconManager:getIconManager()
    //#SystrayPlugin.java:78: Warning: method not available - call not analyzed
    //#    call on Image com.dmdirc.ui.IconManager:getImage(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void com.dmdirc.addons.systray.SystrayPlugin()
    //#    unanalyzed callee: Image com.dmdirc.ui.IconManager:getImage(String)
                "DMDirc", menu);
        icon.setImageAutoSize(true);
        icon.addMouseListener(this);
    }
    //#SystrayPlugin.java:82: end of method: void com.dmdirc.addons.systray.SystrayPlugin.com.dmdirc.addons.systray.SystrayPlugin()
    
    /**
     * Sends a notification via the system tray icon.
     * @param title The title of the notification
     * @param message The contents of the notification
     * @param type The type of notification
     */
    public void notify(final String title, final String message, final TrayIcon.MessageType type) {
        icon.displayMessage(title, Styliser.stipControlCodes(message), type);
    //#SystrayPlugin.java:91: method: void com.dmdirc.addons.systray.SystrayPlugin.notify(String, String, TrayIcon$MessageType)
    //#SystrayPlugin.java:91: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.ui.messages.Styliser:stipControlCodes(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void notify(String, String, TrayIcon$MessageType)
    //#    unanalyzed callee: String com.dmdirc.ui.messages.Styliser:stipControlCodes(String)
    //#input(void notify(String, String, TrayIcon$MessageType)): message
    //#input(void notify(String, String, TrayIcon$MessageType)): this
    //#input(void notify(String, String, TrayIcon$MessageType)): this.icon
    //#input(void notify(String, String, TrayIcon$MessageType)): title
    //#input(void notify(String, String, TrayIcon$MessageType)): type
    //#pre[3] (void notify(String, String, TrayIcon$MessageType)): this.icon != null
    }
    //#SystrayPlugin.java:92: end of method: void com.dmdirc.addons.systray.SystrayPlugin.notify(String, String, TrayIcon$MessageType)
    
    /**
     * Sends a notification via the system tray icon.
     * @param title The title of the notification
     * @param message The contents of the notification
     */
    public void notify(final String title, final String message) {
        notify(title, message, TrayIcon.MessageType.NONE);
    //#SystrayPlugin.java:100: method: void com.dmdirc.addons.systray.SystrayPlugin.notify(String, String)
    //#input(void notify(String, String)): java.awt.TrayIcon$MessageType.NONE
    //#input(void notify(String, String)): message
    //#input(void notify(String, String)): this
    //#input(void notify(String, String)): this.icon
    //#input(void notify(String, String)): title
    //#pre[3] (void notify(String, String)): this.icon != null
    //#presumption(void notify(String, String)): init'ed(java.awt.TrayIcon$MessageType.NONE)
    //#unanalyzed(void notify(String, String)): Effects-of-calling:com.dmdirc.ui.messages.Styliser:stipControlCodes
    //#unanalyzed(void notify(String, String)): Effects-of-calling:java.awt.TrayIcon:displayMessage
    }
    //#SystrayPlugin.java:101: end of method: void com.dmdirc.addons.systray.SystrayPlugin.notify(String, String)
    
    /**
     * {@inheritDoc}
     * 
     * @param e Action event
     */
    @Override
    public void actionPerformed(final ActionEvent e) {
        if (e.getActionCommand().equals("Show/hide")) {
    //#SystrayPlugin.java:110: method: void com.dmdirc.addons.systray.SystrayPlugin.actionPerformed(ActionEvent)
    //#input(void actionPerformed(ActionEvent)): e
    //#pre[1] (void actionPerformed(ActionEvent)): e != null
    //#presumption(void actionPerformed(ActionEvent)): com.dmdirc.Main:getUI(...)@111 != null
    //#presumption(void actionPerformed(ActionEvent)): com.dmdirc.Main:getUI(...)@111 != null
    //#presumption(void actionPerformed(ActionEvent)): com.dmdirc.ui.interfaces.UIController:getMainWindow(...)@111 != null
    //#presumption(void actionPerformed(ActionEvent)): com.dmdirc.ui.interfaces.UIController:getMainWindow(...)@111 != null
    //#presumption(void actionPerformed(ActionEvent)): java.awt.event.ActionEvent:getActionCommand(...)@110 != null
    //#presumption(void actionPerformed(ActionEvent)): java.awt.event.ActionEvent:getActionCommand(...)@112 != null
    //#test_vector(void actionPerformed(ActionEvent)): java.lang.String:equals(...)@110: {0}, {1}
    //#test_vector(void actionPerformed(ActionEvent)): java.lang.String:equals(...)@112: {0}, {1}
            Main.getUI().getMainWindow().setVisible(!Main.getUI().getMainWindow().isVisible());
    //#SystrayPlugin.java:111: Warning: method not available - call not analyzed
    //#    call on UIController com.dmdirc.Main:getUI()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void actionPerformed(ActionEvent)
    //#    unanalyzed callee: UIController com.dmdirc.Main:getUI()
    //#SystrayPlugin.java:111: Warning: method not available - call not analyzed
    //#    call on MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void actionPerformed(ActionEvent)
    //#    unanalyzed callee: MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#SystrayPlugin.java:111: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.ui.interfaces.MainWindow:isVisible()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void actionPerformed(ActionEvent)
    //#    unanalyzed callee: bool com.dmdirc.ui.interfaces.MainWindow:isVisible()
    //#SystrayPlugin.java:111: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.ui.interfaces.MainWindow:setVisible(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void actionPerformed(ActionEvent)
    //#    unanalyzed callee: void com.dmdirc.ui.interfaces.MainWindow:setVisible(bool)
        } else if (e.getActionCommand().equals("Quit")) {
            Main.quit();
    //#SystrayPlugin.java:113: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.Main:quit()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void actionPerformed(ActionEvent)
    //#    unanalyzed callee: void com.dmdirc.Main:quit()
        }
    }
    //#SystrayPlugin.java:115: end of method: void com.dmdirc.addons.systray.SystrayPlugin.actionPerformed(ActionEvent)
    
    /** {@inheritDoc} */
    @Override
    public ValidationResponse checkPrerequisites() {
        if (SystemTray.isSupported()) {
    //#SystrayPlugin.java:120: method: ValidationResponse com.dmdirc.addons.systray.SystrayPlugin.checkPrerequisites()
    //#output(ValidationResponse checkPrerequisites()): new ValidationResponse(checkPrerequisites#1) num objects
    //#output(ValidationResponse checkPrerequisites()): new ValidationResponse(checkPrerequisites#2) num objects
    //#output(ValidationResponse checkPrerequisites()): return_value
    //#new obj(ValidationResponse checkPrerequisites()): new ValidationResponse(checkPrerequisites#1)
    //#new obj(ValidationResponse checkPrerequisites()): new ValidationResponse(checkPrerequisites#2)
    //#post(ValidationResponse checkPrerequisites()): return_value in Addr_Set{&new ValidationResponse(checkPrerequisites#2),&new ValidationResponse(checkPrerequisites#1)}
    //#post(ValidationResponse checkPrerequisites()): new ValidationResponse(checkPrerequisites#1) num objects <= 1
    //#post(ValidationResponse checkPrerequisites()): new ValidationResponse(checkPrerequisites#2) num objects <= 1
    //#test_vector(ValidationResponse checkPrerequisites()): java.awt.SystemTray:isSupported(...)@120: {0}, {1}
            return new ValidationResponse();
    //#SystrayPlugin.java:121: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.validator.ValidationResponse()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: ValidationResponse checkPrerequisites()
    //#    unanalyzed callee: void com.dmdirc.config.prefs.validator.ValidationResponse()
        } else {
            return new ValidationResponse("System tray is not supported on this platform.");
    //#SystrayPlugin.java:123: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.validator.ValidationResponse(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: ValidationResponse checkPrerequisites()
    //#    unanalyzed callee: void com.dmdirc.config.prefs.validator.ValidationResponse(String)
    //#SystrayPlugin.java:123: end of method: ValidationResponse com.dmdirc.addons.systray.SystrayPlugin.checkPrerequisites()
        }
    }
    
    /** {@inheritDoc} */
    @Override
    public void onLoad() {
        try {
            SystemTray.getSystemTray().add(icon);
    //#SystrayPlugin.java:131: method: void com.dmdirc.addons.systray.SystrayPlugin.onLoad()
    //#input(void onLoad()): com.dmdirc.actions.CoreActionType.CLIENT_MINIMISED
    //#input(void onLoad()): this
    //#input(void onLoad()): this.icon
    //#output(void onLoad()): new PopupCommand(onLoad#1) num objects
    //#output(void onLoad()): new PopupCommand(onLoad#1).__Tag
    //#output(void onLoad()): new PopupCommand(onLoad#1).parent
    //#output(void onLoad()): this.command
    //#new obj(void onLoad()): new PopupCommand(onLoad#1)
    //#presumption(void onLoad()): init'ed(com.dmdirc.actions.CoreActionType.CLIENT_MINIMISED)
    //#presumption(void onLoad()): java.awt.SystemTray:getSystemTray(...)@131 != null
    //#post(void onLoad()): this.command == One-of{&new PopupCommand(onLoad#1), old this.command}
    //#post(void onLoad()): new PopupCommand(onLoad#1) num objects <= 1
    //#post(void onLoad()): new PopupCommand(onLoad#1).__Tag == com/dmdirc/addons/systray/PopupCommand
    //#post(void onLoad()): new PopupCommand(onLoad#1).parent == this
    //#post(void onLoad()): new PopupCommand(onLoad#1).parent != null
    //#unanalyzed(void onLoad()): Effects-of-calling:com.dmdirc.commandparser.commands.ServerCommand
    //#unanalyzed(void onLoad()): Effects-of-calling:com.dmdirc.commandparser.CommandManager:registerCommand
            command = new PopupCommand(this);
        } catch (AWTException ex) {
            // Should probably unload ourself here?
        }
        
        ActionManager.addListener(this, CoreActionType.CLIENT_MINIMISED);
    //#SystrayPlugin.java:137: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.actions.ActionManager:addListener(ActionListener, ActionType[])
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void onLoad()
    //#    unanalyzed callee: void com.dmdirc.actions.ActionManager:addListener(ActionListener, ActionType[])
    }
    //#SystrayPlugin.java:138: end of method: void com.dmdirc.addons.systray.SystrayPlugin.onLoad()
    
    /** {@inheritDoc} */
    @Override
    public void onUnload() {
        SystemTray.getSystemTray().remove(icon);
    //#SystrayPlugin.java:143: method: void com.dmdirc.addons.systray.SystrayPlugin.onUnload()
    //#input(void onUnload()): this
    //#input(void onUnload()): this.command
    //#input(void onUnload()): this.icon
    //#pre[2] (void onUnload()): this.command != null
    //#presumption(void onUnload()): java.awt.SystemTray:getSystemTray(...)@143 != null
    //#unanalyzed(void onUnload()): Effects-of-calling:com.dmdirc.commandparser.CommandManager:unregisterCommand
        command.unregister();
        
        ActionManager.removeListener(this);
    //#SystrayPlugin.java:146: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.actions.ActionManager:removeListener(ActionListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void onUnload()
    //#    unanalyzed callee: void com.dmdirc.actions.ActionManager:removeListener(ActionListener)
    }
    //#SystrayPlugin.java:147: end of method: void com.dmdirc.addons.systray.SystrayPlugin.onUnload()

    /** {@inheritDoc} */
    @Override
    public void showConfig(final PreferencesManager manager) {
        final PreferencesCategory category = new PreferencesCategory("System Tray", 
    //#SystrayPlugin.java:152: method: void com.dmdirc.addons.systray.SystrayPlugin.showConfig(PreferencesManager)
    //#SystrayPlugin.java:152: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory(String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory(String, String)
    //#input(void showConfig(PreferencesManager)): com.dmdirc.config.prefs.PreferencesType.BOOLEAN
    //#input(void showConfig(PreferencesManager)): manager
    //#input(void showConfig(PreferencesManager)): this
    //#pre[1] (void showConfig(PreferencesManager)): manager != null
    //#presumption(void showConfig(PreferencesManager)): com.dmdirc.config.prefs.PreferencesManager:getCategory(...)@161 != null
    //#presumption(void showConfig(PreferencesManager)): init'ed(com.dmdirc.config.prefs.PreferencesType.BOOLEAN)
                "General configuration settings");
        
        category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
    //#SystrayPlugin.java:155: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.systray.SystrayPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: String com.dmdirc.addons.systray.SystrayPlugin:getDomain()
    //#SystrayPlugin.java:155: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesSetting(PreferencesType, String, String, String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesSetting(PreferencesType, String, String, String, String)
    //#SystrayPlugin.java:155: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
                getDomain(), "autominimise", "Auto-hide DMDirc " +
                "when minimised", "If this option is enabled, the systray " +
                "plugin will hide DMDirc to the system tray whenever DMDirc is" +
                " minimised"));
        
        manager.getCategory("Plugins").addSubCategory(category);
    //#SystrayPlugin.java:161: Warning: method not available - call not analyzed
    //#    call on PreferencesCategory com.dmdirc.config.prefs.PreferencesManager:getCategory(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: PreferencesCategory com.dmdirc.config.prefs.PreferencesManager:getCategory(String)
    //#SystrayPlugin.java:161: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory:addSubCategory(PreferencesCategory)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory:addSubCategory(PreferencesCategory)
    }
    //#SystrayPlugin.java:162: end of method: void com.dmdirc.addons.systray.SystrayPlugin.showConfig(PreferencesManager)
    
    /** 
     * {@inheritDoc}
     * 
     * @param e Mouse event
     */
    @Override
    public void mouseClicked(final MouseEvent e) {
        if (e.getButton() == MouseEvent.BUTTON1) {
    //#SystrayPlugin.java:171: method: void com.dmdirc.addons.systray.SystrayPlugin.mouseClicked(MouseEvent)
    //#input(void mouseClicked(MouseEvent)): com/dmdirc/addons/ui_swing/MainFrame.__Descendant_Table[com/dmdirc/addons/ui_swing/MainFrame]
    //#input(void mouseClicked(MouseEvent)): com/dmdirc/addons/ui_swing/MainFrame.__Descendant_Table[others]
    //#input(void mouseClicked(MouseEvent)): e
    //#pre[1] (void mouseClicked(MouseEvent)): e != null
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.Main:getUI(...)@172 != null
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.Main:getUI(...)@173 != null
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.Main:getUI(...)@175 != null
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.Main:getUI(...)@176 != null
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.Main:getUI(...)@177 != null
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.ui.interfaces.UIController:getMainWindow(...).__Tag@176 == com/dmdirc/addons/ui_swing/MainFrame
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.ui.interfaces.UIController:getMainWindow(...).__Tag@177 == com/dmdirc/addons/ui_swing/MainFrame
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.ui.interfaces.UIController:getMainWindow(...)@172 != null
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.ui.interfaces.UIController:getMainWindow(...)@173 != null
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.ui.interfaces.UIController:getMainWindow(...)@175 != null
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.ui.interfaces.UIController:getMainWindow(...)@176 != null
    //#presumption(void mouseClicked(MouseEvent)): com.dmdirc.ui.interfaces.UIController:getMainWindow(...)@177 != null
    //#test_vector(void mouseClicked(MouseEvent)): com.dmdirc.ui.interfaces.MainWindow:isVisible(...)@172: {0}, {1}
    //#test_vector(void mouseClicked(MouseEvent)): java.awt.event.MouseEvent:getButton(...)@171: {-2_147_483_648..0, 2..4_294_967_295}, {1}
            if (Main.getUI().getMainWindow().isVisible()) {               
    //#SystrayPlugin.java:172: Warning: method not available - call not analyzed
    //#    call on UIController com.dmdirc.Main:getUI()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: UIController com.dmdirc.Main:getUI()
    //#SystrayPlugin.java:172: Warning: method not available - call not analyzed
    //#    call on MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#SystrayPlugin.java:172: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.ui.interfaces.MainWindow:isVisible()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: bool com.dmdirc.ui.interfaces.MainWindow:isVisible()
                Main.getUI().getMainWindow().setVisible(false);
    //#SystrayPlugin.java:173: Warning: method not available - call not analyzed
    //#    call on UIController com.dmdirc.Main:getUI()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: UIController com.dmdirc.Main:getUI()
    //#SystrayPlugin.java:173: Warning: method not available - call not analyzed
    //#    call on MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#SystrayPlugin.java:173: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.ui.interfaces.MainWindow:setVisible(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: void com.dmdirc.ui.interfaces.MainWindow:setVisible(bool)
            } else {
                Main.getUI().getMainWindow().setVisible(true);
    //#SystrayPlugin.java:175: Warning: method not available - call not analyzed
    //#    call on UIController com.dmdirc.Main:getUI()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: UIController com.dmdirc.Main:getUI()
    //#SystrayPlugin.java:175: Warning: method not available - call not analyzed
    //#    call on MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#SystrayPlugin.java:175: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.ui.interfaces.MainWindow:setVisible(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: void com.dmdirc.ui.interfaces.MainWindow:setVisible(bool)
                ((MainFrame) Main.getUI().getMainWindow()).setState(Frame.NORMAL);
    //#SystrayPlugin.java:176: Warning: method not available - call not analyzed
    //#    call on UIController com.dmdirc.Main:getUI()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: UIController com.dmdirc.Main:getUI()
    //#SystrayPlugin.java:176: Warning: method not available - call not analyzed
    //#    call on MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#SystrayPlugin.java:176: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.MainFrame:setState(int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.MainFrame:setState(int)
                ((MainFrame) Main.getUI().getMainWindow()).toFront();
    //#SystrayPlugin.java:177: Warning: method not available - call not analyzed
    //#    call on UIController com.dmdirc.Main:getUI()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: UIController com.dmdirc.Main:getUI()
    //#SystrayPlugin.java:177: Warning: method not available - call not analyzed
    //#    call on MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#SystrayPlugin.java:177: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.MainFrame:toFront()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void mouseClicked(MouseEvent)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.MainFrame:toFront()
            }
        }
    }
    //#SystrayPlugin.java:180: end of method: void com.dmdirc.addons.systray.SystrayPlugin.mouseClicked(MouseEvent)
    
    /** 
     * {@inheritDoc}
     * 
     * @param e Mouse event
     */
    @Override
    public void mousePressed(final MouseEvent e) {
        //Ignore
    }
    //#SystrayPlugin.java:190: method: void com.dmdirc.addons.systray.SystrayPlugin.mousePressed(MouseEvent)
    //#SystrayPlugin.java:190: end of method: void com.dmdirc.addons.systray.SystrayPlugin.mousePressed(MouseEvent)
    
    /** 
     * {@inheritDoc}
     * 
     * @param e Mouse event
     */
    @Override
    public void mouseReleased(final MouseEvent e) {
        //Ignore
    }
    //#SystrayPlugin.java:200: method: void com.dmdirc.addons.systray.SystrayPlugin.mouseReleased(MouseEvent)
    //#SystrayPlugin.java:200: end of method: void com.dmdirc.addons.systray.SystrayPlugin.mouseReleased(MouseEvent)
    
    /** 
     * {@inheritDoc}
     * 
     * @param e Mouse event
     */
    @Override
    public void mouseEntered(final MouseEvent e) {
        //Ignore
    }
    //#SystrayPlugin.java:210: method: void com.dmdirc.addons.systray.SystrayPlugin.mouseEntered(MouseEvent)
    //#SystrayPlugin.java:210: end of method: void com.dmdirc.addons.systray.SystrayPlugin.mouseEntered(MouseEvent)
    
    /** 
     * {@inheritDoc}
     * 
     * @param e Mouse event
     */
    @Override
    public void mouseExited(final MouseEvent e) {
        //Ignore
    }
    //#SystrayPlugin.java:220: method: void com.dmdirc.addons.systray.SystrayPlugin.mouseExited(MouseEvent)
    //#SystrayPlugin.java:220: end of method: void com.dmdirc.addons.systray.SystrayPlugin.mouseExited(MouseEvent)
    
    /** {@inheritDoc} */
    @Override
    public void processEvent(final ActionType type, final StringBuffer format,
            final Object... arguments) {
        if (type == CoreActionType.CLIENT_MINIMISED
    //#SystrayPlugin.java:226: method: void com.dmdirc.addons.systray.SystrayPlugin.processEvent(ActionType, StringBuffer, Object[])
    //#SystrayPlugin.java:226: Warning: method not available - call not analyzed
    //#    call on ConfigManager com.dmdirc.config.IdentityManager:getGlobalConfig()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void processEvent(ActionType, StringBuffer, Object[])
    //#    unanalyzed callee: ConfigManager com.dmdirc.config.IdentityManager:getGlobalConfig()
    //#SystrayPlugin.java:226: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.systray.SystrayPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void processEvent(ActionType, StringBuffer, Object[])
    //#    unanalyzed callee: String com.dmdirc.addons.systray.SystrayPlugin:getDomain()
    //#SystrayPlugin.java:226: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.config.ConfigManager:getOptionBool(String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void processEvent(ActionType, StringBuffer, Object[])
    //#    unanalyzed callee: bool com.dmdirc.config.ConfigManager:getOptionBool(String, String)
    //#input(void processEvent(ActionType, StringBuffer, Object[])): com.dmdirc.actions.CoreActionType.CLIENT_MINIMISED
    //#input(void processEvent(ActionType, StringBuffer, Object[])): this
    //#input(void processEvent(ActionType, StringBuffer, Object[])): type
    //#presumption(void processEvent(ActionType, StringBuffer, Object[])): com.dmdirc.Main:getUI(...)@229 != null
    //#presumption(void processEvent(ActionType, StringBuffer, Object[])): init'ed(com.dmdirc.actions.CoreActionType.CLIENT_MINIMISED)
    //#presumption(void processEvent(ActionType, StringBuffer, Object[])): com.dmdirc.config.IdentityManager:getGlobalConfig(...)@226 != null
    //#presumption(void processEvent(ActionType, StringBuffer, Object[])): com.dmdirc.ui.interfaces.UIController:getMainWindow(...)@229 != null
    //#test_vector(void processEvent(ActionType, StringBuffer, Object[])): com.dmdirc.config.ConfigManager:getOptionBool(...)@226: {0}, {1}
                && IdentityManager.getGlobalConfig().getOptionBool(getDomain(),
                "autominimise")) {
            Main.getUI().getMainWindow().setVisible(false);
    //#SystrayPlugin.java:229: Warning: method not available - call not analyzed
    //#    call on UIController com.dmdirc.Main:getUI()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void processEvent(ActionType, StringBuffer, Object[])
    //#    unanalyzed callee: UIController com.dmdirc.Main:getUI()
    //#SystrayPlugin.java:229: Warning: method not available - call not analyzed
    //#    call on MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void processEvent(ActionType, StringBuffer, Object[])
    //#    unanalyzed callee: MainWindow com.dmdirc.ui.interfaces.UIController:getMainWindow()
    //#SystrayPlugin.java:229: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.ui.interfaces.MainWindow:setVisible(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.systray.SystrayPlugin
    //#    method: void processEvent(ActionType, StringBuffer, Object[])
    //#    unanalyzed callee: void com.dmdirc.ui.interfaces.MainWindow:setVisible(bool)
        }
    }
    //#SystrayPlugin.java:231: end of method: void com.dmdirc.addons.systray.SystrayPlugin.processEvent(ActionType, StringBuffer, Object[])
    
}
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Descendant_Table[com/dmdirc/addons/systray/SystrayPlugin]
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.actionPerformed(Ljava/awt/event/ActionEvent;)V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.checkPrerequisites()Lcom/dmdirc/config/prefs/validator/ValidationResponse;
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.mouseClicked(Ljava/awt/event/MouseEvent;)V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.mouseEntered(Ljava/awt/event/MouseEvent;)V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.mouseExited(Ljava/awt/event/MouseEvent;)V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.mousePressed(Ljava/awt/event/MouseEvent;)V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.mouseReleased(Ljava/awt/event/MouseEvent;)V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.notify(Ljava/lang/String;Ljava/lang/String;)V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.notify(Ljava/lang/String;Ljava/lang/String;Ljava/awt/TrayIcon$MessageType;)V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.onLoad()V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.onUnload()V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.processEvent(Lcom/dmdirc/actions/interfaces/ActionType;Ljava/lang/StringBuffer;[Ljava/lang/Object;)V
    //#output(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.showConfig(Lcom/dmdirc/config/prefs/PreferencesManager;)V
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Descendant_Table[com/dmdirc/addons/systray/SystrayPlugin] == &__Dispatch_Table
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.actionPerformed(Ljava/awt/event/ActionEvent;)V == &actionPerformed
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.checkPrerequisites()Lcom/dmdirc/config/prefs/validator/ValidationResponse; == &checkPrerequisites
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.mouseClicked(Ljava/awt/event/MouseEvent;)V == &mouseClicked
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.mouseEntered(Ljava/awt/event/MouseEvent;)V == &mouseEntered
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.mouseExited(Ljava/awt/event/MouseEvent;)V == &mouseExited
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.mousePressed(Ljava/awt/event/MouseEvent;)V == &mousePressed
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.mouseReleased(Ljava/awt/event/MouseEvent;)V == &mouseReleased
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.notify(Ljava/lang/String;Ljava/lang/String;)V == &notify
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.notify(Ljava/lang/String;Ljava/lang/String;Ljava/awt/TrayIcon$MessageType;)V == &notify
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.onLoad()V == &onLoad
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.onUnload()V == &onUnload
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.processEvent(Lcom/dmdirc/actions/interfaces/ActionType;Ljava/lang/StringBuffer;[Ljava/lang/Object;)V == &processEvent
    //#post(com.dmdirc.addons.systray.SystrayPlugin__static_init): __Dispatch_Table.showConfig(Lcom/dmdirc/config/prefs/PreferencesManager;)V == &showConfig
    //#SystrayPlugin.java:: end of method: com.dmdirc.addons.systray.SystrayPlugin.com.dmdirc.addons.systray.SystrayPlugin__static_init
    //#SystrayPlugin.java:: end of class: com.dmdirc.addons.systray.SystrayPlugin
