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

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

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

origin: org.xworker/xworker_swt

@Override
public void dialogClosed(int returnCode) {
  FontData[] list = dialog.getFontList();
  if(list != null && list.length > 0){
    FontData fontData = list[0];
    String fontStr = fontData.getName() + "|" + fontData.getHeight() + "|" + fontData.getStyle();
    if(dialog.getRGB() != null){
      fontStr = fontStr + "|" + UtilSwt.RGBToString(dialog.getRGB());
    }
    //fontStr = fontStr;
    text.setText(fontStr);
    ///UtilSwt.setFont(text, text.getText(), null);
  }
  text.setFocus();
}
 
origin: org.xworker/xworker_swt

if(fontData != null){
  String fontStr = fontData.getName() + "|" + fontData.getHeight() + "|" + fontData.getStyle();
  if(dialog.getRGB() != null){
    fontStr = fontStr + "|" + UtilSwt.RGBToString(dialog.getRGB());
origin: org.eclipse.platform/org.eclipse.swt.examples

textWidget.append ("getRGB() = " + dialog.getRGB() + Text.DELIMITER + Text.DELIMITER);
fontDialogFontListResult = dialog.getFontList ();
fontDialogColorResult = dialog.getRGB();
return;
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: 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.widgetsFontDialoggetRGB

Javadoc

Returns an RGB describing the color that was selected in the dialog, or null if none is available.

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
  • setRGB
    Sets the RGB describing the color to be selected by default in the dialog, or null to let the platfo
  • 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

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Runner (org.openjdk.jmh.runner)
  • Github Copilot alternatives
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