本文整理汇总了Java中org.eclipse.swt.widgets.FontDialog.open方法的典型用法代码示例。如果您正苦于以下问题:Java FontDialog.open方法的具体用法?Java FontDialog.open怎么用?Java FontDialog.open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.FontDialog
的用法示例。
在下文中一共展示了FontDialog.open方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onChangeFont
import org.eclipse.swt.widgets.FontDialog; //导入方法依赖的package包/类
private void onChangeFont() {
FontData selectedFont;
final FontDialog fontDialog = new FontDialog(_btnChangeFont.getShell());
fontDialog.setFontList(_selectedFontData);
fontDialog.setEffectsVisible(false);
fireOpenEvent(true);
{
selectedFont = fontDialog.open();
}
fireOpenEvent(false);
if (selectedFont != null) {
fireFontChanged(selectedFont);
}
}
示例2: openFontDialog
import org.eclipse.swt.widgets.FontDialog; //导入方法依赖的package包/类
/**
*
* void
*/
private void openFontDialog() {
FontDialog dialog = new FontDialog(UiCorePlugin.getShell(), SWT.NONE);
if (fontListOfDialog[0] != null) {
if (fontListOfDialog != fontList) {
dialog.setFontList(fontListOfDialog);
} else {
dialog.setFontList(fontList);
}
} else {
dialog.setFontList(fontList);
}
fontListOfDialog[0] = dialog.open();
defaultFontPreviewLabel.setText(getFormatedFontString(fontListOfDialog));
}
示例3: main
import org.eclipse.swt.widgets.FontDialog; //导入方法依赖的package包/类
/**
* @param args
*/
public static void main(String[] args)
{
Display display = new Display();
Shell shell = new Shell(display);
// displayAllLoadedFonts(shell);
loadFont(shell, "amigaforeverpro2.ttf", 8);
loadFont(shell, "E:/AAEW/dev/ws_bts_v2/org.bbaw.bts.ui.font.egyFont/font/FreeSerif.ttf", 8);
displayAllLoadedFonts(shell);
FontDialog dialog = new FontDialog(shell);
dialog.open();
Font f = new Font(display, dialog.getFontList());
}
示例4: widgetSelected
import org.eclipse.swt.widgets.FontDialog; //导入方法依赖的package包/类
@Override
public void widgetSelected(SelectionEvent ignored)
{
FontDialog fontDialog = new FontDialog(parentShell, SWT.OPEN);
fontDialog.setFontList(bzStyledText.getBrailleFont().getFontData());
FontData fontData = fontDialog.open();
if(fontData == null)
return;
bzStyledText.setBrailleFont(new Font(parentShell.getDisplay(), fontData));
}
示例5: activate
import org.eclipse.swt.widgets.FontDialog; //导入方法依赖的package包/类
/** Opens the color dialog. */
@Override
public void activate()
{
final FontDialog dialog = new FontDialog(shell);
if (value != null)
dialog.setFontList(new FontData[] { value });
value = dialog.open();
if (value != null)
fireApplyEditorValue();
}
示例6: widgetSelected
import org.eclipse.swt.widgets.FontDialog; //导入方法依赖的package包/类
@Override
public void widgetSelected(final SelectionEvent e) {
final FontDialog dialog = new FontDialog(WorkbenchHelper.getShell());
dialog.setEffectsVisible(false);
FontData data = toFontData(currentValue);
dialog.setFontList(new FontData[] { data });
data = dialog.open();
if (data != null) {
modifyAndDisplayValue(toGamaFont(data));
}
}
示例7: handleChangeFontPressed
import org.eclipse.swt.widgets.FontDialog; //导入方法依赖的package包/类
/**
* This method is invoked when the user selects the "Change" font button. It
* opens the FontDialog to allow the user to change the font.
*/
protected void handleChangeFontPressed() {
FontDialog dialog = new FontDialog(getShell());
FontData data = prefs.getFontData();
dialog.setFontList(new FontData[] { data });
data = dialog.open();
if (data != null) {
prefs.setFontData(data);
}
updateFontName();
}
示例8: setFont
import org.eclipse.swt.widgets.FontDialog; //导入方法依赖的package包/类
/**
* Sets the font related data to be applied to the text in page 2.
*/
void setFont() {
FontDialog fontDialog = new FontDialog(getSite().getShell());
fontDialog.setFontList(text.getFont().getFontData());
FontData fontData = fontDialog.open();
if (fontData != null) {
if (font != null)
font.dispose();
font = new Font(text.getDisplay(), fontData);
text.setFont(font);
}
}
示例9: getMoreFont
import org.eclipse.swt.widgets.FontDialog; //导入方法依赖的package包/类
/**
* ��������ѡ��Ի���
*
* @return
*/
public FontData getMoreFont() {
FontDialog fd = new FontDialog(b);
FontData font = fd.open();
return font;
}