Package org.eclipse.swt.widgets

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


    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


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

                RGB rrgb = cdlg.open();

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

  }
 
  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

      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

            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

      @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);
        }
View Full Code Here

      @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

         * 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

        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

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.