Examples of CCombo


Examples of org.eclipse.swt.custom.CCombo

         bApply.setEnabled(valid);
       }
     });
     label2 = new Label(gWebService, SWT.NONE);
     label2.setText("Job Chain:");
     cChain = new CCombo(gWebService, SWT.BORDER);
     cChain.addSelectionListener(new SelectionAdapter() {
       public void widgetSelected(final SelectionEvent e) {
       }
     });
     cChain.setEditable(true);
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

        cIgnoreUnknownHosts.setLayoutData(gridData1);
        label = new Label(group, SWT.NONE);
        tHost = new Text(group, SWT.BORDER);
        label4 = new Label(group, SWT.NONE);
        label4.setText("Access Level:");
        cLevel = new CCombo(group, SWT.BORDER | SWT.READ_ONLY);
        bApply = new Button(group, SWT.NONE);
        label1 = new Label(group, SWT.SEPARATOR | SWT.HORIZONTAL);
        label1.setText("Label");
        label1.setLayoutData(gridData7);
        cIgnoreUnknownHosts.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

        // Label previousMonthLabel = new Label(this, SWT.CENTER);
        // previousMonthLabel.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
        // style.setStyle(previousMonthLabel,
        // MonthSelectorStyle.PREVIOUSMONTHBUTTON);

        monthSelector = new CCombo(this, SWT.READ_ONLY | SWT.FLAT);
        monthSelector.setLayoutData(monthData);
        monthSelector.setItems(style.getMonthNames());
        monthSelector.addSelectionListener(new SelectionListener() {
            public void widgetDefaultSelected(SelectionEvent e) {
            }
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

    fdlRubyCompat.left = new FormAttachment(0, 0);
    fdlRubyCompat.right = new FormAttachment(middle, -margin);
    fdlRubyCompat.top = new FormAttachment(0, margin);
    lRubyCompat.setLayoutData(fdlRubyCompat);

    wRubyCompat = new CCombo(wPanel, SWT.READ_ONLY | SWT.BORDER);
    wRubyCompat.setItems(new String[] { "Ruby 1.8", "Ruby 1.9" });

    props.setLook(wRubyCompat);

    FormData fdRubyCompat = new FormData();
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

  /*
   * (non-Javadoc) Method declared on CellEditor.
   */
  protected Control createControl(Composite parent) {

    CCombo comboBox = new CCombo(parent, getStyle());
    comboBox.setFont(parent.getFont());
    viewer = new ComboViewer(comboBox);

    comboBox.addKeyListener(new KeyAdapter() {
      // hook key pressed - see PR 14201
      public void keyPressed(KeyEvent e) {
        keyReleaseOccured(e);
      }
    });

    comboBox.addSelectionListener(new SelectionAdapter() {
      public void widgetDefaultSelected(SelectionEvent event) {
        applyEditorValueAndDeactivate();
      }

      public void widgetSelected(SelectionEvent event) {
        ISelection selection = viewer.getSelection();
        if (selection.isEmpty()) {
          selectedValue = null;
        } else {
          selectedValue = ((IStructuredSelection) selection)
              .getFirstElement();
        }
      }
    });

    comboBox.addTraverseListener(new TraverseListener() {
      public void keyTraversed(TraverseEvent e) {
        if (e.detail == SWT.TRAVERSE_ESCAPE
            || e.detail == SWT.TRAVERSE_RETURN) {
          e.doit = false;
        }
      }
    });

    comboBox.addFocusListener(new FocusAdapter() {
      public void focusLost(FocusEvent e) {
        ComboBoxViewerCellEditor.this.focusLost();
      }
    });
    return comboBox;
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

  /*
   * (non-Javadoc) Method declared on CellEditor.
   */
  protected Control createControl(Composite parent) {

    comboBox = new CCombo(parent, getStyle());
    comboBox.setFont(parent.getFont());

    populateComboBoxItems();

    comboBox.addKeyListener(new KeyAdapter() {
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

    setTextAndTip(new Label(parent, SWT.NONE), label, tip);
    return newCCombo(parent, tip);
  }

  protected CCombo newCCombo(Composite parent, String tip) {
    final CCombo cc = new CCombo(parent, SWT.FLAT | SWT.BORDER | SWT.READ_ONLY);
    cc.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WHITE));
    cc.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    // without these next lines, the height of the ccombo is too small
    // especially on a Mac
    FontData [] fontData = cc.getFont().getFontData();
    ((GridData) cc.getLayoutData()).heightHint = 2 * fontData[0].getHeight();
    cc.addListener(SWT.Selection, this);
    cc.setToolTipText(tip);
    cc.addKeyListener(new KeyListener() {
      private final StringBuffer b = new StringBuffer();

      public void keyPressed(KeyEvent e) {
      }

      public void keyReleased(KeyEvent e) {
        if (e.keyCode == SWT.BS) {
          if (b.length() > 0)
            b.deleteCharAt(b.length() - 1);
        } else if (Character.isJavaIdentifierPart(e.character) || e.character == '.')
          b.append(e.character);
        else
          return;
        final String[] ccItems = cc.getItems();
        final String partial = b.toString();
        int iBefore = -1;
        for (int i = 0; i < ccItems.length; i++) {
          if (ccItems[i].startsWith(partial)) {
            iBefore = i;
            break;
          }
        }
        if (iBefore >= 0)
          cc.setText(cc.getItem(iBefore));
      }
    });
    return cc;
  }
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

    newLabelWithTip(parent, labelKey, tip);
    return newCComboWithTip(parent, tip);
  }

  protected CCombo newCComboWithTip(Composite parent, String tip) {
    CCombo ccombo = new CCombo(parent, SWT.FLAT | SWT.READ_ONLY);
    toolkit.adapt(ccombo, false, false);
    ccombo.setToolTipText(tip);
    ccombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
    ccombo.addListener(SWT.Selection, this);
    // Make the CCombo's border visible since CCombo is NOT a widget supported
    // by FormToolkit.
    // needed apparently by RedHat Linux
    ccombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
    return ccombo;
  }
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

    return composite;
  }

  private CCombo wideCCombo(Composite tc, String tip, String ... entries) {
    CCombo cc = newCCombo(tc, tip);
    for (String e : entries) {
      cc.add(e);
    }
    ((GridData) cc.getLayoutData()).grabExcessHorizontalSpace = true;;
    cc.select(0);
    return cc;
  }
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

        type.setLayoutData(layoutData);
       
        // JFace Viewer
        label = toolkit.createLabel(client, COLOR_MAP_LBL, LABEL_STYLE);
        FormComboBoxCellEditor colorEditor = new FormComboBoxCellEditor(client, new String[]{}, form.getMessageManager());
        CCombo colorCombo = (CCombo) colorEditor.getControl();
        colorMap = new ComboViewer(colorCombo);
        colorMap.addSelectionChangedListener(this);
        layoutData = new GridData();
        layoutData.horizontalSpan = 3;
        colorMap.getControl().setLayoutData(layoutData);
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.