Package com.fiveht.tick.ui.tray

Source Code of com.fiveht.tick.ui.tray.ShowMenuItem

/*
* Copyright (C) 2012 FiveHT Media Ltd.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
package com.fiveht.tick.ui.tray;

import com.fiveht.tick.ui.Frame;
import java.awt.MenuItem;
import java.awt.MenuShortcut;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;

/**
*
* @author Nathan Crause
*/
public class ShowMenuItem extends MenuItem implements ActionListener {
   
    private Frame frame;

    public ShowMenuItem(Frame frame) {
        super("Show");
       
        this.frame = frame;
       
        init();
    }
   
    private void init() {
        setShortcut(new MenuShortcut(KeyEvent.VK_S));
        addActionListener(this);
    }
   
    @Override
    public void actionPerformed(ActionEvent e) {
        frame.fireShow();
    }
   
}
TOP

Related Classes of com.fiveht.tick.ui.tray.ShowMenuItem

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.