Examples of ColorDialog


Examples of org.eclipse.swt.widgets.ColorDialog

        gc.dispose();
       
        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();
                }
            }
View Full Code Here

Examples of org.eclipse.swt.widgets.ColorDialog

    }
    valueChanged(oldValidState, newValidState);
  }

  protected Object openDialogBox(Control cellEditorWindow) {
    ColorDialog dialog = new ColorDialog(cellEditorWindow.getShell());
    Object value = getValue();
    if (value != null) {
      dialog.setRGB((RGB) value);
    }
    value = dialog.open();
    return dialog.getRGB();
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.ColorDialog

    public ColorCellEditor(Composite parent) {
        super(parent);
    }
   
    protected Object openDialogBox(Control cellEditorWindow) {
        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

Examples of org.eclipse.swt.widgets.ColorDialog

    public void mouseDown( MouseEvent e ) {
        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

Examples of org.eclipse.swt.widgets.ColorDialog

    public void mouseDown( MouseEvent e ) {
        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

Examples of org.eclipse.swt.widgets.ColorDialog

            if (widget.equals(lineWidthSpinner)) {
                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)) {
                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)
                    || widget.equals(ellipseRadio)) {
View Full Code Here

Examples of org.eclipse.swt.widgets.ColorDialog

        gc.dispose();

        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

Examples of org.eclipse.swt.widgets.ColorDialog

    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

Examples of org.eclipse.swt.widgets.ColorDialog

        /* (non-Javadoc)
         * Method declared on DialogCellEditor.
         */
        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();
        }
View Full Code Here

Examples of org.eclipse.swt.widgets.ColorDialog

        gc.dispose();

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