⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uiaction.java

📁 java实现浏览器等本地桌面的功能
💻 JAVA
字号:
/* * $Id: UIAction.java,v 1.2 2005/10/10 18:01:51 rbair Exp $ * * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. *  * This library 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 * Lesser General Public License for more details. *  * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA *//* * @(#)UIAction.java    1.2 03/04/24 * * Copyright 2002 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package org.jdesktop.swingx;import java.beans.PropertyChangeListener;import javax.swing.Action;/** * UIAction is the basis of all of basic's action classes that are used in * an ActionMap. Subclasses need to override <code>actionPerformed</code>. * <p> * A typical subclass will look like: * <pre> *    private static class Actions extends UIAction { *        Actions(String name) { *            super(name); *        } * *        public void actionPerformed(ActionEvent ae) { *            if (getName() == "selectAll") { *                selectAll(); *            } *            else if (getName() == "cancelEditing") { *                cancelEditing(); *            } *        } *    } * </pre> * <p> * Subclasses that wish to conditionalize the enabled state should override * <code>isEnabled(Component)</code>, and be aware that the passed in * <code>Component</code> may be null. * <p> * This is based on sun.swing.UIAction in J2SE 1.5 * * @see javax.swing.Action * @author Scott Violet */public abstract class UIAction implements Action {    private String name;    public UIAction(String name) {        this.name = name;    }    public final String getName() {        return name;    }    public Object getValue(String key) {        if (key == NAME) {            return name;        }        return null;    }    // UIAction is not mutable, this does nothing.    public void putValue(String key, Object value) {    }    // UIAction is not mutable, this does nothing.    public void setEnabled(boolean b) {    }    /**     * Cover method for <code>isEnabled(null)</code>.     */    public final boolean isEnabled() {        return isEnabled(null);    }    /**     * Subclasses that need to conditionalize the enabled state should     * override this. Be aware that <code>sender</code> may be null.     *     * @param sender Widget enabled state is being asked for, may be null.     */    public boolean isEnabled(Object sender) {        return true;    }    // UIAction is not mutable, this does nothing.    public void addPropertyChangeListener(PropertyChangeListener listener) {    }    // UIAction is not mutable, this does nothing.    public void removePropertyChangeListener(PropertyChangeListener listener) {    }}

⌨️ 快捷键说明

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