Examples of CellEditor


Examples of org.eclipse.jface.viewers.CellEditor

public class RectangleEditor extends RectangleWrapper implements ICellEditorFactory {
  private static final long serialVersionUID = -4403435758517308113L;

 
  public CellEditor createPropertyEditor(Object bean, Composite parent) {
    CellEditor editor = new TextCellEditor(parent);
    editor.setValidator(new RectangleCellEditorValidator());
    return editor;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

public class DimensionEditor extends DimensionWrapper implements ICellEditorFactory {
  private static final long serialVersionUID = -4403435758517308113L;

 
  public CellEditor createPropertyEditor(Object bean, Composite parent) {
    CellEditor editor = new TextCellEditor(parent);
    editor.setValidator(new DimensionCellEditorValidator());
    return editor;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

public class FloatEditor extends FloatWrapper implements ICellEditorFactory {
  private static final long serialVersionUID = -4403435758517308113L;

 
  public CellEditor createPropertyEditor(Object bean, Composite parent) {
    CellEditor editor = new TextCellEditor(parent);
    editor.setValidator(new FloatCellEditorValidator());
    return editor;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

public class CharEditor implements ICellEditorFactory {
  private static final long serialVersionUID = -4403435758517308113L;

 
  public CellEditor createPropertyEditor(Object bean, Composite parent) {
    CellEditor editor = new TextCellEditor(parent);
    editor.setValidator(new CharCellEditorValidator());
    return editor;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

public class InsetsEditor extends InsetsWrapper implements ICellEditorFactory {
  private static final long serialVersionUID = -4403435758517308113L;

 
  public CellEditor createPropertyEditor(Object bean, Composite parent) {
    CellEditor editor = new TextCellEditor(parent);
    editor.setValidator(new InsetsCellEditorValidator());
    return editor;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

public class IntegerEditor implements ICellEditorFactory {
  private static final long serialVersionUID = -4403435758517308113L;

 
  public CellEditor createPropertyEditor(Object bean, Composite parent) {
    CellEditor editor = new TextCellEditor(parent);
    editor.setValidator(new IntegerCellEditorValidator());
    return editor;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

        this.cellEditorClass = cellEditorClass;
    }
   
    public CellEditor createPropertyEditor(Composite parent) {
        try {
            CellEditor editor = (CellEditor) cellEditorClass.getConstructor(new Class[] { Composite.class }).newInstance(new Object[] { parent });
            if (getValidator() != null) {
                editor.setValidator(getValidator());
            }
            return editor;
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        } catch (NoSuchMethodException e) {
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

    {
        IAttribute attribute = new Attribute( context.getEntry(), "" ); //$NON-NLS-1$
        IValue value = new Value( attribute, "" ); //$NON-NLS-1$
        Object oldRawValue = valueEditor.getRawValue( value ); //$NON-NLS-1$

        CellEditor cellEditor = valueEditor.getCellEditor();
        cellEditor.setValue( oldRawValue );
        cellEditor.activate();
        Object newRawValue = cellEditor.getValue();

        if ( newRawValue != null )
        {
            String newValue = ( String ) valueEditor.getStringOrBinaryValue( newRawValue );
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

        {
            IAttribute attribute = new Attribute( context.getEntry(), "" ); //$NON-NLS-1$
            IValue value = new Value( attribute, oldValue ); //$NON-NLS-1$
            Object oldRawValue = valueEditor.getRawValue( value ); //$NON-NLS-1$

            CellEditor cellEditor = valueEditor.getCellEditor();
            cellEditor.setValue( oldRawValue );
            cellEditor.activate();
            Object newRawValue = cellEditor.getValue();

            if ( newRawValue != null )
            {
                String newValue = ( String ) valueEditor.getStringOrBinaryValue( newRawValue );
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

      if (element instanceof FeatureValue) {
        FeatureValue value = (FeatureValue) element;

        if (value.getFeature().getRange().isPrimitive()) {

          CellEditor editor;

          if (value.getFeature().getRange().getName().equals(CAS.TYPE_NAME_BOOLEAN)) {
            editor = new CheckboxCellEditor(viewer.getTree(), SWT.CHECK);
          }
          else {
            editor = new TextCellEditor(viewer.getTree());
            editor.setValidator(CellEditorValidatorFacotory.createValidator(Primitives
                    .getPrimitiveClass(value.getFeatureStructure().getCAS().getTypeSystem(), value.getFeature())));
          }

          return editor;
        }
        else {
          return null;
        }
      } else if (element instanceof ArrayValue) {

        ArrayValue arrayValue = (ArrayValue) element;

        FeatureStructure arrayFS = arrayValue.getFeatureStructure();

        CellEditor editor;

        if (arrayFS instanceof BooleanArrayFS) {
          editor = new CheckboxCellEditor(viewer.getTree(), SWT.CHECK);
        }
        else {
          editor = new TextCellEditor(viewer.getTree());

          if (arrayFS instanceof ByteArrayFS) {
            editor.setValidator(CellEditorValidatorFacotory.createValidator(Byte.class));
          }
          else if (arrayFS instanceof ShortArrayFS) {
            editor.setValidator(CellEditorValidatorFacotory.createValidator(Short.class));
          }
          else if (arrayFS instanceof IntArrayFS) {
            editor.setValidator(CellEditorValidatorFacotory.createValidator(Integer.class));
          }
          else if (arrayFS instanceof LongArrayFS) {
            editor.setValidator(CellEditorValidatorFacotory.createValidator(Long.class));
          }
          else if (arrayFS instanceof FloatArrayFS) {
            editor.setValidator(CellEditorValidatorFacotory.createValidator(Float.class));
          }
          else if (arrayFS instanceof DoubleArrayFS) {
            editor.setValidator(CellEditorValidatorFacotory.createValidator(Double.class));
          }
          else if (arrayFS instanceof StringArrayFS) {
            // no validator needed
          }
          else {
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.