本文整理汇总了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);
}