Package org.eclipse.jface.viewers

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


        {
            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

    return createRefCellEditor(table, getRefsProposalProvider(false));
  }

  private CellEditor createRefCellEditor(final Table table,
      final IContentProposalProvider proposalProvider) {
    final CellEditor cellEditor = new TextCellEditor(table);

    final Text text = (Text) cellEditor.getControl();
    final ContentAssistCommandAdapter assist = new ContentAssistCommandAdapter(
        text, new TextContentAdapter(), proposalProvider, null, null,
        true);
    assist
        .setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
View Full Code Here

      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 ComboBoxCellEditor(viewer.getTree(), new String[]{"false", "true"},
                    SWT.READ_ONLY);
          }
          else {
            editor = new TextCellEditor(viewer.getTree());
            editor.setValidator(CellEditorValidatorFacotory.createValidator(Primitives
                    .getPrimitiveClass(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 ComboBoxCellEditor(viewer.getTree(), new String[]{"false", "true"},
                  SWT.READ_ONLY);
          editor.setStyle(SWT.READ_ONLY);
        }
        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

                    if ( startEditAction.isEnabled()
                        && startEditAction.getBestValueEditor().getCellEditor() instanceof TextCellEditor )
                    {
                        startEditAction.run();
                        CellEditor editor = viewer.getCellEditors()[cursor.getColumn()];
                        if ( editor instanceof TextCellEditor )
                        {
                            editor.setValue( String.valueOf( e.character ) );
                            ( ( Text ) editor.getControl() ).setSelection( 1 );
                        }
                    }

                }
            }


            public void keyReleased( KeyEvent e )
            {
            }
        } );

        editor.getSite().getPage().addPartListener( this );
        EventRegistry.addSearchUpdateListener( this );
        EventRegistry.addEntryUpdateListener( this );
    }
View Full Code Here

                {
                    oldValue = "";
                }
                Object oldRawValue = valueEditor.getRawValue( context.getConnection(), oldValue );
               
                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

     */
    private void addValue()
    {
        Object oldRawValue = valueEditor.getRawValue( context.getConnection(), "" );
       
        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

        String oldValue = getSelectedValue();
        if ( oldValue != null )
        {
            Object oldRawValue = valueEditor.getRawValue( context.getConnection(), oldValue );
           
            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

         *
         * @return editor
         */
        public CellEditor getEditor( final Composite parent )
        {
            CellEditor editor = getEditorType().getEditor( parent, this );
            editor.setValidator( getCellValidator() );
            return editor;
        }
View Full Code Here

TOP

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

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.