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

📄 actionmaptablemodel.java

📁 java实现浏览器等本地桌面的功能
💻 JAVA
字号:
/* * $Id: ActionMapTableModel.java,v 1.1 2005/06/15 17:14:32 kleopatra Exp $ * * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. */package org.jdesktop.demo.swingx.common;import javax.swing.Action;import javax.swing.ActionMap;import javax.swing.table.AbstractTableModel;/** * Convenience TableMap showing all entries of a ActionMap. *  * @author Jeanette Winzenburg */public class ActionMapTableModel extends AbstractTableModel {    ActionMap actionMap;    public ActionMapTableModel(ActionMap actionMap) {        this.actionMap = actionMap;    }    public int getRowCount() {        return actionMap.allKeys().length;    }    public int getColumnCount() {        return 2;    }    public Object getValueAt(int rowIndex, int columnIndex) {        Object key = actionMap.allKeys()[rowIndex];        Action action = actionMap.get(key);        switch (columnIndex) {        case 0:            return key;        case 1:            return action.getValue(Action.NAME);        case 2:            return action.getValue(Action.ACTION_COMMAND_KEY);        default:            return null;        }    }    public String getColumnName(int column) {        switch (column) {        case 0:            return "Key Name";        case 1:            return "Action Name";        case 2:            return "Action Command";        default:            return "Column " + column;        }    }}

⌨️ 快捷键说明

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