Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.FontDialog.open()


          FontDialog fd = new FontDialog(s, SWT.NONE);
          fd.setText("Select Font");
          fd.setRGB(t.getForeground().getRGB());
          fd.setFontList(t.getFont().getFontData());

           FontData newFont = fd.open();
          if(newFont==null)
              return;
          t.setFont(new Font(d, newFont));
          t.setForeground(new Color(d, fd.getRGB()));
         
View Full Code Here


    FontDialog dialog = new FontDialog(cellEditorWindow.getShell());
    Object value = getValue();
    if (value != null) {
      dialog.setFontList(new FontData[] { (FontData) value });
    }
    value = dialog.open();
    FontData[] list = dialog.getFontList();
    return list == null ? null : list.length > 0 ? list[0] : null;
  }

  protected Button createButton(Composite parent) {
View Full Code Here

                    Font f = fontStyle.getFont();
                    FontData[] fd = AWTSWTImageUtils.awtFontToSwt(f,JFaceResources.getFontRegistry()).getFontData();
                    dialog.setFontList(fd);
                }
                // show dialog and get results
                FontData result = dialog.open();
                if (result != null) {
                    Font awtfont = AWTSWTImageUtils.swtFontToAwt(result);
                    fontStyle.setFont(awtfont);

                    swtFont = AWTSWTImageUtils.awtFontToSwt(awtfont, JFaceResources
View Full Code Here

        fontButton.setText("Font");
        fontButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent arg0) {
                FontDialog dialog = new FontDialog(IComponentTestPanel.this.getShell());
                FontData fdata = dialog.open();
                if (fdata != null) {
                    Font font = new Font(Display.getCurrent(), fdata);
                    theComponent.setCometeFont(FontTool.getCometeFont(font));
                    font.dispose();
                    fontList.deselectAll();
View Full Code Here

   * 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);
View Full Code Here

    final FontDefinition definition = getSelectedFontDefinition();
    if (definition != null) {
      final FontDialog fontDialog = new FontDialog(fontChangeButton
          .getShell());
      fontDialog.setFontList(getFontValue(definition));
      final FontData data = fontDialog.open();
     
      if (data != null) {
        setFontPreferenceValue(definition, fontDialog.getFontList());
        setRegistryValue(definition, fontDialog.getFontList());
      }
View Full Code Here

                        FontDialog dlg = new FontDialog(getShell());
                        dlg.setText(localizationResources.getString(
                                "Font_Selection"));
                        dlg.setFontList(new FontData[] {
                                SWTTitleEditor.this.titleFont });
                        if (dlg.open() != null) {
                            // Dispose of any fonts we have created
                            if (SWTTitleEditor.this.font != null) {
                                SWTTitleEditor.this.font.dispose();
                            }
                            // Create the new font and set it into the title
View Full Code Here

                        // Create the color-change dialog
                        ColorDialog dlg = new ColorDialog(getShell());
                        dlg.setText(localizationResources.getString(
                                "Title_Color"));
                        dlg.setRGB(SWTTitleEditor.this.titleColor.getRGB());
                        RGB rgb = dlg.open();
                        if (rgb != null) {
                            // create the new color and set it to the
                            // SwtPaintCanvas
                            SWTTitleEditor.this.titleColor = new Color(
                                    getDisplay(), rgb);
View Full Code Here

                        FontDialog dlg = new FontDialog(getShell());
                        dlg.setText(localizationResources.getString(
                                "Font_Selection"));
                        dlg.setFontList(new FontData[] {
                                SWTAxisEditor.this.labelFont });
                        if (dlg.open() != null) {
                            // Dispose of any fonts we have created
                            if (SWTAxisEditor.this.font != null) {
                                SWTAxisEditor.this.font.dispose();
                            }
                            // Create the new font and set it into the title
View Full Code Here

                        // Create the color-change dialog
                        ColorDialog dlg = new ColorDialog(getShell());
                        dlg.setText(localizationResources.getString(
                                "Title_Color"));
                        dlg.setRGB(SWTAxisEditor.this.labelPaintColor.getRGB());
                        RGB rgb = dlg.open();
                        if (rgb != null) {
                          // create the new color and set it to the
                          // SwtPaintCanvas
                            SWTAxisEditor.this.labelPaintColor = new Color(
                                    getDisplay(), rgb);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.