Hi,
In order to achieve this, you need to use custom drawing on the timeline. Set the CustomDraw property to CustomDrawElements.ResourceViewTimeline and add a CalendarListener.draw listener:
public void draw(DrawEvent e)
{
if (e.getElement() == CustomDrawElements.ResourceViewTimeline && e.getBounds().getY() < 10)
{
Rectangle r = e.getBounds();
int width = calendar.getResourceViewSettings().getRowHeaderSize().intValue();
RectangleD left = new RectangleD(r.getLeft(), r.getTop(), width / 2, r.getHeight());
RectangleD right = new RectangleD(r.getLeft() + width / 2, r.getTop(), width / 2, r.getHeight());
Font f = new Font("Arial", 12);
e.getGraphics().drawString("Craft", f, Brushes.Red, left);
e.getGraphics().drawString("Employee", f, Brushes.Red, right);
}
}
Normally, you would inspect the e.getIndex() argument to check which timeline is being drawn, but it appears that this property is 0 for all timelines. Because of this, we inspect the bounding rectangle.
Regards,
Meppy