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

📄 propertytablemodel.java

📁 具有不同语法高亮的编辑器实例
💻 JAVA
字号:
/*
 * 08/10/2005
 *
 * PropertyTableModel.java - Base table model for tables in property sheets.
 * Copyright (C) 2005 Robert Futrell
 * email@address.com
 * www.website.com
 *
 * 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 2
 * of the License, or 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package org.fife.ui.propertysheet;

import java.util.Iterator;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;

import org.fife.ui.propertysheet.infos.PropertyInfo;


/**
 * The base table model for the tables in property sheets.
 *
 * @author Robert Futrell
 * @version 1.0
 */
abstract class PropertyTableModel extends DefaultTableModel {


/*****************************************************************************/


	/**
	 * Adds a property to this table model.
	 *
	 * @param info The property to add.
	 */
	public abstract void addProperty(PropertyInfo info);


/*****************************************************************************/


	/**
	 * Returns the renderer for a given cell.
	 *
	 * @param row The row of the cell.
	 * @param column The column of the cell.
	 * @return The renderer.  If <code>null</code> is returned, the table
	 *         itself will decide on a renderer.
	 */
	public abstract TableCellRenderer getCellRenderer(int row, int column);


/*****************************************************************************/


	/**
	 * Returns the number of columns in this table model.
	 *
	 * @return The number of columns.
	 */
	public int getColumnCount() {
		return 2;
	}


/*****************************************************************************/


	/**
	 * Returns the number of properties in this property container.
	 *
	 * @return The property count.
	 */
	public abstract int getPropertyCount();


/*****************************************************************************/


	/**
	 * Returns an iterator over the properties in this property sheet.
	 *
	 * @return The iterator.
	 */
	public abstract Iterator getPropertyIterator();


/*****************************************************************************/


	/**
	 * Returns whether the specified row is expandable (that is, it contains
	 * "sub-rows" that can optionally be displayed).
	 *
	 * @param row The row in question.  This is a row index into this table
	 *        as it is currently displayed.
	 * @return Whether the row is expandable.
	 */
	public abstract boolean isExpandableRow(int row);


/*****************************************************************************/


	/**
	 * If the specified row is expandable, its expanded state is toggled.
	 *
	 * @param row The row in question.  This is a row index into this table as
	 *        it is currently displayed.
	 */
	abstract void toggleExpandedState(int row);


/*****************************************************************************/

}

⌨️ 快捷键说明

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