Composite toolbarContainer = new Composite(headerContainer, SWT.NONE);
toolbarContainer.setLayout(LayoutUtils.createGridLayout(2, 0, 0, 0, 1, false));
toolbarContainer.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, true));
toolbarContainer.setBackground(fParent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
fAddFolderBar = new ToolBar(toolbarContainer, SWT.FLAT);
OwlUI.makeAccessible(fAddFolderBar, Messages.FolderChooser_NEW_FOLDER);
fAddFolderBar.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, true));
fAddFolderBar.setBackground(fParent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
fAddFolderBar.setCursor(headerContainer.getDisplay().getSystemCursor(SWT.CURSOR_ARROW));
fAddFolderBar.setVisible(!fExpandable);
ToolItem addFolderItem = new ToolItem(fAddFolderBar, SWT.PUSH);
addFolderItem.setImage(OwlUI.getImage(fResources, "icons/etool16/add_crop.gif")); //$NON-NLS-1$
addFolderItem.setToolTipText(Messages.FolderChooser_NEW_FOLDER);
addFolderItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
onNewFolder();
notifyListeners(SWT.Selection, new Event());
}
});
ToolBar toggleBar = new ToolBar(toolbarContainer, SWT.FLAT);
OwlUI.makeAccessible(toggleBar, Messages.FolderChooser_SHOW_FOLDERS);
toggleBar.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, true));
((GridData) toggleBar.getLayoutData()).exclude = !fExpandable;
toggleBar.setBackground(fParent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
toggleBar.setCursor(headerContainer.getDisplay().getSystemCursor(SWT.CURSOR_ARROW));
fToggleItem = new ToolItem(toggleBar, SWT.PUSH);
fToggleItem.setImage(OwlUI.getImage(fResources, "icons/ovr16/arrow_down.gif")); //$NON-NLS-1$
fToggleItem.setToolTipText(Messages.FolderChooser_SHOW_FOLDERS);
fToggleItem.addSelectionListener(new SelectionAdapter() {