@Test public void changeFontHeight() { Shell control = displayHelper.createShell(); List<Integer> expected = calculateExpectedFontDataHeights( control ); Resources.changeFontHeight( control, FONT_SIZE_INCREMENT ); assertThat( getFontDataHeights( control ) ).isEqualTo( expected ); }
public static void changeFontHeight( Control control, int increment ) { FontData[] fontData = control.getFont().getFontData(); asList( fontData ).forEach( data -> data.setHeight( data.getHeight() + increment ) ); Font newFont = new Font( control.getDisplay(), fontData ); control.setFont( newFont ); control.addListener( SWT.Dispose, evt -> newFont.dispose() ); }
Resources { public static void changeFontHeight( Control control, int increment ) { FontData[] fontData = control.getFont().getFontData(); asList( fontData ).forEach( data -> data.setHeight( data.getHeight() + increment ) ); Font newFont = new Font( control.getDisplay(), fontData ); control.setFont( newFont ); control.addListener( SWT.Dispose, evt -> newFont.dispose() ); } }
Resources { public static void changeFontHeight( Control control, int increment ) { FontData[] fontData = control.getFont().getFontData(); asList( fontData ).forEach( data -> data.setHeight( data.getHeight() + increment ) ); Font newFont = new Font( control.getDisplay(), fontData ); control.setFont( newFont ); control.addListener( SWT.Dispose, evt -> newFont.dispose() ); }  }
Resources { public static void changeFontHeight( Control control, int increment ) { FontData[] fontData = control.getFont().getFontData(); asList( fontData ).forEach( data -> data.setHeight( data.getHeight() + increment ) ); Font newFont = new Font( control.getDisplay(), fontData ); control.setFont( newFont ); control.addListener( SWT.Dispose, evt -> newFont.dispose() ); }  static Color getColorWhite(); static Color getColorRed(); static void changeFontHeight( Control control, int increment ); }
Resources { public static void changeFontHeight( Control control, int increment ) { FontData[] fontData = control.getFont().getFontData(); asList( fontData ).forEach( data -> data.setHeight( data.getHeight() + increment ) ); Font newFont = new Font( control.getDisplay(), fontData ); control.setFont( newFont ); control.addListener( SWT.Dispose, evt -> newFont.dispose() ); }  static Color getColorWhite(); static Color getColorRed(); static void changeFontHeight( Control control, int increment ); static final int MARGIN; }