/** * Creates a copy of the receiver. * * @return a copy of the receiver */ public RowLayoutFactory copy() { return new RowLayoutFactory(create()); }
/** * Creates a factory that creates copies of the given layout. * * @param layout * layout to copy * @return a new RowLayoutFactory instance that creates copies of the given * layout */ public static RowLayoutFactory createFrom(RowLayout layout) { return new RowLayoutFactory(copyLayout(layout)); }
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); }
/** * Creates a new RowLayout, and initializes it with values from the factory. * * @return a new initialized RowLayout. * @see #applyTo */ public RowLayout create() { return copyLayout(layout); }
/** * Creates a RowLayoutFactory that creates RowLayouts with the default SWT * values. * * <p> * Initial values are: * </p> * * <ul> * <li>margins(0,0)</li> * <li>extendedMargins(3,3,3,3)</li> * <li>wrap(true)</li> * <li>pack(true)</li> * <li>fill(false)</li> * <li>justify(false)</li> * <li>spacing(3)</li> * </ul> * * @return a RowLayoutFactory that creates RowLayouts as though created with * their default constructor * @see #fillDefaults */ public static RowLayoutFactory swtDefaults() { return new RowLayoutFactory(new RowLayout()); }
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);
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; }
/** * Creates a new RowLayout, and initializes it with values from the factory. * * @return a new initialized RowLayout. * @see #applyTo */ public RowLayout create() { return copyLayout(layout); }
/** * Creates a RowLayoutFactory that creates RowLayouts with the default SWT * values. * * <p> * Initial values are: * </p> * * <ul> * <li>margins(0,0)</li> * <li>extendedMargins(3,3,3,3)</li> * <li>wrap(true)</li> * <li>pack(true)</li> * <li>fill(false)</li> * <li>justify(false)</li> * <li>spacing(3)</li> * </ul> * * @return a RowLayoutFactory that creates RowLayouts as though created with * their default constructor * @see #fillDefaults */ public static RowLayoutFactory swtDefaults() { return new RowLayoutFactory(new RowLayout()); }
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; }
/** * Creates a copy of the receiver. * * @return a copy of the receiver */ public RowLayoutFactory copy() { return new RowLayoutFactory(create()); }
/** * Creates a factory that creates copies of the given layout. * * @param layout * layout to copy * @return a new RowLayoutFactory instance that creates copies of the given * layout */ public static RowLayoutFactory createFrom(RowLayout layout) { return new RowLayoutFactory(copyLayout(layout)); }
/** * Creates a new RowLayout, and initializes it with values from the factory. * * @return a new initialized RowLayout. * @see #applyTo */ public RowLayout create() { return copyLayout(layout); }
/** * Creates a RowLayoutFactory that creates RowLayouts with the default SWT * values. * * <p> * Initial values are: * </p> * * <ul> * <li>margins(0,0)</li> * <li>extendedMargins(3,3,3,3)</li> * <li>wrap(true)</li> * <li>pack(true)</li> * <li>fill(false)</li> * <li>justify(false)</li> * <li>spacing(3)</li> * </ul> * * @return a RowLayoutFactory that creates RowLayouts as though created with * their default constructor * @see #fillDefaults */ public static RowLayoutFactory swtDefaults() { return new RowLayoutFactory(new RowLayout()); }
/** * Creates a copy of the receiver. * * @return a copy of the receiver */ public RowLayoutFactory copy() { return new RowLayoutFactory(create()); }
/** * Creates a factory that creates copies of the given layout. * * @param layout * layout to copy * @return a new RowLayoutFactory instance that creates copies of the given * layout */ public static RowLayoutFactory createFrom(RowLayout layout) { return new RowLayoutFactory(copyLayout(layout)); }
/** * Creates a new RowLayout and attaches it to the given composite. Does not * create the rowData of any of the controls in the composite. * * @param c * composite whose layout will be set * @see #create * @see RowLayoutFactory */ public void applyTo(Composite c) { c.setLayout(copyLayout(layout)); }
/** * Creates a RowLayoutFactory that creates RowLayouts with no margins, fill * behavior, and default dialog spacing. * * <p> * Initial values are: * </p> * * <ul> * <li>margins(0,0)</li> * <li>extendedMargins(0,0,0,0)</li> * <li>wrap(true)</li> * <li>pack(true)</li> * <li>fill(false)</li> * <li>justify(false)</li> * <li>spacing(LayoutConstants.getSpacing().x</li> * </ul> * * @return a RowLayoutFactory that creates RowLayouts with no margins * @see #swtDefaults */ public static RowLayoutFactory fillDefaults() { RowLayout layout = new RowLayout(); layout.marginTop = 0; layout.marginBottom = 0; layout.marginLeft = 0; layout.marginRight = 0; layout.spacing = LayoutConstants.getSpacing().x; return new RowLayoutFactory(layout); }
/** * Creates a new RowLayout and attaches it to the given composite. Does not * create the rowData of any of the controls in the composite. * * @param c * composite whose layout will be set * @see #create * @see RowLayoutFactory */ public void applyTo(Composite c) { c.setLayout(copyLayout(layout)); }
/** * Creates a RowLayoutFactory that creates RowLayouts with no margins, fill * behavior, and default dialog spacing. * * <p> * Initial values are: * </p> * * <ul> * <li>margins(0,0)</li> * <li>extendedMargins(0,0,0,0)</li> * <li>wrap(true)</li> * <li>pack(true)</li> * <li>fill(false)</li> * <li>justify(false)</li> * <li>spacing(LayoutConstants.getSpacing().x</li> * </ul> * * @return a RowLayoutFactory that creates RowLayouts with no margins * @see #swtDefaults */ public static RowLayoutFactory fillDefaults() { RowLayout layout = new RowLayout(); layout.marginTop = 0; layout.marginBottom = 0; layout.marginLeft = 0; layout.marginRight = 0; layout.spacing = LayoutConstants.getSpacing().x; return new RowLayoutFactory(layout); }