Class SWTFontUtils


  • public class SWTFontUtils
    extends java.lang.Object
    SWT font related utility methods.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.eclipse.swt.graphics.Font getMonospacedFont()
      Returns the monospaced font for the current display.
      static org.eclipse.swt.graphics.Font getMonospacedFont​(org.eclipse.swt.widgets.Display display)
      Creates a monospaced font for the given display.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getMonospacedFont

        public static org.eclipse.swt.graphics.Font getMonospacedFont()
                                                               throws java.lang.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:
        java.lang.IllegalStateException - If the method is not invoked from a SWT UI thread.
        java.lang.AssertionError
        java.lang.IllegalArgumentException
      • getMonospacedFont

        public static org.eclipse.swt.graphics.Font getMonospacedFont​(org.eclipse.swt.widgets.Display display)
                                                               throws java.lang.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:
        java.lang.AssertionError
        java.lang.IllegalArgumentException