1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tasklist.core/src/org/netbeans/modules/tasklist/core/ColumnProperty.java Sat Apr 12 20:18:35 2003 +0000
1.3 @@ -0,0 +1,90 @@
1.4 +package org.netbeans.modules.tasklist.core;
1.5 +
1.6 +import org.openide.nodes.PropertySupport;
1.7 +
1.8 +/**
1.9 + * Class holding column properties.
1.10 + * See debuggercore's TreeTableExplorerViewSupport.java
1.11 + *
1.12 + * @author Tor Norbye
1.13 + * @author Tim Lebedkov
1.14 + */
1.15 +public class ColumnProperty extends PropertySupport.ReadOnly {
1.16 + /** Id of the column. Used such that with deserialization,
1.17 + * we can tell exactly which column you're referring to,
1.18 + * even if we've added and removed columns from the system.
1.19 + * (Could also store the column property name, but that's
1.20 + * more work and more data). */
1.21 + public int uid; // Used to check equivalence in serialized data,
1.22 + // so I don't have to store whole string names
1.23 + public int width;
1.24 +
1.25 + // Used for non-treetable columns
1.26 + /** Construct a new property for a "table column" (e.g. not
1.27 + * the leftmost tree column)
1.28 + * @param uid UID of this column
1.29 + * @param name Property name
1.30 + * @param type Type of this property
1.31 + * @param displayName Name shown in the display
1.32 + * @param hint Tooltip for the property
1.33 + * @param sortable Whether or not this column is valid as a sort key
1.34 + * @param defaultVisibility Whether or not this column should be shown by
1.35 + * @param width Default width for the column
1.36 + * default */
1.37 + public ColumnProperty(
1.38 + int uid,
1.39 + String name,
1.40 + Class type,
1.41 + String displayName,
1.42 + String hint,
1.43 + boolean sortable,
1.44 + boolean defaultVisibility,
1.45 + int width
1.46 + ) {
1.47 + super(name, type, displayName, hint);
1.48 + this.uid = uid;
1.49 + this.width = width;
1.50 + setValue ("ColumnDescriptionTTV", hint); // NOI18N
1.51 + if (sortable) {
1.52 + setValue("ComparableColumnTTV", Boolean.TRUE);// NOI18N
1.53 + }
1.54 + if (!defaultVisibility) {
1.55 + setValue("InvisibleInTreeTableView", Boolean.TRUE);// NOI18N
1.56 + }
1.57 + }
1.58 +
1.59 + // Used for the Tree column (column 0)
1.60 + /** Construct a column object for the treecolumn (leftmost
1.61 + * column).
1.62 + * @param uid UID of the column
1.63 + * @param name Property name
1.64 + * @param displayName Name shown in the display
1.65 + * @param hint Tooltip for the property
1.66 + * @param sortable Whether or not this column is sortable
1.67 + * @param width Default width for the column
1.68 + */
1.69 + public ColumnProperty (
1.70 + int uid,
1.71 + String name,
1.72 + String displayName,
1.73 + String hint,
1.74 + boolean sortable,
1.75 + int width
1.76 + ) {
1.77 + super(name, String.class, displayName, hint);
1.78 + this.uid = uid;
1.79 + this.width = width;
1.80 + setValue( "TreeColumnTTV", Boolean.TRUE );// NOI18N
1.81 + if (sortable) {
1.82 + setValue ("ComparableColumnTTV", Boolean.TRUE);// NOI18N
1.83 + }
1.84 + }
1.85 +
1.86 + public Object getValue() {
1.87 + return null;
1.88 + }
1.89 +
1.90 + public int getWidth() {
1.91 + return width;
1.92 + }
1.93 +}