Hi,
I'm glad you are enjoying the control so far. Here are the answers to your questions:
1. Use the ResourceViewSettings.setRowHeaderSize method:
calendar.getResourceViewSettings().setRowHeaderSize(200);
2. Use the ResourceViewSettings.setExpandableRows method;
calendar.getResourceViewSettings().setExpandableRows(false);
3. Use the Style object returned by the ResourceViewSettings.getStyle method:
Style style = calendar.getResourceViewSettings().getStyle();
style.setHeaderFont(style.getHeaderFont().deriveFont(12, FontStyles.Bold));
style.setHeaderBrush(Brushes.PaleGoldenrod);
4. If you want to disable in-place editing for specific items, you need to add a CalendarListener to the Calendar component and override the itemInplaceEditStarting method:
calendar.addCalendarListener(new CalendarAdapter()
{
@Override
public void itemInplaceEditStarting(ItemConfirmEvent e) {
if ("RESERVED".equals(e.getItem().getHeaderText()))
e.setConfirm(false);
}
});
If you want to disable editing globally, call calendar.setAllowInplaceEdit(false).
5. There are various setPadding* methods in the ItemSettings class, but they appear to be ignored in the Resource view. We will look into it.
6. Use the Item.getStyle().setFillColor method of the individual items:
item.getStyle().setFillColor(Colors.Red);
7. Indeed, the date styles are not used in Resourc view. Instead you can use custom drawing to achieve the desired result. First, call the Calendar.setCustomDraw method with CustomDrawElements.ResourceViewCell to indicate the element that should be customized.
calendar.setCustomDraw(CustomDrawElements.ResourceViewCell);
Then, add a CalendarListener and override the draw method:
@Override
public void draw(DrawEvent e) {
if (e.getElement() == CustomDrawElements.ResourceViewCell)
{
if (DateTime.op_Equality(e.getDate(), DateTime.today()))
e.getGraphics().fillRectangle(Brushes.PaleGoldenrod, e.getBounds());
}
}
8. Each timeline is customized through its respective TimelineSettings object, which can be obtained through the ResourceViewSettings.getBottomTimelineSettings, ResourceViewSettings.getMiddleTimelineSettings, and ResourceViewSettings.getTopTimelineSettings methods respectively. To set the font and text alignment use the setHeaderFont and setHeaderTextAlignment methods of the timeline's Style:
style = calendar.getResourceViewSettings().getBottomTimelineSettings().getStyle();
style.setHeaderFont(style.getHeaderFont().deriveFont(11, FontStyles.Regular));
style.setHeaderTextAlignment(TextAlignment.MiddleCenter);
9. You can use the Calendar.setItemChangeResourceKey method and specify any key other than the three modifier keys (Control, Alt, Shift). For example:
calendar.setItemChangeResourceKey(Keys.Home);
Regards,
Meppy