Tabnine Logo
FontDialog.setRGB
Code IndexAdd Tabnine to your IDE (free)

How to use
setRGB
method
in
org.eclipse.swt.widgets.FontDialog

Best Java code snippets using org.eclipse.swt.widgets.FontDialog.setRGB (Showing top 5 results out of 315)

origin: org.eclipse.platform/org.eclipse.swt.examples

if (usePreviousResultButton.getSelection()) {
  dialog.setFontList (fontDialogFontListResult);
  dialog.setRGB(fontDialogColorResult);
origin: org.eclipse.mylyn.commons/screenshots

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();
  }
}
origin: org.xworker/xworker_swt

dialog.setRGB(rgb);
origin: net.sf.okapi.lib/okapi-lib-verification-ui

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);
  }
}
origin: net.sf.okapi.lib/okapi-lib-verification-ui

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);
  }
}
org.eclipse.swt.widgetsFontDialogsetRGB

Javadoc

Sets the RGB describing the color to be selected by default in the dialog, or null to let the platform choose one.

Popular methods of FontDialog

  • <init>
    Constructs a new instance of this class given its parent and a style value describing its behavior a
  • open
    Makes the dialog visible and brings it to the front of the display.
  • setFontList
    Sets the set of FontData objects describing the font to be selected by default in the dialog, or nul
  • checkStyle
  • checkSubclass
  • getRGB
    Returns an RGB describing the color that was selected in the dialog, or null if none is available.
  • setText
  • getFontList
    Returns a FontData set describing the font that was selected in the dialog, or null if none is avail
  • gtk_font_chooser_dialog_new
  • gtk_font_chooser_get_font
  • gtk_font_chooser_set_font
  • error
  • gtk_font_chooser_set_font,
  • error,
  • setEffectsVisible,
  • ShowDialog,
  • addChangeListeners,
  • changeFont,
  • checkOperationMode,
  • convertHorizontalDLUsToPixels,
  • createButton

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • Menu (java.awt)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JPanel (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now