Package org.eclipse.swt.widgets

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


        ColorDialog dialog = new ColorDialog(Display.getCurrent().getActiveShell());
        Color color = (Color) getValue();
        if (color != null) {
            dialog.setRGB(color.getRGB());
        }
        RGB result = (RGB) dialog.open();
        return result == null ? null : new Color(Display.getCurrent(), result);
    }

}
View Full Code Here


        if (o instanceof Label) {
            Label l = (Label) o;
            ColorDialog c = new ColorDialog(parent.getShell());
            c.setRGB(new RGB(l.getBackground().getRed(), l.getBackground().getGreen(), l
                    .getBackground().getBlue()));
            RGB color = c.open();
            if (color == null) {
                return;
            }
            Color colorObject = new Color(parent.getDisplay(), color);
View Full Code Here

        Object o = e.getSource();
        if (o instanceof Label) {
            Label l = (Label) o;
            ColorDialog c = new ColorDialog(parent.getShell());
            c.setRGB(new RGB(l.getBackground().getRed(), l.getBackground().getGreen(), l.getBackground().getBlue()));
            RGB color = c.open();
            if (color == null) {
                return;
            }
            Color colorObject = new Color(parent.getDisplay(), color);
View Full Code Here

                lineWidth = lineWidthSpinner.getSelection();
            } else if (widget.equals(lineAlphaSpinner)) {
                lineAlpha = lineAlphaSpinner.getSelection();
            } else if (widget.equals(lineColorButton)) {
                ColorDialog dialog = new ColorDialog(lineColorButton.getShell());
                dialog.open();
                RGB rgb = dialog.getRGB();
                if (rgb != null) {
                    lineColor = new Color(rgb.red, rgb.green, rgb.blue);
                }
            } else if (widget.equals(fillAlphaSpinner)) {
View Full Code Here

                }
            } else if (widget.equals(fillAlphaSpinner)) {
                fillAlpha = fillAlphaSpinner.getSelection();
            } else if (widget.equals(fillColorButton)) {
                ColorDialog dialog = new ColorDialog(fillColorButton.getShell());
                dialog.open();
                RGB rgb = dialog.getRGB();
                if (rgb != null) {
                    fillColor = new Color(rgb.red, rgb.green, rgb.blue);
                }
            } else if (widget.equals(rectangleRadio) || widget.equals(roundRectangleRadio)
View Full Code Here

        fButton.setImage(fImage);
        fButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent event ) {
                ColorDialog colorDialog = new ColorDialog(fButton.getShell());
                colorDialog.setRGB(fColorValue);
                RGB newColor = colorDialog.open();
                if (newColor != null) {
                    fColorValue = newColor;
                    updateColorImage();
                }
                notifyParent(event);
View Full Code Here

    public void widgetSelected( SelectionEvent e ) {
        Combo combo = (Combo) e.widget;
       
        if( Outline.values()[combo.getSelectionIndex()] == Outline.CUSTOM ){
            ColorDialog dialog = new ColorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
            dialog.open();
            combo.setData(dialog.getRGB());
        }
        page.generateTheme();
    }
View Full Code Here

        protected Object openDialogBox(Shell shell) {
            ColorDialog dialog = new ColorDialog(shell);
            //Object value = getValue();
            if (value != null)
                dialog.setRGB((RGB) value);
            value = dialog.open();
            return dialog.getRGB();
        }

        @Override
        protected Control createControl( Composite cell ) {
View Full Code Here

        fButton.setImage(fImage);
        fButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent event ) {
                ColorDialog colorDialog = new ColorDialog(fButton.getShell());
                colorDialog.setRGB(fColorValue);
                RGB newColor = colorDialog.open();
                if (newColor != null) {
                    fColorValue = newColor;
                    updateColorImage();
                }
                notifyParent(event);
View Full Code Here

 
  public void run() {
    ColorDialog cd = new ColorDialog(page.getWorkbenchWindow().getShell());
        cd.setText("ColorDialog Demo");
        cd.setRGB(new RGB(255, 255, 255));
        RGB newColor = cd.open();
        if (newColor == null) {
          return;
        }
        Color currentColor = new Color(newColor.red, newColor.green, newColor.blue);
       
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.