public void widgetSelected( SelectionEvent arg0 ) { FontDialog fd = new FontDialog( shell ); fd.setFontList( new FontData[] { fixedFontData } ); FontData newfd = fd.open(); if ( newfd != null ) { fixedFontData = newfd; fixedFont.dispose(); fixedFont = new Font( display, fixedFontData ); wFFont.redraw(); } } } );
public void widgetSelected( SelectionEvent arg0 ) { FontDialog fd = new FontDialog( shell ); fd.setFontList( new FontData[] { graphFontData } ); FontData newfd = fd.open(); if ( newfd != null ) { graphFontData = newfd; graphFont.dispose(); graphFont = new Font( display, graphFontData ); wGFont.redraw(); } } } );
public void widgetSelected( SelectionEvent arg0 ) { FontDialog fd = new FontDialog( shell ); fd.setFontList( new FontData[] { noteFontData } ); FontData newfd = fd.open(); if ( newfd != null ) { noteFontData = newfd; noteFont.dispose(); noteFont = new Font( display, noteFontData ); wNFont.redraw(); } } } );
FontData fontData = fontDialog.open(); paintSurface.showRubberband(); if (fontData != null) {
@Override public void widgetSelected(SelectionEvent event) { FontDialog fontDialog = new FontDialog(changeFontButton .getShell()); if (chosenFont != null) { fontDialog.setFontList(chosenFont); } FontData font = fontDialog.open(); if (font != null) { FontData[] oldFont = chosenFont; if (oldFont == null) { oldFont = JFaceResources.getDefaultFont() .getFontData(); } setPresentsDefaultValue(false); FontData[] newData = new FontData[1]; newData[0] = font; updateFont(newData); fireValueChanged(VALUE, oldFont[0], font); } } });
public void widgetSelected(SelectionEvent event) { FontDialog fontDialog = new FontDialog(changeFontButton .getShell()); if (chosenFont != null) { fontDialog.setFontList(chosenFont); } FontData font = fontDialog.open(); if (font != null) { FontData[] oldFont = chosenFont; if (oldFont == null) { oldFont = JFaceResources.getDefaultFont() .getFontData(); } setPresentsDefaultValue(false); FontData[] newData = new FontData[1]; newData[0] = font; updateFont(newData); fireValueChanged(VALUE, oldFont[0], font); } } });
FontData data = d.open(); table.setFont(new Font(display, data)); for (int i = 0; i < titles.length; i++) {
fontDialog.setFontList(chosenFont); FontData font = fontDialog.open(); if (font != null) { FontData[] oldFont = chosenFont;
FontData result = dialog.open (); textWidget.append (ControlExample.getResourceString("FontDialog") + Text.DELIMITER); textWidget.append (ControlExample.getResourceString("Result", "" + result) + Text.DELIMITER);
/** * Edit the given font. * * @param definition * the font definition * @param display * the display to open the dialog on * @since 3.7 */ private void editFont(FontDefinition definition, Display display) { if (definition != null) { final FontDialog fontDialog = new FontDialog(getShell()); fontDialog.setEffectsVisible(false); fontDialog.setFontList(getFontValue(definition)); final FontData data = fontDialog.open(); if (data != null) { setFontPreferenceValue(definition, fontDialog.getFontList(), false); refreshElement(definition); } } }
public void invokeFontDialog() { FontData fontData = new FontData(stringCustom); FontDialog fontWindow = new FontDialog(parent.getShell()); fontWindow.setFontList(new FontData[] { fontData }); fontWindow.setRGB(int2rgb(intgerCustom)); fontData = fontWindow.open(); if (fontData != null) { intgerCustom = rgb2int(fontWindow.getRGB()); stringCustom = fontData.toString(); toolButton.setToolTipText(font2string(fontData)); clickBody(); } }
fontData = dialog.open(); if(fontData != null){ String fontStr = fontData.getName() + "|" + fontData.getHeight() + "|" + fontData.getStyle();
private void selectFont () { try { FontDialog dlg = new FontDialog(dialog); dlg.setText("Select Font"); // Set current font and color info dlg.setFontList(opt.font.getFontData()); dlg.setRGB(opt.foreground.getRGB()); // Open the dialog FontData fontData = dlg.open(); if ( fontData == null) return; // If not canceled by user: We assign the new font // Work around: For some reason disposing of the font before calling edExample.setFont() // with the new font is causing an invalid argument exception. So we defer the dispose. Font tmp = opt.font; opt.font = new Font(device, fontData); edExample.setFont(opt.font); tmp.dispose(); // And the new new color opt.foreground.dispose(); opt.foreground = new Color(device, dlg.getRGB()); updateExample(); } catch ( Throwable e ) { Dialogs.showError(dialog, e.getLocalizedMessage(), null); } }
return null; }else { FontData data = dialog.open(); self.doAction("open", actionContext, UtilMap.toMap("font", data));
private void selectFont () { try { FontDialog dlg = new FontDialog(getShell()); dlg.setText("Select Font"); // Set current font and color info dlg.setFontList(opt.font.getFontData()); dlg.setRGB(opt.foreground.getRGB()); // Open the dialog FontData fontData = dlg.open(); if ( fontData == null) return; // If not canceled by user: We assign the new font // Work around: For some reason disposing of the font before calling edExample.setFont() // with the new font is causing an invalid argument exception. So we defer the dispose. Font tmp = opt.font; opt.font = new Font(getDisplay(), fontData); edExample.setFont(opt.font); tmp.dispose(); // And the new new color opt.foreground.dispose(); opt.foreground = new Color(getDisplay(), dlg.getRGB()); edExample.setForeground(opt.foreground); } catch ( Throwable e ) { Dialogs.showError(getShell(), e.getLocalizedMessage(), null); } }
if (oldFont == null) oldFont = tabFolder1.getItem (0).getFont (); fontDialog.setFontList(oldFont.getFontData()); FontData fontData = fontDialog.open (); if (fontData == null) return; oldFont = itemFont;
FontData fontData = fontDialog.open (); if (fontData == null) return;
if (oldFont == null) oldFont = textNode1.getFont (); fontDialog.setFontList(oldFont.getFontData()); FontData fontData = fontDialog.open (); if (fontData == null) return; oldFont = itemFont; if (oldFont == null) oldFont = textNode1.getFont (1); fontDialog.setFontList(oldFont.getFontData()); FontData fontData = fontDialog.open (); if (fontData == null) return; oldFont = cellFont;
if (oldFont == null) oldFont = table1.getItem (0).getFont (); fontDialog.setFontList(oldFont.getFontData()); FontData fontData = fontDialog.open (); if (fontData == null) return; oldFont = itemFont; if (oldFont == null) oldFont = table1.getItem (0).getFont (1); fontDialog.setFontList(oldFont.getFontData()); FontData fontData = fontDialog.open (); if (fontData == null) return; oldFont = cellFont;
FontDialog fontDialog = new FontDialog(shell); fontDialog.setFontList(styledText.getFont().getFontData()); FontData data = fontDialog.open(); if (data != null) { Font newFont = new Font(display, data);