當前位置: 首頁>>代碼示例>>Java>>正文


Java JFaceResources.TEXT_FONT屬性代碼示例

本文整理匯總了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);
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:7,代碼來源:ObligationsView.java

示例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());
				}
			}
		}
	});
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:29,代碼來源:ThemeManager.java

示例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);
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:30,代碼來源:ThemePreferencePage.java


注:本文中的org.eclipse.jface.resource.JFaceResources.TEXT_FONT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。