OwlUI.positionDropDownMenu(this, fFilterGroupingLayoutToolBarManager);
}
@Override
public ImageDescriptor getImageDescriptor() {
Layout currentLayout = getLayout();
switch (currentLayout) {
case CLASSIC:
return OwlUI.getImageDescriptor("icons/obj16/classic_layout.gif"); //$NON-NLS-1$
case VERTICAL:
return OwlUI.getImageDescriptor("icons/obj16/vertical_layout.gif"); //$NON-NLS-1$
case LIST:
return OwlUI.getImageDescriptor("icons/obj16/list_layout.gif"); //$NON-NLS-1$
case NEWSPAPER:
return OwlUI.getImageDescriptor("icons/obj16/newspaper_layout.gif"); //$NON-NLS-1$
case HEADLINES:
return OwlUI.getImageDescriptor("icons/obj16/headlines_layout.gif"); //$NON-NLS-1$
}
return OwlUI.getImageDescriptor("icons/obj16/classic_layout.gif"); //$NON-NLS-1$
}
@Override
public String getText() {
Layout currentLayout = getLayout();
return currentLayout.getName();
}
};
newsLayout.setId(LAYOUT_ACTION);
newsLayout.setMenuCreator(new ContextMenuCreator() {
@Override
public Menu createMenu(Control parent) {
Layout currentLayout = getLayout();
Menu menu = new Menu(parent);
Layout[] layouts = new Layout[] { Layout.CLASSIC, Layout.VERTICAL, Layout.LIST, Layout.NEWSPAPER, Layout.HEADLINES };
for (final Layout layout : layouts) {
final MenuItem layoutMenuItem = new MenuItem(menu, SWT.RADIO);