Examples of ColorDialog


Examples of org.eclipse.swt.widgets.ColorDialog

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

Examples of org.eclipse.swt.widgets.ColorDialog

    // Color Dialog Button
    Button colorPicker = new Button(shellDetails, SWT.PUSH);
    colorPicker.setImage(Activator.getImageDescriptor("color-picker.gif").createImage());
    colorPicker.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        ColorDialog colorDialog = new ColorDialog(getShell(), SWT.SINGLE);
        colorDialog.setText("Please select background color.");
        colorDialog.setRGB(new RGB(255, 255, 255));
        RGB newColor = colorDialog.open();
        if (newColor == null) {
          return;
        }
        swfBackgroundColorText.setText(getHexCode(newColor));
      }
View Full Code Here

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

Examples of org.eclipse.swt.widgets.ColorDialog

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

Examples of org.eclipse.swt.widgets.ColorDialog

    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

Examples of org.eclipse.swt.widgets.ColorDialog

   * @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

Examples of org.eclipse.swt.widgets.ColorDialog

    @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

Examples of org.eclipse.swt.widgets.ColorDialog

    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

Examples of org.eclipse.swt.widgets.ColorDialog

      }
    });

    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

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