Package org.eclipse.jface.resource

Examples of org.eclipse.jface.resource.FontRegistry


    private List<String> images = new ArrayList<String>();
    private Map<String, Font> fonts = new HashMap<String, Font>();

    public GDRegistry() {
        colorRegistry = new ColorRegistry();
        fontRegistry = new FontRegistry();
        imageRegistry = new ImageRegistry();
        init();
        load();
    }
View Full Code Here


            eventRunner = new UiThreadEventRunner();
        }

        if ( fontRegistry == null )
        {
            fontRegistry = new FontRegistry( getWorkbench().getDisplay() );
        }

        if ( colorRegistry == null )
        {
            colorRegistry = new ColorRegistry( getWorkbench().getDisplay() );
View Full Code Here

  private void updateFont() {
    CTabItem tabItem = getItem();

    // Set the font if necessary
    FontRegistry registry = PlatformUI.getWorkbench().getThemeManager()
        .getCurrentTheme().getFontRegistry();

    // Determine the parent font. We will set the tab's font
    Font targetFont = null;

    if (busy) {
      targetFont = registry
          .getItalic(IWorkbenchThemeConstants.TAB_TEXT_FONT);
    } else {

      if (bold) {
        targetFont = registry
            .getBold(IWorkbenchThemeConstants.TAB_TEXT_FONT);
      }
    }

    if (lastFont != targetFont) {
View Full Code Here

  private void updateFont() {
    CTabItem tabItem = getItem();

    // Set the font if necessary
    FontRegistry registry = PlatformUI.getWorkbench().getThemeManager()
        .getCurrentTheme().getFontRegistry();

    // Determine the parent font. We will set the tab's font
    Font targetFont = null;

    if (busy) {
      targetFont = registry
          .getItalic(IWorkbenchThemeConstants.TAB_TEXT_FONT);
    } else {

      if (bold) {
        targetFont = registry
            .getBold(IWorkbenchThemeConstants.TAB_TEXT_FONT);
      }
    }

    if (lastFont != targetFont) {
View Full Code Here

     *         whether the color should be put into the registry as well as
     *            having its default preference set
     */
    private static void installFont(FontDefinition definition, ITheme theme,
            IPreferenceStore store, boolean setInRegistry) {
        FontRegistry registry = theme.getFontRegistry();

        String id = definition.getId();
        String key = createPreferenceKey(theme, id);
        FontData[] prefFont = store != null ? PreferenceConverter
                .getFontDataArray(store, key) : null;
        FontData[] defaultFont = null;
        if (definition.getValue() != null) {
      defaultFont = definition.getValue();
    } else if (definition.getDefaultsTo() != null) {
      defaultFont = registry.filterData(registry
                    .getFontData(definition.getDefaultsTo()), Workbench
                    .getInstance().getDisplay());
    } else {
            // values pushed in from jface property files.  Very ugly.
            defaultFont = registry.bestDataArray(registry.getFontData(key),
                    Workbench.getInstance().getDisplay());
        }

        if (setInRegistry) {
            if (prefFont == null
                    || prefFont == PreferenceConverter.FONTDATA_ARRAY_DEFAULT_DEFAULT) {
                prefFont = defaultFont;
            }

            if (prefFont != null) {
                registry.put(id, prefFont);
            }
        }

        if (defaultFont != null && store != null) {
            PreferenceConverter.setDefault(store, key, defaultFont);
View Full Code Here

   */
  private WorkbenchThemeManager() {
    defaultThemeColorRegistry = new ColorRegistry(PlatformUI.getWorkbench()
        .getDisplay());

    defaultThemeFontRegistry = new FontRegistry(PlatformUI.getWorkbench()
        .getDisplay());

    // copy the font values from preferences.
    FontRegistry jfaceFonts = JFaceResources.getFontRegistry();
    for (Iterator i = jfaceFonts.getKeySet().iterator(); i.hasNext();) {
      String key = (String) i.next();
      defaultThemeFontRegistry.put(key, jfaceFonts.getFontData(key));
    }

    String themeId = IThemeManager.DEFAULT_THEME;
    // Check if we are in high contrast mode. If so then set the theme to
    // the system default
View Full Code Here

          String key = (String) i.next();
          jfaceColors.put(key, themeColors.getRGB(key));
        }
      }
      {
        FontRegistry jfaceFonts = JFaceResources.getFontRegistry();
        FontRegistry themeFonts = currentTheme.getFontRegistry();
        for (Iterator i = themeFonts.getKeySet().iterator(); i
            .hasNext();) {
          String key = (String) i.next();
          jfaceFonts.put(key, themeFonts.getFontData(key));
        }
      }
    }
  }
View Full Code Here

            eventRunner = new UiThreadEventRunner();
        }

        if ( fontRegistry == null )
        {
            fontRegistry = new FontRegistry( getWorkbench().getDisplay() );
        }

        if ( colorRegistry == null )
        {
            colorRegistry = new ColorRegistry( getWorkbench().getDisplay() );
View Full Code Here

    viewer = createTreeViewer( this, container );
    createViewerInput( viewer );
  }

  private void registerResources() {
    FontRegistry fontRegistry = JFaceResources.getFontRegistry();
    fontRegistry.put( TITLE_FONT, createFontData( 16, SWT.BOLD ) );
    fontRegistry.put( RELATED_BOOKS_FONT, createFontData( 16, SWT.BOLD ) );
  }
View Full Code Here

  private final int offsetColumnWidth;
  private final int dataColumnWidth;
  private final int asciiColumnWordWidth;
 
  HexEditFonts(Composite parent) {
    fontRegistry = new FontRegistry();
    addFonts(parent.getDisplay());
    offsetColumnWidth = calculateOffsetColumnWidth(parent);
    dataColumnWidth = calculateDataColumnWidth(parent);
    asciiColumnWordWidth = calculateAsciiColumnWordWidth(parent);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.resource.FontRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.