baseaction.java

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

JAVA
86
字号
/* * @(#) BaseAction.java * Copyright 2004 HWStudio. All rights reserved. */package hws.item.smart.action;//导入核心Java类库import javax.swing.KeyStroke;import javax.swing.AbstractAction;/** * 所有命令的超类 * * @version 0.1 2005-08-07 * @author Hwerz */public abstract class BaseAction extends AbstractAction {    /*------------------------------------------------------------------------*     *                                属性定义                                *     *------------------------------------------------------------------------*/    /**     * 状态栏提示信息     */    private String hintInfo;    /*------------------------------------------------------------------------*     *                                构造函数                                *     *------------------------------------------------------------------------*/    /**     * Create a new instance of this class     *     * @param name Action的名称     */    public BaseAction(String name) {        super(name);        hintInfo = " ";    }    /**     * Create a new instance of this class     *     * @param name Action的名称     * @param mnemonic Action的快捷键     */    public BaseAction(String name, Integer mnemonic) {        this(name);        putValue(MNEMONIC_KEY, mnemonic);    }    /**     * Create a new instance of this class     *     * @param name Action的名称     * @param key Action的加速键     */    public BaseAction(String name, KeyStroke key) {        this(name);        putValue(ACCELERATOR_KEY, key);    }    /**     * Create a new instance of this class     *     * @param name Action的名称     * @param mnemonic Action的快捷键     * @param key Action的加速键     */    public BaseAction(String name, Integer mnemonic, KeyStroke key) {        this(name);        putValue(MNEMONIC_KEY, mnemonic);        putValue(ACCELERATOR_KEY, key);    }    /*------------------------------------------------------------------------*     *                                公共方法                                *     *------------------------------------------------------------------------*/    /**     * 返回状态栏提示信息     *     * @return 状态栏提示信息     */    public String getHintInfo() {        return hintInfo;    }    /**     * 设置状态栏提示信息     *     * @param hintInfo 状态栏提示信息     */    public void setHintInfo(String hintInfo) {        this.hintInfo = hintInfo;    }}

⌨️ 快捷键说明

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