Commit d892de32 authored by Romain Bioteau's avatar Romain Bioteau

use a drop down menu item for new

parent f6d47e88
......@@ -166,8 +166,8 @@ public class CoolbarToolControl
private void createToolbar(final Composite toolbarContainer) {
toolbar = new ToolBar(toolbarContainer, SWT.FLAT | SWT.HORIZONTAL);
toolbar.setLayoutDeferred(true);
toolbar.setLayoutData(GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, true).create());
fillBonitaBar();
final ToolBar sizingToolbar = new ToolBar(toolbarContainer, SWT.FLAT | SWT.VERTICAL);
......@@ -198,6 +198,8 @@ public class CoolbarToolControl
}
}
});
toolbar.setLayoutDeferred(false);
toolbar.layout();
}
private void fillBonitaBar() {
......
......@@ -113,7 +113,7 @@ public class NewCoolbarItem extends ContributionItem implements IBonitaContribut
@Override
public void fill(final ToolBar toolbar, final int index, final int iconSize) {
final ToolItem item = new ToolItem(toolbar, SWT.PUSH);
final ToolItem item = new ToolItem(toolbar, SWT.DROP_DOWN);
item.setToolTipText(Messages.NewButtonTooltip);
if (iconSize < 0) {
item.setText(Messages.NewButtonLabel);
......
......@@ -20,15 +20,8 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
/**
* @author Romain Bioteau
*/
public class SeparatorCoolbarItem extends ContributionItem implements IBonitaContributionItem {
/*
* (non-Javadoc)
* @see org.eclipse.jface.action.IContributionItem#getId()
*/
@Override
public String getId() {
return "org.bonitasoft.studio.coolbar.separator";
......@@ -36,7 +29,8 @@ public class SeparatorCoolbarItem extends ContributionItem implements IBonitaCon
@Override
public void fill(final ToolBar toolbar, final int index, final int iconSize) {
new ToolItem(toolbar, SWT.SEPARATOR | SWT.VERTICAL).setEnabled(true);
ToolItem toolItem = new ToolItem(toolbar, SWT.SEPARATOR | SWT.VERTICAL);
toolItem.setEnabled(true);
}
}
......@@ -35,19 +35,13 @@ import org.eclipse.ui.commands.ICommandService;
*/
public class ConfigureCoolbarItem extends ContributionItem implements IBonitaContributionItem {
/*
* (non-Javadoc)
* @see org.eclipse.jface.action.IContributionItem#getId()
*/
@Override
public String getId() {
return "org.bonitasoft.studio.coolbar.configure";
}
/*
* (non-Javadoc)
* @see org.eclipse.jface.action.IContributionItem#isEnabled()
*/
@Override
public boolean isEnabled() {
return getCommand().isEnabled();
......@@ -81,7 +75,7 @@ public class ConfigureCoolbarItem extends ContributionItem implements IBonitaCon
}
private Command getCommand() {
final ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
final ICommandService service = PlatformUI.getWorkbench().getService(ICommandService.class);
return service.getCommand("org.bonitasoft.studio.configuration.configure");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment