ToolBar createToolbar(final MUIElement element, Composite intermediate) { int orientation = getOrientation(element); RowLayout layout = RowLayoutFactory.fillDefaults().wrap(false) .spacing(0).type(orientation).create(); layout.marginLeft = 3; layout.center = true; intermediate.setLayout(layout); // new Label(intermediate, (orientation == SWT.HORIZONTAL ? SWT.VERTICAL // : SWT.HORIZONTAL) | SWT.SEPARATOR); ToolBar separatorToolBar = new ToolBar(intermediate, orientation | SWT.WRAP | SWT.FLAT | SWT.RIGHT); new ToolItem(separatorToolBar, SWT.SEPARATOR); return new ToolBar(intermediate, orientation | SWT.WRAP | SWT.FLAT | SWT.RIGHT); }
public static Composite wrapTrim(Control trim) { int orientation = SWT.HORIZONTAL; if (trim instanceof ToolBar) orientation = (((ToolBar) trim).getStyle() & SWT.VERTICAL) == 0 ? SWT.HORIZONTAL : SWT.VERTICAL; Composite parentComp = trim.getParent(); Composite wrapper = new Composite(parentComp, SWT.NONE); RowLayout layout = RowLayoutFactory.fillDefaults().wrap(false) .spacing(0).type(orientation).create(); layout.marginLeft = 3; layout.center = true; wrapper.setLayout(layout); // Separator (aka 'drag handle') ToolBar separatorToolBar = new ToolBar(wrapper, orientation | SWT.WRAP | SWT.FLAT | SWT.RIGHT); new ToolItem(separatorToolBar, SWT.SEPARATOR); // Put the trim under the wrapper and ensure it's last trim.setParent(wrapper); trim.moveBelow(null); return wrapper; }
public static Composite wrapTrim(Control trim) { int orientation = SWT.HORIZONTAL; if (trim instanceof ToolBar) orientation = (((ToolBar) trim).getStyle() & SWT.VERTICAL) == 0 ? SWT.HORIZONTAL : SWT.VERTICAL; Composite parentComp = trim.getParent(); Composite wrapper = new Composite(parentComp, SWT.NONE); RowLayout layout = RowLayoutFactory.fillDefaults().wrap(false) .spacing(0).type(orientation).create(); layout.marginLeft = 3; layout.center = true; wrapper.setLayout(layout); // Separator (aka 'drag handle') ToolBar separatorToolBar = new ToolBar(wrapper, orientation | SWT.WRAP | SWT.FLAT | SWT.RIGHT); new ToolItem(separatorToolBar, SWT.SEPARATOR); // Put the trim under the wrapper and ensure it's last trim.setParent(wrapper); trim.moveBelow(null); return wrapper; }
public PageNavigationControl(Composite parent, int style) { super(parent, style); setBackground(parent.getBackground()); RowLayoutFactory.fillDefaults().extendedMargins(0, 0, 50, 5).applyTo(this); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.END).grab(true, true).applyTo(this); Color hyperlinkColor = getDisplay().getSystemColor(SWT.COLOR_LINK_FOREGROUND);