Package org.eclipse.swt.widgets

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


                        // 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


                        FontDialog dlg = new FontDialog(getShell());
                        dlg.setText(localizationResources.getString(
                                "Font_Selection"));
                        dlg.setFontList(new FontData[] {
                                SWTAxisEditor.this.tickLabelFont});
                        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

                        ColorDialog dlg = new ColorDialog(getShell());
                        dlg.setText(localizationResources.getString(
                                "Background_paint"));
                        dlg.setRGB(SWTOtherEditor.this.backgroundPaintCanvas
                                .getColor().getRGB());
                        RGB rgb = dlg.open();
                        if (rgb != null) {
                            SWTOtherEditor.this.backgroundPaintCanvas.setColor(
                                    new Color(getDisplay(), rgb));
                        }
                    }
View Full Code Here

                        ColorDialog dlg = new ColorDialog(getShell());
                        dlg.setText(localizationResources.getString(
                                "Outline_Paint"));
                        dlg.setRGB(SWTPlotAppearanceEditor.this
                                .outlinePaintCanvas.getColor().getRGB());
                        RGB rgb = dlg.open();
                        if (rgb != null) {
                            SWTPlotAppearanceEditor.this.outlinePaintCanvas
                                    .setColor(new Color(getDisplay(), rgb));
                        }
                    }
View Full Code Here

                        ColorDialog dlg = new ColorDialog(getShell());
                        dlg.setText(localizationResources.getString(
                                "Background_paint"));
                        dlg.setRGB(SWTPlotAppearanceEditor.this
                                .backgroundPaintCanvas.getColor().getRGB());
                        RGB rgb = dlg.open();
                        if (rgb != null) {
                            SWTPlotAppearanceEditor.this.backgroundPaintCanvas
                                    .setColor(new Color(getDisplay(), rgb));
                        }
                    }
View Full Code Here

    public void widgetSelected( SelectionEvent e ) {
        ColorDialog dialog = new ColorDialog(e.display.getActiveShell());
        Color currentColor = (Color) e.widget.getData();
        RGB currentRGB = new RGB(currentColor.getRed(), currentColor.getGreen(), currentColor.getBlue());
        dialog.setRGB(currentRGB);
        dialog.open();
       
        RGB rgb = dialog.getRGB();
       
        e.widget.setData(new Color(rgb.red, rgb.green, rgb.blue));
       
View Full Code Here

 
  @Override
  public void run() {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    ColorDialog dialog = new ColorDialog(window.getShell());
    RGB color = dialog.open();
    if(color!=null){
      IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
      ITextSelection sel = (ITextSelection)editor.getSelectionProvider().getSelection();
      try {
        doc.replace(sel.getOffset(), 0, HTMLUtil.toHex(color));
View Full Code Here

            @Override
            public void mouseDown(MouseEvent e) {
                ColorDialog dialog = new ColorDialog(new Shell(
                        Display.getDefault(), SWT.SHELL_TRIM));
                dialog.setRGB(selectedColor.getRGB());
                RGB selected = dialog.open();
                if (selected != null) {
                    update(selected);
                }
            }
        });
View Full Code Here

            final ColorDialog dialog = new ColorDialog( shell );
           
            dialog.setText( property.definition().getLabel( false, CapitalizationType.TITLE_STYLE, false ) );
            dialog.setRGB( convert( (Color) ( (Value<?>) property ).content() ) );
           
            final RGB pickedColor = dialog.open();
           
            if( pickedColor != null )
            {
                return convert( pickedColor ).toString();
            }
View Full Code Here

        MenuItem item = (MenuItem) event.widget;
        if (customColorMI == item) {
          ColorDialog dialog = new ColorDialog(parent.getShell());
          if (customColor != null && !customColor.isDisposed())
            dialog.setRGB(customColor.getRGB());
          RGB rgb = dialog.open();
          if (rgb == null)
            return;
          if (customColor != null)
            customColor.dispose();
          customColor = new Color(display, 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.