| | | | Browse by category |
Question
How to access the scrollbars of IlvHierarchyChart?
Answer
The horizontal scrollbar of the Gantt Sheet can be accessed using the
IlvHierarchyChart.getTimeScrollBar().
In order to gain access to the vertical scrollbar of IlvHierarchyChart
, it is necessary
to get IlvJScrollGanttSheet
, which is an indirect parent of
IlvGanttSheet
. Use code like this:
IlvJScrollGanttSheet jSGanttSheet = (IlvJScrollGanttSheet)
SwingUtilities.getAncestorOfClass(IlvJScrollGanttSheet.class, chart.getGanttSheet());
JScrollBar verticalScrollbar = jSGanttSheet.getVerticalScrollBar();
where chart
is an instance of IlvHierarchyChart
.
The horizontal scrollbar of the Gantt Table can be access using the following:
JScrollPane scrollPane = (JScrollPane)
SwingUtilities.getAncestorOfClass(JScrollPane.class,
chart.getTable());
JScrollBar tableSb = scrollPane.getHorizontalScrollBar();
However, IlvHierarchyChart
provides upper level methods to
control the visibility of the contents of the chart, such as
IlvHierarchyChart.makeRowVisible(IlvHierarchyNode row)
or
IlvHierarchyChart.setVisibleInterval(Date time, IlvDuration
duration)
.
Note: The above codes only address the Swing Gantt Chart component, not JSF Gantt Chart component