Class SWTFontUtils

java.lang.Object
de.frankmuenster.mahoe.gui.utils.SWTFontUtils

public class SWTFontUtils extends Object
SWT font related utility methods.
  • Method Details

    • getMonospacedFont

      public static org.eclipse.swt.graphics.Font getMonospacedFont() throws AssertionError
      Returns the monospaced font for the current display. The font will automatically be disposed once the display is disposed.

      This method is thread safe.

      Returns:
      The monospaced font for the current display.
      Throws:
      IllegalStateException - If the method is not invoked from a SWT UI thread.
      AssertionError
      IllegalArgumentException
    • getMonospacedFont

      public static org.eclipse.swt.graphics.Font getMonospacedFont(org.eclipse.swt.widgets.Display display) throws AssertionError
      Creates a monospaced font for the given display. The font will automatically be disposed once the display is disposed.

      This method is thread safe.

      Parameters:
      display - The display for which to create a monospaced font.
      Returns:
      A monospaced font for the given display.
      Throws:
      AssertionError
      IllegalArgumentException