当前位置: 首页>>代码示例>>Java>>正文


Java JFaceResources.getTextFont方法代码示例

本文整理汇总了Java中org.eclipse.jface.resource.JFaceResources.getTextFont方法的典型用法代码示例。如果您正苦于以下问题:Java JFaceResources.getTextFont方法的具体用法?Java JFaceResources.getTextFont怎么用?Java JFaceResources.getTextFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.resource.JFaceResources的用法示例。


在下文中一共展示了JFaceResources.getTextFont方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFont

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
public Font getFont(Object element)
{
	if (disabled)
	{
		if (wrapped instanceof IFontProvider)
		{
			return ((IFontProvider) wrapped).getFont(element);
		}
		return null;
	}
	if (!useEditorFont())
	{
		return null;
	}
	Font font = JFaceResources.getFont(IThemeManager.VIEW_FONT_NAME);
	if (font == null)
	{
		font = JFaceResources.getTextFont();
	}
	return font;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:22,代码来源:ThemedDelegatingLabelProvider.java

示例2: initFormText

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
public static void initFormText(FormText formText) {

        formText.setWhitespaceNormalized(false);

        Font formTextFont = formText.getFont();
        FontData formTextFontData = formTextFont.getFontData()[0];

        FontData h1FontData = new FontData(formTextFontData.getName(), formTextFontData.getHeight() + 5, SWT.BOLD);
        final Font h1Font = new Font(formTextFont.getDevice(), h1FontData);
        formText.setFont(FONT_H1_KEY, h1Font);

        FontData h3FontData = new FontData(formTextFontData.getName(), formTextFontData.getHeight() + 3, SWT.BOLD);
        final Font h3Font = new Font(formTextFont.getDevice(), h3FontData);
        formText.setFont(FONT_H3_KEY, h3Font);

        Font codeFont = JFaceResources.getTextFont();
        formText.setFont(FONT_CODE_KEY, codeFont);

        formText.addDisposeListener(new DisposeListener() {

            @Override
            public void widgetDisposed(DisposeEvent e) {
                h1Font.dispose();
                h3Font.dispose();
            }
        });

        // Set fontKeySet = JFaceResources.getFontRegistry().getKeySet();
        // if (fontKeySet != null) {
        // for (Object fontKey : fontKeySet) {
        // System.out.println(fontKey);
        // }
        // }

    }
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:36,代码来源:JmxDocFormText.java

示例3: createClient

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
/**
 * Fill the section.
 */
private void createClient(Section section, FormToolkit toolkit) {
	Composite container = toolkit.createComposite(section);

	section.setClient(container);

	container.setLayout(new GridLayout());

	MarkupLanguage language = new MarkdownLanguage();
	markupViewer = new MarkupSourceViewer(container, null, SWT.WRAP | SWT.V_SCROLL, language);
	GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
	markupViewer.getControl().setLayoutData(gridData);

	MarkupSourceViewerConfiguration configuration = new MarkupSourceViewerConfiguration(EditorsUI.getPreferenceStore());

	Font font = JFaceResources.getTextFont();
	markupViewer.getTextWidget().setFont(font);

	configuration.setMarkupLanguage(language);
	markupViewer.configure(configuration);
	markupViewer.setEditable(true);

	markupViewer.getTextWidget().setData("textViewer", markupViewer);
	markupViewer.getTextWidget().setData(MarkupLanguage.class.getName(), language);
	markupViewer.getTextWidget().setData(ISourceViewer.class.getName(), markupViewer);

	// install common text support such as content assist
	IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
	CommonTextSupport textSupport = new CommonTextSupport(handlerService);
	textSupport.install(markupViewer, true);

	getSite().setSelectionProvider(markupViewer.getSelectionProvider());
	configure(markupViewer, new Document());
}
 
开发者ID:Itema-as,项目名称:dawn-marketplace-server,代码行数:37,代码来源:DescriptionSection.java

示例4: createDialogArea

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite composite = (Composite) super.createDialogArea(parent);
	boolean isWin32 = Util.isWindows();
	GridLayoutFactory.fillDefaults().extendedMargins(isWin32 ? 0 : 3, 3, 2, 2).applyTo(composite);

	List<String> list = history.toList();
	String[] items = list.toArray(new String[list.size()]);
	
	Combo comboBox = SWTFactory.createCombo(composite, SWT.NONE, 2, items);
	Font terminalFont = JFaceResources.getTextFont();
	comboBox.setFont(terminalFont);
	
	GridData textLayoutData = new GridData();
	textLayoutData.horizontalAlignment = GridData.FILL;
	textLayoutData.verticalAlignment = GridData.FILL;
	textLayoutData.grabExcessHorizontalSpace = true;
	textLayoutData.grabExcessVerticalSpace = false;
	textLayoutData.horizontalSpan = 2;
	
	comboBox.setLayoutData(textLayoutData);
	
	comboBox.addKeyListener(new KeyAdapter() {
		
		@Override
		public void keyReleased(KeyEvent event) {
			if (event.character == '\r' ){
				inputText = comboBox.getText();
				if (inputText!=null){
					if (! inputText.equals(history.current())){
						/* when not same as current history entry, add it to history*/
						history.add(inputText);
					}
				}
				close();
			}
		}
	});
	return composite;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:41,代码来源:QuickLaunchDialog.java

示例5: getFont

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
protected Font getFont()
{
	Font font = JFaceResources.getFont(IThemeManager.VIEW_FONT_NAME);
	if (font == null)
	{
		font = JFaceResources.getTextFont();
	}
	return font;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:10,代码来源:ControlThemer.java

示例6: addMeasureItemListener

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
private void addMeasureItemListener()
{
	if (controlIsDisposed())
	{
		return;
	}

	final Tree tree = getTree();
	// Hack to force a specific row height and width based on font
	measureItemListener = new Listener()
	{
		public void handleEvent(Event event)
		{
			if (!useEditorFont())
			{
				return;
			}
			Font font = JFaceResources.getFont(IThemeManager.VIEW_FONT_NAME);
			if (font == null)
			{
				font = JFaceResources.getTextFont();
			}
			if (font != null)
			{
				event.gc.setFont(font);
				FontMetrics metrics = event.gc.getFontMetrics();
				int height = metrics.getHeight() + 2;
				TreeItem item = (TreeItem) event.item;
				int width = event.gc.stringExtent(item.getText()).x + 24; // minimum width we need for text plus eye
				event.height = height;
				if (width > event.width)
				{
					event.width = width;
				}
			}
		}
	};
	tree.addListener(SWT.MeasureItem, measureItemListener);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:40,代码来源:TreeThemer.java

示例7: applyStyles

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
@Override
public void applyStyles(TextStyle textStyle)
{
	if (maxHeightTextFont != null)
	{
		// Use font with limited max height
		textStyle.font = maxHeightTextFont;
	}
	else
	{
		textStyle.font = JFaceResources.getTextFont();
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:14,代码来源:SnippetsCompletionProcessor.java

示例8: newDefaultFont

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
private Font newDefaultFont(int id) {
    Display display = Display.getCurrent();
    int bump = 0;
    Font fontCopy = null;

    switch (id) {
        case DIALOG_FONT:
            fontCopy = JFaceResources.getDialogFont();
            break;
        case TABLE_FONT:
            fontCopy = JFaceResources.getDefaultFont();
            if (GUI.isMac())
                bump = -1;
            break;

        case TEXT_FONT:

            fontCopy = JFaceResources.getTextFont();
            break;

        case HEADER_FONT:
            fontCopy = JFaceResources.getDefaultFont();
            break;
        case TREE_FONT:
            fontCopy = JFaceResources.getTextFont();
            break;

        default:
            break;
    }

    FontData fd;

    if (fontCopy != null)
        fd = fontCopy.getFontData()[0];
    else
        fd = display.getSystemFont().getFontData()[0];
    int size = Math.round(fd.getHeight()) + bump;

    Font f = new Font(display, fd.getName(), size, 0);
    FontData ff = f.getFontData()[0];

    return f;
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:45,代码来源:FontShop.java

示例9: EULAControl

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
public EULAControl(final Composite parent, final int style) {
    super(parent, style);

    final GridLayout layout = new GridLayout(1, false);
    layout.horizontalSpacing = getHorizontalSpacing();
    layout.verticalSpacing = getVerticalSpacing();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    setLayout(layout);

    final Label descriptionText = new Label(this, SWT.WRAP | SWT.READ_ONLY);
    descriptionText.setText(Messages.getString("EulaControl.DescriptionText")); //$NON-NLS-1$
    GridDataBuilder.newInstance().hGrab().hFill().applyTo(descriptionText);

    final Text eulaText = new Text(this, SWT.READ_ONLY | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    AutomationIDHelper.setWidgetID(eulaText, EULA_TEXTBOX_ID);
    eulaText.setText(EULAText.getEULAText());
    eulaText.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    eulaText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND));
    GridDataBuilder.newInstance().hGrab().hFill().vGrab().vFill().applyTo(eulaText);

    final Font font = JFaceResources.getTextFont();

    if (font != null) {
        eulaText.setFont(font);
    }

    ControlSize.setCharHeightHint(eulaText, 10);
    ControlSize.setCharWidthHint(eulaText, 80);

    // TODO: This is a work around for a linux layout problem. We may have
    // to revisit this and other issues with the wizard when we update for
    // localization.
    ControlSize.setCharHeightHint(descriptionText, 3);
    ControlSize.setCharWidthHint(descriptionText, 80);

    acceptButton = new Button(this, SWT.CHECK);
    AutomationIDHelper.setWidgetID(acceptButton, ACCEPT_CHECKBOX_ID);
    acceptButton.setText(Messages.getString("EulaControl.AcceptButtonText")); //$NON-NLS-1$
    acceptButton.setSelection(accepted);
    acceptButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            accepted = acceptButton.getSelection();

            notifyListeners();
        }
    });
    GridDataBuilder.newInstance().hGrab().applyTo(acceptButton);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:51,代码来源:EULAControl.java

示例10: getFont

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
@Override
public Font getFont(Object element) {
  return JFaceResources.getTextFont();
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:5,代码来源:ExecutedClassesPage.java

示例11: getFont

import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
/**
 * This is a TextViewer (usually editor contents), so use the text font explicitly, not the view font we set up in
 * parent class.
 */
protected Font getFont()
{
	return JFaceResources.getTextFont();
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:9,代码来源:TextViewerThemer.java


注:本文中的org.eclipse.jface.resource.JFaceResources.getTextFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。