/** * Returns the default font data. Creates it if necessary. */ private FontData[] defaultFontData() { return defaultFontRecord().baseData; }
/** * Returns the default font data. Creates it if necessary. */ private FontData[] defaultFontData() { return defaultFontRecord().baseData; }
/** * Returns the default font data. Creates it if necessary. */ private FontData[] defaultFontData() { return defaultFontRecord().baseData; }
/** * Returns the default font data. Creates it if necessary. * <p> * This method should only be called from the UI thread. If you are not on the UI * thread then wrap the call with a * <code>PlatformUI.getWorkbench().getDisplay().synchExec()</code> in order to * guarantee the correct result. Failure to do this may result in an {@link * SWTException} being thrown. * </p> * @return Font */ public Font defaultFont() { return defaultFontRecord().getBaseFont(); }
/** * Returns the default font data. Creates it if necessary. * <p> * This method should only be called from the UI thread. If you are not on the UI * thread then wrap the call with a * <code>PlatformUI.getWorkbench().getDisplay().synchExec()</code> in order to * guarantee the correct result. Failure to do this may result in an {@link * SWTException} being thrown. * </p> * @return Font */ public Font defaultFont() { return defaultFontRecord().getBaseFont(); }
/** * Returns the default font data. Creates it if necessary. * <p> * This method should only be called from the UI thread. If you are not on the UI * thread then wrap the call with a * <code>PlatformUI.getWorkbench().getDisplay().synchExec()</code> in order to * guarantee the correct result. Failure to do this may result in an {@link * SWTException} being thrown. * </p> * @return Font */ public Font defaultFont() { return defaultFontRecord().getBaseFont(); }
/** * Return the font record for the key. * @param symbolicName The key for the record. * @return FontRecord */ private FontRecord getFontRecord(String symbolicName) { Assert.isNotNull(symbolicName); Object result = stringToFontRecord.get(symbolicName); if (result != null) { return (FontRecord) result; } result = stringToFontData.get(symbolicName); FontRecord fontRecord; if (result == null) { fontRecord = defaultFontRecord(); } else { fontRecord = createFont(symbolicName, (FontData[]) result); } if (fontRecord == null) { fontRecord = defaultFontRecord(); if (Display.getCurrent() == null) { // log error but don't throw an exception to preserve existing functionality String msg = "Unable to create font \"" + symbolicName + "\" in a non-UI thread. Using default font instead."; //$NON-NLS-1$ //$NON-NLS-2$ Policy.logException(new SWTException(msg)); return fontRecord; // don't add it to the cache; if later asked from UI thread, a proper font will be created } } stringToFontRecord.put(symbolicName, fontRecord); return fontRecord; }
oldFont.addAllocatedFontsToStale(defaultFontRecord().getBaseFont());
/** * Return the font record for the key. * @param symbolicName The key for the record. * @return FontRecord */ private FontRecord getFontRecord(String symbolicName) { Assert.isNotNull(symbolicName); Object result = stringToFontRecord.get(symbolicName); if (result != null) { return (FontRecord) result; } result = stringToFontData.get(symbolicName); FontRecord fontRecord; if (result == null) { fontRecord = defaultFontRecord(); } else { fontRecord = createFont(symbolicName, (FontData[]) result); } if (fontRecord == null) { fontRecord = defaultFontRecord(); if (Display.getCurrent() == null) { // log error but don't throw an exception to preserve existing functionality String msg = "Unable to create font \"" + symbolicName + "\" in a non-UI thread. Using default font instead."; //$NON-NLS-1$ //$NON-NLS-2$ Policy.logException(new SWTException(msg)); return fontRecord; // don't add it to the cache; if later asked from UI thread, a proper font will be created } } stringToFontRecord.put(symbolicName, fontRecord); return fontRecord; }
/** * Return the font record for the key. * @param symbolicName The key for the record. * @return FontRecord */ private FontRecord getFontRecord(String symbolicName) { Assert.isNotNull(symbolicName); Object result = stringToFontRecord.get(symbolicName); if (result != null) { return (FontRecord) result; } result = stringToFontData.get(symbolicName); FontRecord fontRecord; if (result == null) { fontRecord = defaultFontRecord(); } else { fontRecord = createFont(symbolicName, (FontData[]) result); } if (fontRecord == null) { fontRecord = defaultFontRecord(); if (Display.getCurrent() == null) { // log error but don't throw an exception to preserve existing functionality String msg = "Unable to create font \"" + symbolicName + "\" in a non-UI thread. Using default font instead."; //$NON-NLS-1$ //$NON-NLS-2$ Policy.logException(new SWTException(msg)); return fontRecord; // don't add it to the cache; if later asked from UI thread, a proper font will be created } } stringToFontRecord.put(symbolicName, fontRecord); return fontRecord; }
oldFont.addAllocatedFontsToStale(defaultFontRecord().getBaseFont());
oldFont.addAllocatedFontsToStale(defaultFontRecord().getBaseFont());