Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Shell.computeSize()


    Shell shell = getShell();

    /* Minimum Size */
    int minWidth = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
    int minHeight = shell.computeSize(minWidth, SWT.DEFAULT).y;

    /* Required Size */
    Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

    /* Bug in SWT: The preferred width of the state condition is wrong */
 
View Full Code Here


    /* Minimum Size */
    int minWidth = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
    int minHeight = shell.computeSize(minWidth, SWT.DEFAULT).y;

    /* Required Size */
    Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

    /* Bug in SWT: The preferred width of the state condition is wrong */
    if (Application.IS_LINUX && displaysSavedSearch())
      requiredSize.x = requiredSize.x + 100;

View Full Code Here

    }

    /* Pack Shell and expect enough room to fit the Control */
    else {
      int currentWidth = shell.getSize().x;
      Point desiredSize = shell.computeSize(currentWidth, SWT.DEFAULT);
      if (desiredSize.y > shell.getSize().y)
        shell.setSize(currentWidth, desiredSize.y);
      else
        shell.layout(true, true);
    }
View Full Code Here

    Shell shell = getShell();

    /* Minimum Size */
    int minWidth = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
    int minHeight = shell.computeSize(minWidth, SWT.DEFAULT).y;

    /* Required Size */
    Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

    shell.setSize(Math.max(minWidth, requiredSize.x), Math.max(minHeight, requiredSize.y));
View Full Code Here

    /* Minimum Size */
    int minWidth = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
    int minHeight = shell.computeSize(minWidth, SWT.DEFAULT).y;

    /* Required Size */
    Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

    shell.setSize(Math.max(minWidth, requiredSize.x), Math.max(minHeight, requiredSize.y));
    LayoutUtils.positionShell(shell);
  }
}
View Full Code Here

        Shell shell = browser.getShell();
        if (event.location != null)
          shell.setLocation(event.location);
        if (event.size != null) {
          Point size = event.size;
          shell.setSize(shell.computeSize(size.x, size.y));
        }
        shell.open();
      }
    });
    browser.addCloseWindowListener(new CloseWindowListener() {
View Full Code Here

    Shell shell = browser.getShell();
    if (event.location != null)
      shell.setLocation(event.location);
    if (event.size != null) {
      Point size = event.size;
      shell.setSize(shell.computeSize(size.x, size.y));
    }
    shell.open();
  }

  public void close(WindowEvent event) {
View Full Code Here

    final Shell shell = browser.getShell();
    if (owned) {
      if (location != null)
        shell.setLocation(location);
      if (size != null)
        shell.setSize(shell.computeSize(size.x, size.y));
    }
    FormData data = null;
    if (toolBar) {
      toolbar = new ToolBar(parent, SWT.NONE);
      data = new FormData();
View Full Code Here

        gc.drawPath(path);
        tr.dispose();
        path.dispose();
      }
    });
    shell.setSize(shell.computeSize(rect.width, rect.height));
    shell.open();
    shell.addListener(SWT.Dispose, new Listener() {
      public void handleEvent(Event event) {
        if (image != null)
          image.dispose();
View Full Code Here

        gc.drawPath(path);
        tr.dispose();
        path.dispose();
      }
    });
    shell.setSize(shell.computeSize(rect.width / 2, rect.height / 2));
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.