Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.ColorDialog


     * Opens the color dialog and returns the selected color.
     * @return the selected color in RGB format
     */
    private RGB openColorDialog() {
        if (dialog == null) {
            dialog = new ColorDialog(getShell());
        }
        dialog.setRGB(currentRGB);
        RGB rgb = dialog.open();
        return rgb == null ? currentRGB : rgb;
    }
View Full Code Here


          ((Button) _wid).addSelectionListener(new SelectionAdapter()
            {
              @Override
              public void widgetSelected(SelectionEvent e)
                {
                ColorDialog cdlg = new ColorDialog(_wid.getShell());

                if (_data != null)
                  {
                  cdlg.setRGB((RGB) _data);
                  }

                RGB rrgb = cdlg.open();

                if (rrgb != null)
                  {
                  _edPart.setDirty(true);
                  _data = rrgb;
View Full Code Here

    this.editor = editor;
  }
 
  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

   * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
   */
  public void mouseUp(MouseEvent e) {
    if (e.widget instanceof Label) {
      Control control = (Control) e.widget;
      ColorDialog cd = new ColorDialog(shell);
      Color color = control.getBackground();
      RGB rgb = color.getRGB();
      cd.setRGB(rgb);
      color.dispose();
      rgb = cd.open();
      if (rgb != null) {
        color = new Color(SwtConsts.display, rgb);
        control.setBackground(color);
        color.dispose();
      }
View Full Code Here

    @Override
    public void run() {
        Utils.runSafeSWTSync(log, new Runnable() {
            public void run() {
                boolean done = false;
                ColorDialog changeColor = new ColorDialog(EditorAPI.getShell());
                changeColor.setText(Messages.ChangeColorAction_dialog_text);
                while (!done) {
                    RGB selectedColor = changeColor.open();
                    if (selectedColor == null) {
                        break;
                    }
                    ISarosSession sarosSession = sessionManager
                        .getSarosSession();
View Full Code Here

    Button pick_color = new Button(tab_ax_container, SWT.NONE);
    pick_color.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        ColorDialog dlg = new ColorDialog(HTMLPropertiesPage.this.getShell());
        dlg.setRGB(ax_bcolor.getRGB());
        dlg.setText("Pick a Color");
        RGB rgb = dlg.open();
        if (rgb != null) {
          ax_bcolor.dispose();
          ax_bcolor = new Color(HTMLPropertiesPage.this.getShell().getDisplay(), rgb);
          ax_background.setBackground(ax_bcolor);
        }
      }
    });
    pick_color.setText("Pick a color");

    Label lab_enginP = new Label(tab_ax_container, SWT.NONE);
    lab_enginP.setLayoutData(gd11v10h20);
    lab_enginP.setText("Engine params");

    ax_engineP = new Text(tab_ax_container, SWT.BORDER);
    ax_engineP.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
   
    Label lab_userP = new Label(tab_ax_container, SWT.NONE);
    lab_userP.setLayoutData(gd11v10h20);
    lab_userP.setText("User params");

    ax_userP = new Text(tab_ax_container, SWT.BORDER);
    ax_userP.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));

    //*********** HTML SECTION ***********


    TabItem tbtmHtml = new TabItem(tabFolder, SWT.NONE);
    tbtmHtml.setText("HTML");

    Composite tab_html_container = new Composite(tabFolder, SWT.NONE);
    tbtmHtml.setControl(tab_html_container);
    tab_html_container.setLayout(lay);

    Label hl_descr = new Label(tab_html_container, SWT.NONE);
    hl_descr.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
    hl_descr.setText("Specify the parameters for your HTML page");
    hl_descr.setLocation(0, 0);

    Label lab_margin = new Label(tab_html_container, SWT.NONE);
    lab_margin.setLayoutData(gd11v10h20);
    lab_margin.setText("Margin");

    hl_margin = new Text(tab_html_container, SWT.BORDER);
    hl_margin.setLayoutData(gd11v10);
   
    hl_margin_abs = new Button(tab_html_container, SWT.CHECK);
    hl_margin_abs.setLayoutData(gd11v10);
    hl_margin_abs.setText("absolute");
   
    Label lab_padding = new Label(tab_html_container, SWT.NONE);
    lab_padding.setLayoutData(gd11v10h20);
    lab_padding.setText("Padding");
    lab_padding.setLocation(0, 0);

    hl_padding = new Text(tab_html_container, SWT.BORDER);
    hl_padding .setLayoutData(gd11v10);
   
    hl_padding_abs = new Button(tab_html_container, SWT.CHECK);
    hl_padding_abs.setLayoutData(gd11v10);
    hl_padding_abs.setText("absolute");
   
    Label lab_scroll = new Label(tab_html_container, SWT.NONE);
    lab_scroll.setLayoutData(gd11v10h20);
    lab_scroll.setText("Enable scroll");

    hl_scroll = new Button(tab_html_container, SWT.CHECK);
    hl_scroll.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));

    Label lab = new Label(tab_html_container, SWT.NONE);
    lab.setLayoutData(gd11v10h20);
    lab.setText("Background");

    hl_background = new Label(tab_html_container, SWT.BORDER);
    hl_background.setBackground(this.hl_bcolor);
    hl_background.setText("                                   ");

    Button btnPickAColor = new Button(tab_html_container, SWT.NONE);
    btnPickAColor.setText("Pick a color");
    btnPickAColor.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        ColorDialog dlg = new ColorDialog(HTMLPropertiesPage.this.getShell());
        dlg.setRGB(hl_bcolor.getRGB());
        dlg.setText("Pick a Color");
        RGB rgb = dlg.open();
        if (rgb != null) {
          hl_bcolor.dispose();
          hl_bcolor = new Color(HTMLPropertiesPage.this.getShell().getDisplay(), rgb);
          hl_background.setBackground(hl_bcolor);
        }
View Full Code Here

      }
    });

    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

         * customs.ircColorsStr.get(combo.getText()));
         * Settings.getSettings().setOutputColors(outputColors);
         * Settings.writeToFile();
         */

        ColorDialog cd = new ColorDialog(RoomManager.getMain()
            .getShell());
        RGB rgb = cd.open();
        if (rgb != null) {
          Button btn = (Button) e.widget;
          HashMap<Integer, RGB> statusColors = Settings.getSettings()
              .getRoomStatusColors();
          statusColors.put((Integer) btn.getData(), rgb);
View Full Code Here

        Button colorButton = new Button(optionGroup, SWT.PUSH);
        colorButton.setText("Color");
        colorButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent arg0) {
                ColorDialog dialog = new ColorDialog(IComponentTestPanel.this.getShell());
                RGB rgb = dialog.open();
                if (rgb != null) {
                    Color col = new Color(Display.getCurrent(), rgb);
                    CometeColor cometeColor = ColorTool.getCometeColor(col);
                    theComponent.setCometeBackground(cometeColor);
                    col.dispose();
View Full Code Here

        Button colorButton = new Button(optionGroup, SWT.PUSH);
        colorButton.setText("Color");
        colorButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent arg0) {
                ColorDialog dialog = new ColorDialog(IComponentTestPanel.this.getShell());
                RGB rgb = dialog.open();
                if (rgb != null) {
                    Color col = new Color(Display.getCurrent(), rgb);
                    theComponent.setCometeForeground(ColorTool.getCometeColor(col));
                    col.dispose();
                    colorList.deselectAll();
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.ColorDialog

Copyright © 2018 www.massapicom. 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.