Package org.eclipse.jface.layout

Examples of org.eclipse.jface.layout.PixelConverter.convertHorizontalDLUsToPixels()


   * Returns a width hint for a button control.
   */
  public static int getButtonWidthHint(Button button) {
    /*button.setFont(JFaceResources.getDialogFont());*/
    PixelConverter converter= new PixelConverter(button);
    int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
  }
 
}
View Full Code Here


class SWTFactory {

  public static int getButtonWidthHint(Button button) {
    button.setFont(JFaceResources.getDialogFont());
    PixelConverter converter = new PixelConverter(button);
    int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
  }

  /**
   * Sets width and height hint for the button control. <b>Note:</b> This is a
View Full Code Here

class SWTFactory {

  public static int getButtonWidthHint(Button button) {
    button.setFont(JFaceResources.getDialogFont());
    PixelConverter converter = new PixelConverter(button);
    int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
  }

  /**
   * Sets width and height hint for the button control. <b>Note:</b> This is a
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.