servicemenu.java

来自「该系统是一个基于p2p的即时聊天系统」· Java 代码 · 共 58 行

JAVA
58
字号
/* * @(#) ServiceMenu.java * Copyright 2004 HWStudio. All rights reserved. */package hws.item.smart.menu.top;//导入自定义Java类库import hws.item.smart.misc.SBChanger;import hws.item.smart.action.service.StopAllAction;import hws.item.smart.action.service.StartAllAction;import hws.item.smart.action.service.RestartAllAction;/** * 服务菜单 * * @version 0.1 2005-08-28 * @author Hwerz */public class ServiceMenu extends BaseMenu {    /*------------------------------------------------------------------------*     *                                属性定义                                *     *------------------------------------------------------------------------*/    /**     * 该类自身的一个静态引用     */    private static ServiceMenu menu;    /*------------------------------------------------------------------------*     *                                构造函数                                *     *------------------------------------------------------------------------*/    /**     * 构造函数为私有,这样在整个运行过程中该类就只能有一个实例     */    private ServiceMenu() {        super("服务(S)");        setMnemonic('S');        //启动        add(StartAllAction.getInstance()).addMouseListener(            new SBChanger(StartAllAction.getInstance().getHintInfo(), true));        //停止        add(StopAllAction.getInstance()).addMouseListener(            new SBChanger(StopAllAction.getInstance().getHintInfo(), true));        //重启        add(RestartAllAction.getInstance()).addMouseListener(            new SBChanger(RestartAllAction.getInstance().getHintInfo(), true));    }    /*------------------------------------------------------------------------*     *                                公共方法                                *     *------------------------------------------------------------------------*/    /**     * 对该类提供的一个全局访问点,用来实例化该对象     *     * @return 该类唯一的一个实例     */    public static ServiceMenu getInstance() {        if (menu == null) {            menu = new ServiceMenu();        }        return menu;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?