Examples of CCombo


Examples of org.eclipse.swt.custom.CCombo

      // adjust location if space available
      int offset = 0;
      if (layoutData.minimumWidth > labelRect.width && parentRect.x < labelRect.x) {
        offset = Math.min(layoutData.minimumWidth - labelRect.width, labelRect.x - parentRect.x);
      }
      CCombo combo = (CCombo)celleditor.getControl();
      textFigure.translateToAbsolute(labelRect);
      combo.setBounds(labelRect.x - offset, labelRect.y, layoutData.minimumWidth, charHeight);
      return;
    }   
   
    labelRect.x = parentRect.x;
    labelRect.width = parentRect.width;
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

    /* (non-Javadoc)
     * Method declared on CellEditor.
     */
    protected Control createControl(Composite parent)
    {
      CCombo comboBox = (CCombo)super.createControl(parent);
      comboBox.addTraverseListener(new TraverseListener()
      {
        @Override
        public void keyTraversed(TraverseEvent e)
        {
              if (e.detail == SWT.TRAVERSE_TAB_NEXT)
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

        public void modifyText(ModifyEvent e) {
          tableItem.setText(column, text.getText());
        }
      });
    } else if (editor instanceof CCombo) {
      final CCombo combo = (CCombo) editor;
      combo.setText(tableItem.getText(column));
      combo.addSelectionListener(new SelectionListener() {
        public void widgetDefaultSelected(SelectionEvent e) {
          tableItem.setText(column, combo.getText());
        }

        public void widgetSelected(SelectionEvent e) {
          tableItem.setText(column, combo.getItem(combo.getSelectionIndex()));
        }
      });
    } else if (editor instanceof Combo) {
      final Combo combo = (Combo) editor;
      combo.setText(tableItem.getText(column));
      combo.addSelectionListener(new SelectionListener() {
        public void widgetDefaultSelected(SelectionEvent e) {
          tableItem.setText(column, combo.getText());
        }

        public void widgetSelected(SelectionEvent e) {
          tableItem.setText(column, combo.getItem(combo.getSelectionIndex()));
        }
      });
    }
  }
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

    GridData gd_lblSelectExportType = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblSelectExportType.horizontalIndent = 10;
    lblSelectExportType.setLayoutData(gd_lblSelectExportType);
    lblSelectExportType.setText(Messages.SapConnectionConfigurationExportPage_ExportFileType);

    exportFileTypeCombo = new CCombo(top, SWT.READ_ONLY);
    exportFileTypeCombo.setToolTipText(Messages.SapConnectionConfigurationExportPage_ExportFileType);
    exportFileTypeCombo.setItems(new String[] {ExportFileType.BLUEPRINT.getDisplay(), ExportFileType.SPRING.getDisplay()});
    exportFileTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    exportFileTypeCombo.select(0);
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

      style |= SWT.READ_ONLY;
    if (borderButton.getSelection())
      style |= SWT.BORDER;

    /* Create the example widgets */
    combo1 = new CCombo(comboGroup, style);
    combo1.setItems(CComboTab.ListData);
    if (CComboTab.ListData.length >= 3)
      combo1.setText(CComboTab.ListData[2]);
  }
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

          lastSelected = newItem;
          return;
        }
        table.showSelection();

        combo = new CCombo(table, SWT.READ_ONLY);
        createComboEditor(combo, comboEditor);
      }
    });

    /* Add listener to add an element to the table */
 
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

          lastSelected = newItem;
          return;
        }
        table.showSelection();

        combo = new CCombo(table, SWT.READ_ONLY);
        createComboEditor(combo, comboEditor);

        widthText = new Text(table, SWT.SINGLE);
        widthText.setText(((String[]) data.elementAt(index))[WIDTH_COL]);
        createTextEditor(widthText, widthEditor, WIDTH_COL);
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

          lastSelected = newItem;
          return;
        }
        table.showSelection();

        combo = new CCombo(table, SWT.READ_ONLY);
        createComboEditor(combo, comboEditor);

        widthText = new Text(table, SWT.SINGLE);
        widthText.setText(((String[]) data.elementAt(index))[WIDTH_COL]);
        createTextEditor(widthText, widthEditor, WIDTH_COL);
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

          lastSelected = newItem;
          return;
        }
        table.showSelection();

        combo = new CCombo(table, SWT.READ_ONLY);
        createComboEditor(combo, comboEditor);

        widthText = new Text(table, SWT.SINGLE);
        widthText.setText(((String[]) data.elementAt(index))[WIDTH_COL]);
        createTextEditor(widthText, widthEditor, WIDTH_COL);

        heightText = new Text(table, SWT.SINGLE);
        heightText.setText(((String[]) data.elementAt(index))[HEIGHT_COL]);
        createTextEditor(heightText, heightEditor, HEIGHT_COL);
        String[] alignValues = new String[] { "BEGINNING", "CENTER", "END", "FILL" };
        hAlign = new CCombo(table, SWT.NONE);
        hAlign.setItems(alignValues);
        hAlign.setText(newItem.getText(HALIGN_COL));
        hAlignEditor.horizontalAlignment = SWT.LEFT;
        hAlignEditor.grabHorizontal = true;
        hAlignEditor.minimumWidth = 50;
        hAlignEditor.setEditor(hAlign, newItem, HALIGN_COL);
        hAlign.addTraverseListener(traverseListener);

        vAlign = new CCombo(table, SWT.NONE);
        vAlign.setItems(alignValues);
        vAlign.setText(newItem.getText(VALIGN_COL));
        vAlignEditor.horizontalAlignment = SWT.LEFT;
        vAlignEditor.grabHorizontal = true;
        vAlignEditor.minimumWidth = 50;
        vAlignEditor.setEditor(vAlign, newItem, VALIGN_COL);
        vAlign.addTraverseListener(traverseListener);

        hIndent = new Text(table, SWT.SINGLE);
        hIndent.setText(((String[]) data.elementAt(index))[HINDENT_COL]);
        createTextEditor(hIndent, hIndentEditor, HINDENT_COL);

        hSpan = new Text(table, SWT.SINGLE);
        hSpan.setText(((String[]) data.elementAt(index))[HSPAN_COL]);
        createTextEditor(hSpan, hSpanEditor, HSPAN_COL);

        vSpan = new Text(table, SWT.SINGLE);
        vSpan.setText(((String[]) data.elementAt(index))[VSPAN_COL]);
        createTextEditor(vSpan, vSpanEditor, VSPAN_COL);

        String[] boolValues = new String[] { "false", "true" };
        hGrab = new CCombo(table, SWT.NONE);
        hGrab.setItems(boolValues);
        hGrab.setText(newItem.getText(HGRAB_COL));
        hGrabEditor.horizontalAlignment = SWT.LEFT;
        hGrabEditor.grabHorizontal = true;
        hGrabEditor.minimumWidth = 50;
        hGrabEditor.setEditor(hGrab, newItem, HGRAB_COL);
        hGrab.addTraverseListener(traverseListener);

        vGrab = new CCombo(table, SWT.NONE);
        vGrab.setItems(boolValues);
        vGrab.setText(newItem.getText(VGRAB_COL));
        vGrabEditor.horizontalAlignment = SWT.LEFT;
        vGrabEditor.grabHorizontal = true;
        vGrabEditor.minimumWidth = 50;
View Full Code Here

Examples of org.eclipse.swt.custom.CCombo

        .setActivationStyle(ComboBoxCellEditor.DROP_DOWN_ON_KEY_ACTIVATION
            | ComboBoxCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION);
    ((CCombo) branchesEditor.getControl()).addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        CCombo combo = (CCombo) e.widget;
        TreeSelection sel = (TreeSelection) treeViewer.getSelection();
        int selectedIdx = combo.getSelectionIndex();
        Repository repo = (Repository) sel.getFirstElement();

        if (selectedIdx != -1) {
          selectedBranches.put(repo, combo.getItem(selectedIdx));
          setPageComplete(true);
        } else {
          selectedBranches.put(repo, null);
          setPageComplete(false);
        }
      }
    });
    dstColumn.setEditingSupport(new EditingSupport(treeViewer) {
      @Override
      protected void setValue(Object element, Object value) {
        int intValue = ((Integer) value).intValue();
        if (intValue == -1)
          return;

        CCombo combo = (CCombo) branchesEditor.getControl();
        String branch = combo.getItem(intValue);

        selectedBranches.put((Repository) element, branch);
        treeViewer.refresh(element, true);

        validatePage();
      }

      @Override
      protected Object getValue(Object element) {
        String branch = selectedBranches.get(element);
        CCombo combo = (CCombo) branchesEditor.getControl();
        int index = branch == null ? 0 : combo.indexOf(branch);
        return Integer.valueOf(index);
      }

      @Override
      protected CellEditor getCellEditor(Object element) {
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.