Class Utils


  • public class Utils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.eclipse.swt.graphics.Font applyBoldFont​(org.eclipse.swt.graphics.Font font)
      Takes a font and gives it a bold typeface.
      static org.eclipse.swt.graphics.Font applyFontData​(org.eclipse.swt.graphics.Font font, int style, int size)
      Takes a font and gives it the typeface of the given style.
      static org.eclipse.swt.graphics.Font applyFontSize​(org.eclipse.swt.graphics.Font font, int size)
      Applies a certain font size to a font.
      static void centerDialogOnScreen​(org.eclipse.swt.widgets.Shell shell)
      Centers a dialog (Shell) on the primary (active) display.
      • Methods inherited from class java.lang.Object

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

      • Utils

        public Utils()
    • Method Detail

      • applyBoldFont

        public static org.eclipse.swt.graphics.Font applyBoldFont​(org.eclipse.swt.graphics.Font font)
        Takes a font and gives it a bold typeface.
        Parameters:
        font - Font to modify
        Returns:
        Font with bold typeface
      • applyFontData

        public static org.eclipse.swt.graphics.Font applyFontData​(org.eclipse.swt.graphics.Font font,
                                                                  int style,
                                                                  int size)
        Takes a font and gives it the typeface of the given style.
        Parameters:
        font - Font to modify
        style - the new style for the given font (e.g. SWT.BOLD|SWT.ITALIC)
        size - New font size
        Returns:
        Font with the given typeface and size
      • applyFontSize

        public static org.eclipse.swt.graphics.Font applyFontSize​(org.eclipse.swt.graphics.Font font,
                                                                  int size)
        Applies a certain font size to a font.
        Parameters:
        font - Font to modify
        size - New font size
        Returns:
        Font with new font size
      • centerDialogOnScreen

        public static void centerDialogOnScreen​(org.eclipse.swt.widgets.Shell shell)
        Centers a dialog (Shell) on the primary (active) display.
        Parameters:
        shell - Shell to center on screen
        See Also:
        Shell