Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Layout


   * @param composite
   * @param topbottom
   * @param rightleft
   */
  public static void trimComposite(Composite composite, int all) {
    Layout raw = composite.getLayout();
    if (raw instanceof GridLayout) {
      GridLayout layout = (GridLayout)raw;
      layout.marginTop = all;
      layout.marginRight = all;
      layout.marginBottom = all;
View Full Code Here


   * @param composite
   * @param vertical
   * @param horizontal
   */
  public static void setSpacing(Composite composite, int vertical, int horizontal) {
    Layout raw = composite.getLayout();
    if (raw instanceof GridLayout) {
      GridLayout layout = (GridLayout)raw;
      layout.verticalSpacing = vertical;
      layout.horizontalSpacing = horizontal;
    }
View Full Code Here

   * @param composite
   * @param vertical
   * @param horizontal
   */
  public static void setMargin(Composite composite, int vertical, int horizontal) {
    Layout raw = composite.getLayout();
    if (raw instanceof GridLayout) {
      GridLayout layout = (GridLayout)raw;
      layout.marginHeight = vertical;
      layout.marginWidth = horizontal;
    }
View Full Code Here

    return wrap ? wHint : SWT.DEFAULT;
  }

  public static int getHeightHint(int hHint, Control c) {
    if (c instanceof Composite) {
      Layout layout = ((Composite) c).getLayout();
      if (layout instanceof ColumnLayout)
        return hHint;
    }
    return SWT.DEFAULT;
  }
View Full Code Here

    return SWT.DEFAULT;
  }

  public static int computeMinimumWidth(Control c, boolean changed) {
    if (c instanceof Composite) {
      Layout layout = ((Composite) c).getLayout();
      if (layout instanceof ILayoutExtension)
        return ((ILayoutExtension) layout).computeMinimumWidth(
            (Composite) c, changed);
    }
    return c.computeSize(FormUtil.getWidthHint(5, c), SWT.DEFAULT, changed).x;
View Full Code Here

    return c.computeSize(FormUtil.getWidthHint(5, c), SWT.DEFAULT, changed).x;
  }

  public static int computeMaximumWidth(Control c, boolean changed) {
    if (c instanceof Composite) {
      Layout layout = ((Composite) c).getLayout();
      if (layout instanceof ILayoutExtension)
        return ((ILayoutExtension) layout).computeMaximumWidth(
            (Composite) c, changed);
    }
    return c.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed).x;
View Full Code Here

    }
   
    public int computeMinimumWidth() {
        if (minimumWidth == -1) {
        if (control instanceof Composite) {
          Layout layout = ((Composite)control).getLayout();
          if (layout instanceof ILayoutExtension) {
            minimumWidth = ((ILayoutExtension)layout).computeMinimumWidth((Composite)control, flushChildren);
            flushChildren = false;
          }
        }
View Full Code Here

    }
   
    public int computeMaximumWidth() {
        if (maximumWidth == -1) {
        if (control instanceof Composite) {
          Layout layout = ((Composite)control).getLayout();
          if (layout instanceof ILayoutExtension) {
            maximumWidth = ((ILayoutExtension)layout).computeMaximumWidth((Composite)control, flushChildren);
            flushChildren = false;
          }
        }
View Full Code Here

    Widgets.dispose(disposeInner);
    disposeInner = null;
    GridLayout layout = new GridLayout(2, false);

    Layout parentLayout = parent.getLayout();
    boolean useNestedComposite = parentLayout != null && !(parentLayout instanceof FillLayout || parentLayout instanceof GridLayout);
    if (useNestedComposite) {
      inner = new Composite(parent, SWT.NONE);
      disposeInner = inner;
    } else {
View Full Code Here

        }
        return composite;
    }

    private void updateCompositeLayout(Composite composite) {
        Layout l = composite.getLayout();
        if (l instanceof GridLayout) {
            GridLayout layout = (GridLayout) l;
            layout.marginHeight = convertVerticalDLUsToPixels(getDefaultMargins());
            layout.marginWidth = convertHorizontalDLUsToPixels(getDefaultMargins());
            layout.verticalSpacing = convertVerticalDLUsToPixels(getDefaultSpacing());
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Layout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.