|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ /** * DisplayTable.java * * * Created: Mon Jan 29 16:43:09 2001 * * @author Ana von Klopp * @version */ package org.netbeans.modules.web.monitor.client; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import javax.swing.BorderFactory; import javax.swing.DefaultCellEditor; import javax.swing.JComboBox; import javax.swing.JTable; import javax.swing.border.Border; import javax.swing.table.TableCellEditor; import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; import javax.swing.table.TableModel; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import java.awt.Color; import java.awt.Dimension; import java.awt.SystemColor; import org.netbeans.modules.web.monitor.data.Param; import org.openide.util.NbBundle; public class DisplayTable extends JTable { private static final boolean debug = false; // Type of data displayed public static final int UNEDITABLE = 0; public static final int REQUEST = 1; public static final int SERVER = 2; public static final int HEADERS = 3; public static final int PARAMS = 4; public static final int COOKIES = 5; // Sorting states public static final int NEUTRAL = 0; public static final int A2Z = 1; public static final int Z2A = 2; private int numRows = 0; private int numCols = 3; private Object[][] data = null; private TableCellEditor[][] cellEditors = null; // Can we edit the fields? private boolean editableNames = false; private int editable = UNEDITABLE; // Do we sort? private int sort = NEUTRAL; private boolean sortable = false; // Handle resizing for larger fonts boolean fontChanged = true; public DisplayTable(String[] categories) { this(categories, null, UNEDITABLE, false); } public DisplayTable(String[] categories, boolean sortable) { this(categories, null, UNEDITABLE, sortable); } public DisplayTable(String[] categories, int editable) { this(categories, null, editable, false); } public DisplayTable(String[] categories, int editable, boolean sortable) { this(categories, null, editable, sortable); } public DisplayTable(String[] names, String[] values) { this(names, values, UNEDITABLE, false); } public DisplayTable(String[] names, String[] values, boolean sortable) { this(names, values, UNEDITABLE, sortable); } public DisplayTable(String[] names, String[] values, int editable) { this(names, values, editable, false); } public DisplayTable(String[] names, String[] values, int editable, boolean sortable) { super(); numRows = names.length; editableNames = false; this.editable = editable; this.sortable = sortable; data = new Object[numRows][numCols]; cellEditors = new TableCellEditor[numRows][numCols]; for(int i=0; i |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.