public class IlvJTreeStringRenderPolicy extends IlvAbstractJTreeRenderPolicy implements GenericEventListener
IlvJTreeStringRenderPolicy
is a policy that can render
and edit a String
property of an IlvHierarchyNode
(that is, an activity or a resource) in an IlvJTree
. 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.Modifier and Type | Class and Description |
---|---|
protected class |
IlvJTreeStringRenderPolicy.PropertyEditor
PropertyEditor is a text field that can edit this
policy's property as a string. |
static class |
IlvJTreeStringRenderPolicy.PropertyRenderer
|
tree
Constructor and Description |
---|
IlvJTreeStringRenderPolicy(IlvStringProperty property)
Constructs a new
IlvJTreeStringRenderPolicy that will
render and edit the specified activity or resource property. |
Modifier and Type | Method and Description |
---|---|
protected TreeCellEditor |
createDefaultEditor()
Creates and returns a default tree cell editor for this policy.
|
protected TreeCellRenderer |
createDefaultRenderer()
Creates and returns a default tree cell renderer for this policy.
|
TreeCellEditor |
getEditor()
Returns this policy's
TreeCellEditor , or
null if the tree should not be editable. |
IlvStringProperty |
getProperty()
Returns the activity or resource property that this policy renders and
edits.
|
TreeCellRenderer |
getRenderer()
Returns this policy's
TreeCellRenderer . |
String |
getValueAsText(IlvHierarchyNode row)
Returns the text value of the specified row.
|
void |
inform(EventObject event)
Invoked when the property being rendered has been modified in one of
the rows.
|
boolean |
isChildrenEditable()
Returns whether leaf rows in the tree are editable.
|
boolean |
isEditable(IlvHierarchyNode row)
Returns whether the specified row is editable.
|
boolean |
isParentsEditable()
Returns whether parent rows in the tree are editable.
|
void |
setChildrenEditable(boolean editable)
Sets whether the leaf rows in the tree are editable.
|
void |
setGanttConfiguration(IlvGanttConfiguration ganttConfig)
Invoked whenever this rendering policy is added to or removed from the
Gantt configuration.
|
void |
setParentsEditable(boolean editable)
Sets whether the parent rows in the tree are editable.
|
void |
setTree(IlvJTree tree)
Invoked whenever this rendering policy is added to or removed from its
IlvJTree . |
void |
setValue(IlvHierarchyNode row,
Object value)
Sets the value of the data model at the specified row.
|
getTree, rowUpdated
public IlvJTreeStringRenderPolicy(IlvStringProperty property)
IlvJTreeStringRenderPolicy
that will
render and edit the specified activity or resource property.property
- The activity or resource property to be rendered and
edited.public IlvStringProperty getProperty()
public void setTree(IlvJTree tree)
IlvJTree
. It is overridden here to synchronize the
editable properties of this rendering policy and the tree.
Warning: This method is considered to be part of an
IlvJTreeRenderPolicy
's internal implementation and is
not a public API. Only the IlvJTree
should invoke this
method.
setTree
in interface IlvJTreeRenderPolicy
setTree
in class IlvAbstractJTreeRenderPolicy
tree
- The tree that this renderer policy is being assigned to,
or null
if this policy is being unassigned
from its tree.public void setGanttConfiguration(IlvGanttConfiguration ganttConfig)
Warning: This method is considered to be part of an
IlvJTreeRenderPolicy
's internal implementation and is
not a public API. Only the IlvJTree
should invoke this
method.
setGanttConfiguration
in interface IlvJTreeRenderPolicy
setGanttConfiguration
in class IlvAbstractJTreeRenderPolicy
ganttConfig
- The Gantt configuration that this rendering policy
is being added to, or null
if this policy is
being removed from its Gantt configuration.public TreeCellRenderer getRenderer()
TreeCellRenderer
.getRenderer
in interface IlvJTreeRenderPolicy
protected TreeCellRenderer createDefaultRenderer()
public TreeCellEditor getEditor()
TreeCellEditor
, or
null
if the tree should not be editable.getEditor
in interface IlvJTreeRenderPolicy
getEditor
in class IlvAbstractJTreeRenderPolicy
protected TreeCellEditor createDefaultEditor()
public boolean isEditable(IlvHierarchyNode row)
setParentsEditable(boolean)
or setChildrenEditable(boolean)
,
respectively. The default is true
.isEditable
in interface IlvJTreeRenderPolicy
isEditable
in class IlvAbstractJTreeRenderPolicy
row
- The row.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 String getValueAsText(IlvHierarchyNode row)
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
rowtype is
RESOURCE_ROWS
and
row
will be an IlvResource
.
getValueAsText
in interface IlvJTreeRenderPolicy
row
- The row.setValue(ilog.views.gantt.IlvHierarchyNode, java.lang.Object)
,
IlvJTree.convertValueToText(java.lang.Object, boolean, boolean, boolean, int, boolean)
public void setValue(IlvHierarchyNode row, Object value)
row
will match the row organization of the
Gantt configuration of which the tree 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
rowtype is
RESOURCE_ROWS
and
row
will be an IlvResource
.setValue
in interface IlvJTreeRenderPolicy
setValue
in class IlvAbstractJTreeRenderPolicy
row
- The row.value
- The new value.public void inform(EventObject event)
inform
in interface GenericEventListener
event
- The value event.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.