Examples of ComboBoxCellEditor


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

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

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

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

Examples of org.eclipse.jface.viewers.ComboBoxCellEditor

                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

Examples of org.eclipse.jface.viewers.ComboBoxCellEditor

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

Examples of org.eclipse.jface.viewers.ComboBoxCellEditor

            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

Examples of org.eclipse.jface.viewers.ComboBoxCellEditor

    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

Examples of org.eclipse.jface.viewers.ComboBoxCellEditor

        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

Examples of org.eclipse.jface.viewers.ComboBoxCellEditor

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