本文整理了Java中org.eclipse.swt.widgets.Label.getFont()
方法的一些代码示例,展示了Label.getFont()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.getFont()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Label
类名称:Label
方法名:getFont
暂无
代码示例来源:origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e.nls
public Font getLabelFont() {
return m_label.getFont();
}
代码示例来源:origin: org.eclipse.xtext/ui
private Composite createStyleTabContent(Composite folder) {
int nColumns = 3;
final ScrolledPageContent sc1 = new ScrolledPageContent(folder);
Composite composite = sc1.getBody();
GridLayout layout = new GridLayout(nColumns, false);
layout.marginHeight = 0;
layout.marginWidth = 0;
composite.setLayout(layout);
Label description = new Label(composite, SWT.LEFT | SWT.WRAP);
description.setFont(description.getFont());
description.setText("Select the severity level for the following optional " + lastSegment(languageName)
+ " compiler problems:");
description.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false, nColumns - 1, 1));
int indentStep = fPixelConverter.convertWidthInCharsToPixels(1);
int defaultIndent = indentStep * 0;
fillSettingsPage(composite, nColumns, defaultIndent);
new Label(composite, SWT.NONE); // TODO what's this?
restoreSectionExpansionStates(section);
return sc1;
}
代码示例来源:origin: inspectIT/inspectIT
/**
* {@inheritDoc}
*/
@Override
public void createPartControl(Composite parent, FormToolkit toolkit) {
composite = toolkit.createComposite(parent);
composite.setLayout(new GridLayout(1, false));
Composite innerComposite = toolkit.createComposite(composite);
innerComposite.setLayout(new GridLayout(2, false));
innerComposite.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, true));
Label labelIcon = toolkit.createLabel(innerComposite, "");
labelIcon.setImage(Display.getCurrent().getSystemImage(SWT.ICON_WARNING));
labelIcon.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
Label labelInfoText = toolkit.createLabel(innerComposite, INFO_TEXT);
FontData fontData = labelInfoText.getFont().getFontData()[0];
Font font = new Font(Display.getCurrent(), new FontData(fontData.getName(), fontData.getHeight(), SWT.BOLD));
labelInfoText.setFont(font);
labelInfoText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
protected Control createInfoTextArea(Composite parent)
{
Composite infoComposite = new Composite(parent, SWT.NONE);
GridLayout gridLayout = new GridLayout(2, false);
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
infoComposite.setLayout(gridLayout);
GridData gd = new GridData(GridData.FILL_BOTH);
infoComposite.setLayoutData(gd);
nsInfoLabel = new Label(infoComposite, SWT.LEFT);
nsInfoLabel.setText(infoText);
Font font = nsInfoLabel.getFont();
FontData[] fontDatas = font.getFontData();
for (int i = 0; i < fontDatas.length; i++)
{
fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10);
}
infoFont = new Font(nsInfoLabel.getDisplay(), fontDatas);
nsInfoLabel.setFont(infoFont);
gd = new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
nsInfoLabel.setLayoutData(gd);
nsInfoLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
link = new Hyperlink(infoComposite, SWT.RIGHT);
link.setText(Messages._UI_ACTION_OPEN_IN_NEW_EDITOR);
link.setFont(infoFont);
link.addHyperlinkListener(linkListener);
return infoComposite;
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
FontData[] fontData = matchLabel.getFont().getFontData();
GridData dataF = new GridData();
dataF.widthHint = 400;
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
wrapWidth = wHint;
Point extent = textExtent( getFont(), text, wrapWidth, isMarkupEnabledFor( this ) );
width = extent.x;
height = extent.y + 2;
} else {
height = TextSizeUtil.getCharHeight( getFont() );
代码示例来源:origin: ystrot/glance
protected void applyFonts(final Composite composite) {
Dialog.applyDialogFont(composite);
if (info != null) {
final Font font = info.getFont();
final FontData[] fontDatas = font.getFontData();
for (int i = 0; i < fontDatas.length; i++) {
fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10);
}
infoFont = new Font(info.getDisplay(), fontDatas);
info.setFont(infoFont);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
fMessageText.setText(fContentAssistant.getStatusMessage() + " "); //$NON-NLS-1$
if (fMessageTextFont == null) {
Font font= fMessageText.getFont();
Display display= fProposalShell.getDisplay();
FontData[] fontDatas= font.getFontData();
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
fMessageText.setText(fContentAssistant.getStatusMessage() + " "); //$NON-NLS-1$
if (fMessageTextFont == null) {
Font font= fMessageText.getFont();
Display display= fProposalShell.getDisplay();
FontData[] fontDatas= font.getFontData();
代码示例来源:origin: org.eclipse/org.eclipse.ui.editors
Font font= fStatusField.getFont();
FontData[] fontDatas= font.getFontData();
for (int i= 0; i < fontDatas.length; i++)
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
Font font= fStatusField.getFont();
FontData[] fontDatas= font.getFontData();
for (int i= 0; i < fontDatas.length; i++)
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
Font font= fStatusField.getFont();
FontData[] fontDatas= font.getFontData();
for (int i= 0; i < fontDatas.length; i++)
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
/**
* Apply any desired fonts to the specified composite and its children.
*
* @param composite
* the contents composite
*/
private void applyFonts(Composite composite) {
Dialog.applyDialogFont(composite);
if (titleLabel != null) {
Font font = titleLabel.getFont();
FontData[] fontDatas = font.getFontData();
for (int i = 0; i < fontDatas.length; i++) {
fontDatas[i].setStyle(SWT.BOLD);
}
titleFont = new Font(titleLabel.getDisplay(), fontDatas);
titleLabel.setFont(titleFont);
}
if (infoLabel != null) {
Font font = infoLabel.getFont();
FontData[] fontDatas = font.getFontData();
for (int i = 0; i < fontDatas.length; i++) {
fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10);
}
infoFont = new Font(infoLabel.getDisplay(), fontDatas);
infoLabel.setFont(infoFont);
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
/**
* Apply any desired fonts to the specified composite and its children.
*
* @param composite
* the contents composite
*/
private void applyFonts(Composite composite) {
Dialog.applyDialogFont(composite);
if (titleLabel != null) {
Font font = titleLabel.getFont();
FontData[] fontDatas = font.getFontData();
for (int i = 0; i < fontDatas.length; i++) {
fontDatas[i].setStyle(SWT.BOLD);
}
titleFont = new Font(titleLabel.getDisplay(), fontDatas);
titleLabel.setFont(titleFont);
}
if (infoLabel != null) {
Font font = infoLabel.getFont();
FontData[] fontDatas = font.getFontData();
for (int i = 0; i < fontDatas.length; i++) {
fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10);
}
infoFont = new Font(infoLabel.getDisplay(), fontDatas);
infoLabel.setFont(infoFont);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
/**
* Apply any desired fonts to the specified composite and its children.
*
* @param composite
* the contents composite
*/
private void applyFonts(Composite composite) {
Dialog.applyDialogFont(composite);
if (titleLabel != null) {
Font font = titleLabel.getFont();
FontData[] fontDatas = font.getFontData();
for (FontData fontData : fontDatas) {
fontData.setStyle(SWT.BOLD);
}
titleFont = new Font(titleLabel.getDisplay(), fontDatas);
titleLabel.setFont(titleFont);
}
if (infoLabel != null) {
Font font = infoLabel.getFont();
FontData[] fontDatas = font.getFontData();
for (FontData fontData : fontDatas) {
fontData.setHeight(fontData.getHeight() * 9 / 10);
}
infoFont = new Font(infoLabel.getDisplay(), fontDatas);
infoLabel.setFont(infoFont);
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
Font font= fStatusField.getFont();
FontData[] fontDatas= font.getFontData();
for (int i= 0; i < fontDatas.length; i++)
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
Font font= fStatusField.getFont();
FontData[] fontDatas= font.getFontData();
for (int i= 0; i < fontDatas.length; i++)
代码示例来源:origin: BiglySoftware/BiglyBT
protected final Label createFixedTextLabel(String msg_key, boolean add_colon, boolean bold) {
assertConstructing();
Label result = new Label(splash, SWT.NONE);
result.setBackground(Colors.blues[Colors.BLUES_LIGHTEST]);
result.setForeground(Colors.blues[Colors.BLUES_DARKEST]);
result.setText(MessageText.getString(msg_key) + ((add_colon) ? ":" : ""));
if (bold) {
if (this.bold_font == null) {
this.bold_font = createBoldFont(result.getFont());
}
result.setFont(this.bold_font);
}
result.addMouseListener(this.mListener);
result.addMouseMoveListener(this.mMoveListener);
result.pack();
result.setLocation(this.xSize, 0);
result.setMenu(this.menu);
if (this.hSize == -1) {
int hSizeText = result.getSize().y;
int hSizeImage = this.lDrag.getSize().y;
this.hSize = hSizeText > hSizeImage ? hSizeText : hSizeImage;
}
this.xSize += result.getSize().x + 3;
return( result );
}
代码示例来源:origin: rinde/RinSim
label = new Label(group, SWT.NONE);
final Font f = label.getFont();
final FontData[] fontData = f.getFontData();
for (int i = 0; i < fontData.length; i++) {
代码示例来源:origin: com.github.rinde/rinsim-example
label = new Label(group, SWT.NONE);
final Font f = label.getFont();
final FontData[] fontData = f.getFontData();
for (int i = 0; i < fontData.length; i++) {
内容来源于网络,如有侵权,请联系作者删除!