Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.ComboBoxCellEditor


        protected ComboBoxCellEditor editor;

        public InlineComboEditingSupport(ColumnViewer viewer) {
            super(viewer);
            this.editor = new ComboBoxCellEditor((Composite) viewer.getControl(), new String[] {});

            Control control = editor.getControl();
            ((CCombo) control).addSelectionListener(new SelectionListener() {
                public void widgetSelected(SelectionEvent e) {
                    editor.deactivate();
View Full Code Here


    protected ComboBoxCellEditor editor;

    public InlineComboEditingSupport(ColumnViewer viewer) {
      super(viewer);
      this.editor = new ComboBoxCellEditor((Composite) viewer.getControl(), new String[] {});

      Control control = editor.getControl();
      ((CCombo) control).addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent e) {
          editor.deactivate();
View Full Code Here

                checkFinish();
            }

        });
        tableViewer.setCellEditors(new CellEditor[]{new TextCellEditor(table), new TextCellEditor(table),
                new ComboBoxCellEditor(table, JGrassConstants.CSVTYPESARRAY)});

        // the label provider
        tableViewer.setLabelProvider(new ITableLabelProvider(){

            public Image getColumnImage( Object element, int columnIndex ) {
View Full Code Here

    }
  }
 
  private void createAmbiguousControls() {
    textCellEditor = new TextCellEditor(parent);
    comboBoxCellEditor = new ComboBoxCellEditor(parent, layers);
  }
View Full Code Here

            for( int i = 0; i < comboItems.length; i++ ) {
                comboItems[i] = legalTypes.get(i).getName();
            }

            TextCellEditor attributeNameEditor = new TextCellEditor(tree);
            ComboBoxCellEditor attributeTypeEditor = new ComboBoxCellEditor(tree, comboItems, SWT.READ_ONLY|SWT.FULL_SELECTION);
      DialogCellEditor crsEditor = createCRSEditor(tree);
      viewer.setCellEditors(new CellEditor[]{attributeNameEditor,
                    attributeTypeEditor,
                    crsEditor
            });
View Full Code Here

    final int choice = current;
    return new ExtraParams(name,param) {
     
      @Override
      public CellEditor createCellEditor(Composite parent) {
        ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(parent, options);
        comboBoxCellEditor.setValue(choice);
        return comboBoxCellEditor;
      }
     
      @Override
      public Serializable convertValue(Object cellEditorValue) {
        ComboBoxCellEditor editor = (ComboBoxCellEditor)getCellEditor();
        String value = editor.getItems()[(Integer) cellEditorValue];
        return super.convertValue(value);
      }

      @Override
      public void setValue(String value) {
        int index = 0;
        for (String option : options) {
          if(option.equals(value)) {
            getCellEditor().setValue(index);
            return;
          }
          index++;
        }
        throw new IllegalArgumentException(value+" is not one of the options in the combo:"+(Arrays.toString(options)));
      }

      @Override
      public String getValue() {
        ComboBoxCellEditor editor = (ComboBoxCellEditor)getCellEditor();
        int cellEditorValue = (Integer) editor.getValue();
        String value = editor.getItems()[cellEditorValue];
        return value;
      }
    };
  }
View Full Code Here

        return null;
     
        try{
            if (Boolean.class.isAssignableFrom(type.getType().getBinding())
                    || boolean.class.isAssignableFrom(type.getType().getBinding()))
                return new ComboBoxCellEditor(
                        parent,
                        new String[]{
                                Messages.AttributePropertyDescriptor_true, Messages.AttributePropertyDescriptor_false})
            if (String.class.isAssignableFrom(type.getType().getBinding()))
                return new TextCellEditor(parent);
            if (Integer.class.isAssignableFrom(type.getType().getBinding()))
                return new BasicTypeCellEditor(parent, Integer.class);
            if (Double.class.isAssignableFrom(type.getType().getBinding()))
                return new BasicTypeCellEditor(parent, Double.class);
            if (Float.class.isAssignableFrom(type.getType().getBinding()))
                return new BasicTypeCellEditor(parent, Float.class);
            if (Long.class.isAssignableFrom(type.getType().getBinding()))
                return new BasicTypeCellEditor(parent, Long.class);
            if (BigInteger.class.isAssignableFrom(type.getType().getBinding()))
                return new BasicTypeCellEditor(parent, BigInteger.class);
            if (BigDecimal.class.isAssignableFrom(type.getType().getBinding()))
                return new BasicTypeCellEditor(parent, BigDecimal.class);
            if (Long.class.isAssignableFrom(type.getType().getBinding()))
                return new BasicTypeCellEditor(parent, Long.class);
            if (CodeList.class.isAssignableFrom(type.getType().getBinding())) {
                return new ComboBoxCellEditor(parent, comboBoxList);
            }
            return super.createPropertyEditor(parent);
        }catch(Throwable t){
            ProjectUIPlugin.log("error converting attribute to string", t);
            return null;
View Full Code Here

        public CellEditor createCellEditor(final Table table)
          {
          if ((_cellEdt == null) && editable)
            {
            String[] tblAttrName = new String[0];
            _cellEdt = new ComboBoxCellEditor(table, tblAttrName);
            _cmbCellEditor = (ComboBoxCellEditor) _cellEdt;
            }

          return _cellEdt;
          }
View Full Code Here

          {
          tabRefListNames[ii] = eu.getVisualLabel();
          ii++;
          }

        cellEdt = new ComboBoxCellEditor(table, tabRefListNames, SWT.READ_ONLY);
        break;

      case T_TypeEnum:
        AttrType[] vt = AttrType.values();

        int nbT = 0;
        for (AttrType at : vt)
          {
          if (at.id > 0)
            nbT++;
          }

        String[] tabTypesNames = new String[nbT];
        int i = 0;
        for (AttrType at : vt)
          {
          if (at.id > 0)
            {
            tabTypesNames[i++] = at.name;
            }
          }

        cellEdt = new ComboBoxCellEditor(table, tabTypesNames, SWT.READ_ONLY);
        //          PoserMeshedObject pm = (PoserMeshedObject) po;
        //          PoserFile pf = pm.getPoserFile();
        //          List<String> ls = pf.getLstFigProp();
        //          int noit = ls.indexOf(p);
        //          ((Combo) _widget).setItems(ls.toArray(new String[ls.size()]));
View Full Code Here

            String[] tblAttrName = new String[]
              {
                  "Ignore", "Create", "Update", "Delete"
              };

            _cellEdt = new ComboBoxCellEditor(table, tblAttrName, SWT.READ_ONLY);
            }

          return _cellEdt;
          }
      });
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.ComboBoxCellEditor

Copyright © 2018 www.massapicom. 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.