Search in sources :

Example 16 with FontData

use of org.eclipse.swt.graphics.FontData in project tdi-studio-se by Talend.

the class DataBusinessItemNameEditPart method refreshFont.

/**
     * @generated
     */
protected void refreshFont() {
    FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    if (style != null) {
        FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
        setFont(fontData);
    }
}
Also used : FontStyle(org.eclipse.gmf.runtime.notation.FontStyle) FontData(org.eclipse.swt.graphics.FontData)

Example 17 with FontData

use of org.eclipse.swt.graphics.FontData in project tdi-studio-se by Talend.

the class ActionBusinessItemNameEditPart method refreshFont.

/**
     * @generated
     */
protected void refreshFont() {
    FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    if (style != null) {
        FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
        setFont(fontData);
    }
}
Also used : FontStyle(org.eclipse.gmf.runtime.notation.FontStyle) FontData(org.eclipse.swt.graphics.FontData)

Example 18 with FontData

use of org.eclipse.swt.graphics.FontData in project tdi-studio-se by Talend.

the class TerminalBusinessItemNameEditPart method refreshFont.

/**
     * @generated
     */
protected void refreshFont() {
    FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    if (style != null) {
        FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
        setFont(fontData);
    }
}
Also used : FontStyle(org.eclipse.gmf.runtime.notation.FontStyle) FontData(org.eclipse.swt.graphics.FontData)

Example 19 with FontData

use of org.eclipse.swt.graphics.FontData in project tdi-studio-se by Talend.

the class ListBusinessItemNameEditPart method refreshFont.

/**
     * @generated
     */
protected void refreshFont() {
    FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    if (style != null) {
        FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
        setFont(fontData);
    }
}
Also used : FontStyle(org.eclipse.gmf.runtime.notation.FontStyle) FontData(org.eclipse.swt.graphics.FontData)

Example 20 with FontData

use of org.eclipse.swt.graphics.FontData in project tdi-studio-se by Talend.

the class SWTResourceManager method getFont.

/**
     * Returns a font based on its name, height and style
     * 
     * @param name String The name of the font
     * @param height int The height of the font
     * @param style int The style of the font
     * @return Font The font matching the name, height and style
     */
public static Font getFont(String name, int height, int style) {
    String fontName = name + '|' + height + '|' + style;
    Font font = m_FontMap.get(fontName);
    if (font == null) {
        FontData fontData = new FontData(name, height, style);
        font = new Font(Display.getCurrent(), fontData);
        m_FontMap.put(fontName, font);
    }
    return font;
}
Also used : FontData(org.eclipse.swt.graphics.FontData) Font(org.eclipse.swt.graphics.Font)

Aggregations

FontData (org.eclipse.swt.graphics.FontData)70 Font (org.eclipse.swt.graphics.Font)38 FontStyle (org.eclipse.gmf.runtime.notation.FontStyle)14 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)11 GridData (org.eclipse.swt.layout.GridData)11 GridLayout (org.eclipse.swt.layout.GridLayout)9 Composite (org.eclipse.swt.widgets.Composite)9 Point (org.eclipse.swt.graphics.Point)8 Label (org.eclipse.swt.widgets.Label)8 Text (org.eclipse.swt.widgets.Text)5 ColorStyledText (org.talend.commons.ui.swt.colorstyledtext.ColorStyledText)5 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)4 SelectionEvent (org.eclipse.swt.events.SelectionEvent)4 Color (org.eclipse.swt.graphics.Color)4 GC (org.eclipse.swt.graphics.GC)4 IFigure (org.eclipse.draw2d.IFigure)3 Dimension (org.eclipse.draw2d.geometry.Dimension)3 DecoratedField (org.eclipse.jface.fieldassist.DecoratedField)3 FormAttachment (org.eclipse.swt.layout.FormAttachment)3 FormData (org.eclipse.swt.layout.FormData)3