Examples of CCombo


Examples of org.eclipse.swt.custom.CCombo

     * @param parent the combo box parent.
     * @param comboStyle the combo box style.
     * @return the combo box.
     */
    public CCombo createCCombo( Composite parent, int comboStyle ) {
        CCombo combo = new CCombo(parent, comboStyle);
        adapt(combo, true, false);
        // Bugzilla 145837 - workaround for no borders on Windows XP
        if (getBorderStyle() == SWT.BORDER) {
            combo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
        }
        return combo;
    }
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

    super.setItems(names);
  }

  @Override
  protected Control createControl(Composite parent) {
    CCombo combo = (CCombo) super.createControl(parent);
    combo.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        focusLost();
      }
    });
    return combo;
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

   
    Composite actionSelectionComposite = toolkit.createComposite(searchResultClient);
    actionSelectionComposite.setLayoutData(new GridData(SWT.NONE, SWT.NONE, false, false));
    actionSelectionComposite.setLayout(new GridLayout(3, false));
   
    playlistSelection = new CCombo(actionSelectionComposite, SWT.BORDER | SWT.FLAT | SWT.DROP_DOWN | SWT.READ_ONLY);   
   
    playSelection = toolkit.createButton(actionSelectionComposite, Messages.getString("SearchView.PlayResults"), SWT.PUSH); //$NON-NLS-1$
    playSelection.setToolTipText(Messages.getString("SearchView.PlayResultsToolTip")); //$NON-NLS-1$
    playSelection.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
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

    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

    outputTypeText = new Text(composite, SWT.BORDER);
    outputTypeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    new Label(composite, SWT.WRAP).setText("Look in:");

    lookInCombo = new CCombo(composite, SWT.FLAT | SWT.BORDER | SWT.READ_ONLY);
    String[] projectNames = getProjectNames();
    lookInCombo.add(' ' + ALL_PROJECTS);
    for (int i = 0; i < projectNames.length; i++) {
      lookInCombo.add(' ' + projectNames[i]);
    }
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

          // Column 2 holds dropdowns
          if (column == 0)
          {
            // Create the dropdown and add data to it
            final CCombo combo = new CCombo(incrementTable, SWT.READ_ONLY);
            // for (int i = 0, n = sdps.keySet().size(); i < n; i++)
            // {
            // combo.add(sdps.keySet().toArray()[i].toString());
            // }
            for (String key : sdps)
            {
              if(key.contains("["))
                continue;
             
              if (getItemIfPresent(key) == null
                  || item.getText(column).equals(key))
              {
                combo.add(key);
              }
            }
           
            // Select the previously selected item from the cell
            combo.select(combo.indexOf(item.getText(column)));

            // Compute the width for the editor
            // Also, compute the column width, so that the dropdown fits
            editor.minimumWidth = combo.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
            if (incrementTable.getColumn(column).getWidth() < editor.minimumWidth)
            {
              incrementTable.getColumn(column).setWidth(editor.minimumWidth);
            }
            // Set the focus on the dropdown and set into the editor
            combo.setFocus();
            editor.setEditor(combo, item, column);

            combo.addModifyListener(fListener);

            // Add a listener to set the selected item back into the cell
            final int col = column;
            combo.addSelectionListener(new SelectionAdapter()
            {
              public void widgetSelected(SelectionEvent event)
              {
                item.setText(col, combo.getText());
                Button a = new Button(incrementTable, SWT.PUSH);
                TableEditor editor = new TableEditor(incrementTable);
                a.setText("Delete");
                a.computeSize(SWT.DEFAULT, incrementTable.getItemHeight());

                editor.grabHorizontal = true;
                editor.minimumHeight = a.getSize().y;
                editor.minimumWidth = a.getSize().x;

                editor.setEditor(a, item, 4);
                a.addSelectionListener(new SelectionListener() {
                 
                  public void widgetSelected(SelectionEvent e) {
                    removeItem(incrementTable, col, e);
                   
                  }
                 
                  public void widgetDefaultSelected(SelectionEvent e) {
                   
                  }
                });              // setDirty(true);
                // updateLaunchConfigurationDialog();

                // They selected an item; end the editing session
                combo.dispose();
              }
            });
           
         
           
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

          // Column 2 holds dropdowns
          if (column == 0)
          {
            // Create the dropdown and add data to it
            final CCombo combo = new CCombo(valueSetTable, SWT.READ_ONLY);
            // for (int i = 0, n = sdps.keySet().size(); i < n; i++)
            // {
            // combo.add(sdps.keySet().toArray()[i].toString());
            // }
            for (String key : sdps)
            {
              if (getItemIfPresent(key) == null
                  || item.getText(column).equals(key))
              {
                combo.add(key);
              }
            }

            // Select the previously selected item from the cell
            combo.select(combo.indexOf(item.getText(column)));

            // Compute the width for the editor
            // Also, compute the column width, so that the dropdown fits
            editor.minimumWidth = combo.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
            if (valueSetTable.getColumn(column).getWidth() < editor.minimumWidth)
            {
              valueSetTable.getColumn(column).setWidth(editor.minimumWidth);
            }
            // Set the focus on the dropdown and set into the editor
            combo.setFocus();
            editor.setEditor(combo, item, column);

//            combo.addModifyListener(fListener);

            // Add a listener to set the selected item back into the cell
            final int col = column;
            combo.addSelectionListener(new SelectionAdapter()
            {
              public void widgetSelected(SelectionEvent event)
              {
                item.setText(col, combo.getText());
                // setDirty(true);
                // updateLaunchConfigurationDialog();
                updateLaunchConfigurationDialog();
                // They selected an item; end the editing session
                combo.dispose();
               
                Button a = new Button(valueSetTable, SWT.PUSH);
                TableEditor editor = new TableEditor(valueSetTable);
                a.setText("Delete");
                a.computeSize(SWT.DEFAULT, valueSetTable.getItemHeight());
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

          if (item.getText().equals("Style")
            || item.getText().equals("Arrow")
            || item.getText().equals("Shape"))
          {
            // Create the dropdown and add data to it
            final CCombo combo = new CCombo(table, SWT.READ_ONLY);

            if (item.getText().equals("Style"))
            {
              String[] styleOfEdge = {"Solid", "Dashed"};
              combo.setItems(styleOfEdge);
            }
            else if (item.getText().equals("Arrow"))
            {
              String[] arrowOfEdge = {"None",
                "Source",
                "Target",
                "Both"};
              combo.setItems(arrowOfEdge);
            }
            else if (item.getText().equals("Shape"))
            {
               combo.setItems(NodeModel.shapes);
            }

            // Select the previously selected item from the cell
            combo.select(combo.indexOf(item.getText(1)));
//            combo.setFont(tableFont);
            editor.setEditor(combo, item, 1);

            // Add a listener to set the selected item back into the
            // cell
            combo.addSelectionListener(new SelectionAdapter()
            {
              public void widgetSelected(SelectionEvent event)
              {
                item.setText(1, combo.getText());
                                // They selected an item; end the editing
                // session
                combo.dispose();
              }
            });
          }

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