jdk/src/share/classes/javax/swing/table/TableColumn.java

Print this page

        

@@ -20,21 +20,18 @@
  *
  * 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.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,14 +304,13 @@
      * 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.
      */
+    @BeanProperty(description
+            = "The model index.")
     public void setModelIndex(int modelIndex) {
         int old = this.modelIndex;
         this.modelIndex = modelIndex;
         firePropertyChange("modelIndex", old, modelIndex);
     }

@@ -334,14 +330,13 @@
      * 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.
      */
+    @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,14 +363,13 @@
      * 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.
      */
+    @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,14 +398,13 @@
      * renderer must render the sorting indication.
      *
      * @param headerRenderer  the new headerRenderer
      *
      * @see       #getHeaderRenderer
-     * @beaninfo
-     *  bound: true
-     *  description: The header renderer.
      */
+    @BeanProperty(description
+            = "The header renderer.")
     public void setHeaderRenderer(TableCellRenderer headerRenderer) {
         TableCellRenderer old = this.headerRenderer;
         this.headerRenderer = headerRenderer;
         firePropertyChange("headerRenderer", old, headerRenderer);
     }

@@ -436,14 +429,13 @@
      * 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.
      */
+    @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,14 +462,13 @@
     /**
      * 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.
      */
+    @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,14 +505,13 @@
      * @see     #getWidth
      * @see     #setMinWidth
      * @see     #setMaxWidth
      * @see     #setPreferredWidth
      * @see     JTable#doLayout()
-     * @beaninfo
-     *  bound: true
-     *  description: The width of the column.
      */
+    @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,14 +538,13 @@
      * 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.
      */
+    @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,14 +576,13 @@
      *
      * @param minWidth  the new minimum width
      * @see     #getMinWidth
      * @see     #setPreferredWidth
      * @see     #setMaxWidth
-     * @beaninfo
-     *  bound: true
-     *  description: The minimum width of the column.
      */
+    @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,14 +620,13 @@
      *
      * @param maxWidth  the new maximum width
      * @see     #getMaxWidth
      * @see     #setPreferredWidth
      * @see     #setMinWidth
-     * @beaninfo
-     *  bound: true
-     *  description: The maximum width of the column.
      */
+    @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,14 +653,13 @@
     /**
      * 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.
      */
+    @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);
     }