jdk/src/share/classes/javax/swing/table/TableColumn.java
Print this page
*** 20,40 ****
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-
package javax.swing.table;
import javax.swing.*;
- import javax.swing.border.*;
import javax.swing.event.SwingPropertyChangeSupport;
import java.lang.Integer;
- import java.awt.Color;
import java.awt.Component;
import java.io.Serializable;
! import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
/**
* A <code>TableColumn</code> represents all the attributes of a column in a
* <code>JTable</code>, such as width, resizability, minimum and maximum width.
--- 20,37 ----
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.swing.table;
import javax.swing.*;
import javax.swing.event.SwingPropertyChangeSupport;
import java.lang.Integer;
import java.awt.Component;
import java.io.Serializable;
! import java.beans.BeanProperty;
import java.beans.PropertyChangeListener;
/**
* A <code>TableColumn</code> represents all the attributes of a column in a
* <code>JTable</code>, such as width, resizability, minimum and maximum width.
*** 307,320 ****
* Sets the model index for this column. The model index is the
* index of the column in the model that will be displayed by this
* <code>TableColumn</code>. As the <code>TableColumn</code>
* is moved around in the view the model index remains constant.
* @param modelIndex the new modelIndex
- * @beaninfo
- * bound: true
- * description: The model index.
*/
public void setModelIndex(int modelIndex) {
int old = this.modelIndex;
this.modelIndex = modelIndex;
firePropertyChange("modelIndex", old, modelIndex);
}
--- 304,316 ----
* Sets the model index for this column. The model index is the
* index of the column in the model that will be displayed by this
* <code>TableColumn</code>. As the <code>TableColumn</code>
* is moved around in the view the model index remains constant.
* @param modelIndex the new modelIndex
*/
+ @BeanProperty(description
+ = "The model index.")
public void setModelIndex(int modelIndex) {
int old = this.modelIndex;
this.modelIndex = modelIndex;
firePropertyChange("modelIndex", old, modelIndex);
}
*** 334,347 ****
* they are purely a
* convenience for the external tagging and location of columns.
*
* @param identifier an identifier for this column
* @see #getIdentifier
- * @beaninfo
- * bound: true
- * description: A unique identifier for this column.
*/
public void setIdentifier(Object identifier) {
Object old = this.identifier;
this.identifier = identifier;
firePropertyChange("identifier", old, identifier);
}
--- 330,342 ----
* they are purely a
* convenience for the external tagging and location of columns.
*
* @param identifier an identifier for this column
* @see #getIdentifier
*/
+ @BeanProperty(description
+ = "A unique identifier for this column.")
public void setIdentifier(Object identifier) {
Object old = this.identifier;
this.identifier = identifier;
firePropertyChange("identifier", old, identifier);
}
*** 368,381 ****
* used as the value for the <code>headerRenderer</code>. When the
* <code>TableColumn</code> is created, the default <code>headerValue</code>
* is <code>null</code>.
* @param headerValue the new headerValue
* @see #getHeaderValue
- * @beaninfo
- * bound: true
- * description: The text to be used by the header renderer.
*/
public void setHeaderValue(Object headerValue) {
Object old = this.headerValue;
this.headerValue = headerValue;
firePropertyChange("headerValue", old, headerValue);
}
--- 363,375 ----
* used as the value for the <code>headerRenderer</code>. When the
* <code>TableColumn</code> is created, the default <code>headerValue</code>
* is <code>null</code>.
* @param headerValue the new headerValue
* @see #getHeaderValue
*/
+ @BeanProperty(description
+ = "The text to be used by the header renderer.")
public void setHeaderValue(Object headerValue) {
Object old = this.headerValue;
this.headerValue = headerValue;
firePropertyChange("headerValue", old, headerValue);
}
*** 404,417 ****
* renderer must render the sorting indication.
*
* @param headerRenderer the new headerRenderer
*
* @see #getHeaderRenderer
- * @beaninfo
- * bound: true
- * description: The header renderer.
*/
public void setHeaderRenderer(TableCellRenderer headerRenderer) {
TableCellRenderer old = this.headerRenderer;
this.headerRenderer = headerRenderer;
firePropertyChange("headerRenderer", old, headerRenderer);
}
--- 398,410 ----
* renderer must render the sorting indication.
*
* @param headerRenderer the new headerRenderer
*
* @see #getHeaderRenderer
*/
+ @BeanProperty(description
+ = "The header renderer.")
public void setHeaderRenderer(TableCellRenderer headerRenderer) {
TableCellRenderer old = this.headerRenderer;
this.headerRenderer = headerRenderer;
firePropertyChange("headerRenderer", old, headerRenderer);
}
*** 436,449 ****
* Sets the <code>TableCellRenderer</code> used by <code>JTable</code>
* to draw individual values for this column.
*
* @param cellRenderer the new cellRenderer
* @see #getCellRenderer
- * @beaninfo
- * bound: true
- * description: The renderer to use for cell values.
*/
public void setCellRenderer(TableCellRenderer cellRenderer) {
TableCellRenderer old = this.cellRenderer;
this.cellRenderer = cellRenderer;
firePropertyChange("cellRenderer", old, cellRenderer);
}
--- 429,441 ----
* Sets the <code>TableCellRenderer</code> used by <code>JTable</code>
* to draw individual values for this column.
*
* @param cellRenderer the new cellRenderer
* @see #getCellRenderer
*/
+ @BeanProperty(description
+ = "The renderer to use for cell values.")
public void setCellRenderer(TableCellRenderer cellRenderer) {
TableCellRenderer old = this.cellRenderer;
this.cellRenderer = cellRenderer;
firePropertyChange("cellRenderer", old, cellRenderer);
}
*** 470,483 ****
/**
* Sets the editor to used by when a cell in this column is edited.
*
* @param cellEditor the new cellEditor
* @see #getCellEditor
- * @beaninfo
- * bound: true
- * description: The editor to use for cell values.
*/
public void setCellEditor(TableCellEditor cellEditor){
TableCellEditor old = this.cellEditor;
this.cellEditor = cellEditor;
firePropertyChange("cellEditor", old, cellEditor);
}
--- 462,474 ----
/**
* Sets the editor to used by when a cell in this column is edited.
*
* @param cellEditor the new cellEditor
* @see #getCellEditor
*/
+ @BeanProperty(description
+ = "The editor to use for cell values.")
public void setCellEditor(TableCellEditor cellEditor){
TableCellEditor old = this.cellEditor;
this.cellEditor = cellEditor;
firePropertyChange("cellEditor", old, cellEditor);
}
*** 514,527 ****
* @see #getWidth
* @see #setMinWidth
* @see #setMaxWidth
* @see #setPreferredWidth
* @see JTable#doLayout()
- * @beaninfo
- * bound: true
- * description: The width of the column.
*/
public void setWidth(int width) {
int old = this.width;
this.width = Math.min(Math.max(width, minWidth), maxWidth);
firePropertyChange("width", old, this.width);
}
--- 505,517 ----
* @see #getWidth
* @see #setMinWidth
* @see #setMaxWidth
* @see #setPreferredWidth
* @see JTable#doLayout()
*/
+ @BeanProperty(description
+ = "The width of the column.")
public void setWidth(int width) {
int old = this.width;
this.width = Math.min(Math.max(width, minWidth), maxWidth);
firePropertyChange("width", old, this.width);
}
*** 548,561 ****
* see the <code>doLayout</code> method in <code>JTable</code>.
*
* @param preferredWidth the new preferred width
* @see #getPreferredWidth
* @see JTable#doLayout()
- * @beaninfo
- * bound: true
- * description: The preferred width of the column.
*/
public void setPreferredWidth(int preferredWidth) {
int old = this.preferredWidth;
this.preferredWidth = Math.min(Math.max(preferredWidth, minWidth), maxWidth);
firePropertyChange("preferredWidth", old, this.preferredWidth);
}
--- 538,550 ----
* see the <code>doLayout</code> method in <code>JTable</code>.
*
* @param preferredWidth the new preferred width
* @see #getPreferredWidth
* @see JTable#doLayout()
*/
+ @BeanProperty(description
+ = "The preferred width of the column.")
public void setPreferredWidth(int preferredWidth) {
int old = this.preferredWidth;
this.preferredWidth = Math.min(Math.max(preferredWidth, minWidth), maxWidth);
firePropertyChange("preferredWidth", old, this.preferredWidth);
}
*** 587,600 ****
*
* @param minWidth the new minimum width
* @see #getMinWidth
* @see #setPreferredWidth
* @see #setMaxWidth
- * @beaninfo
- * bound: true
- * description: The minimum width of the column.
*/
public void setMinWidth(int minWidth) {
int old = this.minWidth;
this.minWidth = Math.max(Math.min(minWidth, maxWidth), 0);
if (width < this.minWidth) {
setWidth(this.minWidth);
--- 576,588 ----
*
* @param minWidth the new minimum width
* @see #getMinWidth
* @see #setPreferredWidth
* @see #setMaxWidth
*/
+ @BeanProperty(description
+ = "The minimum width of the column.")
public void setMinWidth(int minWidth) {
int old = this.minWidth;
this.minWidth = Math.max(Math.min(minWidth, maxWidth), 0);
if (width < this.minWidth) {
setWidth(this.minWidth);
*** 632,645 ****
*
* @param maxWidth the new maximum width
* @see #getMaxWidth
* @see #setPreferredWidth
* @see #setMinWidth
- * @beaninfo
- * bound: true
- * description: The maximum width of the column.
*/
public void setMaxWidth(int maxWidth) {
int old = this.maxWidth;
this.maxWidth = Math.max(minWidth, maxWidth);
if (width > this.maxWidth) {
setWidth(this.maxWidth);
--- 620,632 ----
*
* @param maxWidth the new maximum width
* @see #getMaxWidth
* @see #setPreferredWidth
* @see #setMinWidth
*/
+ @BeanProperty(description
+ = "The maximum width of the column.")
public void setMaxWidth(int maxWidth) {
int old = this.maxWidth;
this.maxWidth = Math.max(minWidth, maxWidth);
if (width > this.maxWidth) {
setWidth(this.maxWidth);
*** 666,679 ****
/**
* Sets whether this column can be resized.
*
* @param isResizable if true, resizing is allowed; otherwise false
* @see #getResizable
- * @beaninfo
- * bound: true
- * description: Whether or not this column can be resized.
*/
public void setResizable(boolean isResizable) {
boolean old = this.isResizable;
this.isResizable = isResizable;
firePropertyChange("isResizable", old, this.isResizable);
}
--- 653,665 ----
/**
* Sets whether this column can be resized.
*
* @param isResizable if true, resizing is allowed; otherwise false
* @see #getResizable
*/
+ @BeanProperty(description
+ = "Whether or not this column can be resized.")
public void setResizable(boolean isResizable) {
boolean old = this.isResizable;
this.isResizable = isResizable;
firePropertyChange("isResizable", old, this.isResizable);
}