public class IlvStringColumn extends IlvAbstractJTableColumn implements GenericEventListener
IlvStringColumn
is a column definition that can render a
String
property of an IlvHierarchyNode
(that is,
an activity or a resource) in an IlvJTable
. The property that
is rendered is defined by an IlvStringProperty
. Editing of the
property can be enabled separately for parent rows and leaf rows. When
enabled, editing is done in a text field.DEFAULT_COLUMN_WIDTH
Constructor and Description |
---|
IlvStringColumn(Object headerValue,
IlvStringProperty property)
Constructs a new column with the specified header value and that will
render the specified activity or resource property.
|
IlvStringColumn(Object headerValue,
IlvStringProperty property,
int width)
Constructs a new column with the specified header value and that will
render the specified activity or resource property.
|
IlvStringColumn(Object headerValue,
IlvStringProperty property,
int width,
Object identifier)
Constructs a new column with the specified header value, a width, a
column identifier, and that will render the specified activity or
resource property.
|
IlvStringColumn(Object headerValue,
IlvStringProperty property,
Object identifier)
Constructs a new column with the specified header value, that will
render the specified activity or resource property, and with a column
identifier.
|
Modifier and Type | Method and Description |
---|---|
protected TableCellEditor |
createEditor()
Creates the
IlvTextFieldTableEditor that will be used to edit
the cells in this column. |
protected IlvGanttConfiguration |
getGanttConfiguration()
Returns the Gantt configuration that this column is coordinating with.
|
protected IlvGanttModel |
getGanttModel()
Returns the data model currently being displayed by the column.
|
IlvStringProperty |
getProperty()
Returns the activity or resource property that will be displayed in
the column.
|
Object |
getValue(IlvHierarchyNode row)
Returns the string value of this column property for the specified
row.
|
void |
inform(EventObject event)
Invoked when the property represented by this column has been modified
in one of the rows.
|
boolean |
isChildrenEditable()
Returns whether leaf rows in this column are editable.
|
boolean |
isEditable(IlvHierarchyNode row)
Returns whether the cell at the intersection of this column and the
specified row is editable.
|
boolean |
isParentsEditable()
Returns whether parent rows in this column are editable.
|
void |
setChildrenEditable(boolean editable)
Sets whether the leaf rows in this column are editable.
|
void |
setGanttConfiguration(IlvGanttConfiguration ganttConfig)
This method is invoked whenever this column is added to or removed
from the Gantt configuration.
|
void |
setParentsEditable(boolean editable)
Sets whether the parent rows in this column are editable.
|
void |
setValue(IlvHierarchyNode row,
Object value)
Sets the string value of this column property for the specified row.
|
cellUpdated, columnHeaderUpdated, columnUpdated, createRenderer, getColumn, getColumnIndex, getModelIndex, getTable, getValueAsText, setTable, updateUI
public IlvStringColumn(Object headerValue, IlvStringProperty property)
headerValue
- The value rendered in the column header.property
- The activity or resource property that will be
displayed in the column.public IlvStringColumn(Object headerValue, IlvStringProperty property, Object identifier)
headerValue
- The value rendered in the column header.property
- The activity or resource property that will be
displayed in the column.identifier
- The column identifier.public IlvStringColumn(Object headerValue, IlvStringProperty property, int width)
width
parameter is used to set both the preferred and
initial width of the column. Note that in this case, the column
identifier, if not set, will be the header value.headerValue
- The value rendered in the column header.property
- The activity or resource property that will be
displayed in the column.width
- The width of the column.public IlvStringColumn(Object headerValue, IlvStringProperty property, int width, Object identifier)
width
parameter is used to set
both the preferred and initial width of the column.headerValue
- The value rendered in the column header.property
- The activity or resource property that will be
displayed in the column.width
- The width of the column.identifier
- The column identifier.protected TableCellEditor createEditor()
IlvTextFieldTableEditor
that will be used to edit
the cells in this column. When editing of a cell begins, the editor's
getTableCellEditorComponent
method will be passed the
value returned by the column's getValue(ilog.views.gantt.IlvHierarchyNode)
method.
When editing is completed, the value returned by the
editor's getCellEditorValue
method will be passed to
the column's setValue(ilog.views.gantt.IlvHierarchyNode, java.lang.Object)
method. The
IlvTextFieldTableEditor
returned by this method is
installed onto the column's internal TableColumn
object.createEditor
in class IlvAbstractJTableColumn
null
, as the default table cell editor.protected final IlvGanttConfiguration getGanttConfiguration()
public void setGanttConfiguration(IlvGanttConfiguration ganttConfig)
Warning: This method is considered to be part of an
IlvJTableColumn
's internal implementation and is not a public
API. Only the IlvJTable
should invoke this method.
setGanttConfiguration
in interface IlvJTableColumn
setGanttConfiguration
in class IlvAbstractJTableColumn
ganttConfig
- The Gantt configuration that this column is being
added to, or null
if this column is being
removed from its Gantt configurationprotected final IlvGanttModel getGanttModel()
public IlvStringProperty getProperty()
public Object getValue(IlvHierarchyNode row)
TableCellRenderer.getTableCellRendererComponent
method
to render the cell and will be passed to the
TableCellEditor.getTableCellEditorComponent
method when
editing of the cell begins.
The type of the specified row
will match the row
organization of the Gantt configuration of which the table is a
member. In other words, if the Gantt configuration's row type is
ACTIVITY_ROWS
, then
row
will be an IlvActivity
.
Otherwise, the Gantt configuration's row type is
RESOURCE_ROWS
and
row
will be an IlvResource
.
getValue
in interface IlvJTableColumn
getValue
in class IlvAbstractJTableColumn
row
- The row.setValue(ilog.views.gantt.IlvHierarchyNode, java.lang.Object)
,
createEditor()
public void setValue(IlvHierarchyNode row, Object value)
value
will be the string returned by the
IlvTextFieldTableEditor
's getCellEditorValue
method.
The type of the specified row
will match the row
organization of the Gantt configuration of which the table is a
member. In other words, if the Gantt configuration's row type is
ACTIVITY_ROWS
, then
row
will be an IlvActivity
.
Otherwise, the Gantt configuration's row type is
RESOURCE_ROWS
and
row
will be an IlvResource
.
setValue
in interface IlvJTableColumn
setValue
in class IlvAbstractJTableColumn
row
- The row.value
- The new value.getValue(ilog.views.gantt.IlvHierarchyNode)
,
createEditor()
public boolean isEditable(IlvHierarchyNode row)
setParentsEditable(boolean)
or setChildrenEditable(boolean)
,
respectively. The default is true
.isEditable
in interface IlvJTableColumn
isEditable
in class IlvAbstractJTableColumn
row
- The row.true
if the cell is editable, false
otherwise.isParentsEditable()
,
isChildrenEditable()
public boolean isParentsEditable()
true
.setParentsEditable(boolean)
,
isEditable(ilog.views.gantt.IlvHierarchyNode)
public void setParentsEditable(boolean editable)
public boolean isChildrenEditable()
true
.setChildrenEditable(boolean)
,
isEditable(ilog.views.gantt.IlvHierarchyNode)
public void setChildrenEditable(boolean editable)
public void inform(EventObject event)
inform
in interface GenericEventListener
event
- The value event.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.