本文整理匯總了Java中org.eclipse.jface.resource.JFaceResources.TEXT_FONT屬性的典型用法代碼示例。如果您正苦於以下問題:Java JFaceResources.TEXT_FONT屬性的具體用法?Java JFaceResources.TEXT_FONT怎麽用?Java JFaceResources.TEXT_FONT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.jface.resource.JFaceResources
的用法示例。
在下文中一共展示了JFaceResources.TEXT_FONT屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ObligationsView
public ObligationsView()
{
items = new HashMap<Integer, ExpandItem>();
viewers = new HashMap<ExpandItem, SourceViewer>();
fontListener = new FontPreferenceChangeListener(null, JFaceResources.TEXT_FONT);
JFaceResources.getFontRegistry().addListener(fontListener);
}
示例2: forceFontsUpToDate
private void forceFontsUpToDate()
{
final String[] fontIds = new String[] { IThemeManager.VIEW_FONT_NAME, JFaceResources.TEXT_FONT,
"org.eclipse.ui.workbench.texteditor.blockSelectionModeFont" }; //$NON-NLS-1$
UIUtils.getDisplay().asyncExec(new Runnable()
{
public void run()
{
for (String fontId : fontIds)
{
Font fFont = JFaceResources.getFontRegistry().get(fontId);
// Only set new values if they're different from existing!
Font existing = JFaceResources.getFont(fontId);
String existingString = StringUtil.EMPTY;
if (!existing.isDisposed())
{
existingString = PreferenceConverter.getStoredRepresentation(existing.getFontData());
}
String fdString = PreferenceConverter.getStoredRepresentation(fFont.getFontData());
if (!existingString.equals(fdString))
{
// put in registry...
JFaceResources.getFontRegistry().put(fontId, fFont.getFontData());
}
}
}
});
}
示例3: performOkFonts
protected void performOkFonts()
{
final String[] fontIds = new String[] { JFaceResources.TEXT_FONT,
"org.eclipse.ui.workbench.texteditor.blockSelectionModeFont" }; //$NON-NLS-1$
FontData[] data = fFont.getFontData();
for (String fontId : fontIds)
{
setFont(fontId, data);
}
// Shrink by 2 for views!
data = fFont.getFontData();
FontData[] smaller = new FontData[data.length];
int i = 0;
for (FontData fd : data)
{
int height = fd.getHeight();
if (height >= 12)
{
fd.setHeight(height - 2);
}
else if (height >= 10)
{
fd.setHeight(height - 1);
}
smaller[i++] = fd;
}
setFont(IThemeManager.VIEW_FONT_NAME, smaller);
}