timeEntryComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
timeEntryComposite.setTitleBarForeground(toolkit.getColors().getColor(IFormColors.TITLE));
timeEntryComposite.setBackground(bgColor);
final AbstractHyperlink titleLink = createTitle(timeEntryComposite, toolkit, bgColor);
final Composite detailsComposite = toolkit.createComposite(timeEntryComposite);
timeEntryComposite.setClient(detailsComposite);
GridLayout gl = new GridLayout(4, false);
detailsComposite.setLayout(gl);
GridData gd = new GridData();
gd.horizontalSpan = 4;
detailsComposite.setLayoutData(gd);
/* Expand: Click on caret */
timeEntryComposite.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent event) {
expandTimeEntry(toolkit, detailsComposite, event.getState());
}
});
/* Expand: Click on title */
titleLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
boolean expand = !timeEntryComposite.isExpanded();
timeEntryComposite.setExpanded(expand);
expandTimeEntry(toolkit, detailsComposite, expand);