Examples of EditTextCell


Examples of com.google.gwt.cell.client.EditTextCell

    dataGrid.addColumn(checkColumn, SafeHtmlUtils.fromSafeConstant("<br/>"));
    dataGrid.setColumnWidth(checkColumn, 40, Unit.PX);

    // First name.
    Column<ContactInfo, String> firstNameColumn =
        new Column<ContactInfo, String>(new EditTextCell()) {
          @Override
          public String getValue(ContactInfo object) {
            return object.getFirstName();
          }
        };
    firstNameColumn.setSortable(true);
    sortHandler.setComparator(firstNameColumn, new Comparator<ContactInfo>() {
      public int compare(ContactInfo o1, ContactInfo o2) {
        return o1.getFirstName().compareTo(o2.getFirstName());
      }
    });
    dataGrid.addColumn(firstNameColumn, constants.cwDataGridColumnFirstName());
    firstNameColumn.setFieldUpdater(new FieldUpdater<ContactInfo, String>() {
      public void update(int index, ContactInfo object, String value) {
        // Called when the user changes the value.
        object.setFirstName(value);
        ContactDatabase.get().refreshDisplays();
      }
    });
    dataGrid.setColumnWidth(firstNameColumn, 20, Unit.PCT);

    // Last name.
    Column<ContactInfo, String> lastNameColumn =
        new Column<ContactInfo, String>(new EditTextCell()) {
          @Override
          public String getValue(ContactInfo object) {
            return object.getLastName();
          }
        };
View Full Code Here

Examples of com.google.gwt.cell.client.EditTextCell

        };
        cellTable.addColumn(imageColumn2, SafeHtmlUtils.fromSafeConstant("<br/>"));
        cellTable.setColumnWidth(imageColumn, "16px");

        // KSession Name
        final EditTextCell textCell = new EditTextCell();
        final Column<ServiceKSessionConfig, String> nameColumn = new Column<ServiceKSessionConfig, String>(textCell) {
            @Override
            public String getValue(final ServiceKSessionConfig object) {
                return object.getName();
            }
        };
        cellTable.addColumn(nameColumn, Constants.INSTANCE.Name());
        nameColumn.setFieldUpdater(new FieldUpdater<ServiceKSessionConfig, String>() {
            public void update(int index, ServiceKSessionConfig object, String value) {
                // Called when the user changes the value.
                if (object.getName().equals(value)) {
                    return;
                }

                if (kbase.getKsession(value) != null) {
                    Window.alert(Constants.INSTANCE.KSessionNameAlreadyExists());
                    textCell.clearViewData(KEY_PROVIDER.getKey(object));
                    dataProvider.flush();
                    dataProvider.refresh();
                    cellTable.redraw();
                } else {
                    final ServiceKSessionConfig updatedKsession = new ServiceKSessionConfig(value, object);
View Full Code Here

Examples of com.google.gwt.cell.client.EditTextCell

        };
        cellTable.addColumn(imageColumn2, SafeHtmlUtils.fromSafeConstant("<br/>"));
        cellTable.setColumnWidth(imageColumn, "16px");

        // KSession Name
        final EditTextCell textCell = new EditTextCell();
        final Column<ServiceKSessionConfig, String> nameColumn = new Column<ServiceKSessionConfig, String>(textCell) {
            @Override
            public String getValue(final ServiceKSessionConfig object) {
                return object.getName();
            }
        };
        cellTable.addColumn(nameColumn, Constants.INSTANCE.Name());
        nameColumn.setFieldUpdater(new FieldUpdater<ServiceKSessionConfig, String>() {
            public void update(int index, ServiceKSessionConfig object, String value) {
                // Called when the user changes the value.
                if (object.getName().equals(value)) {
                    return;
                }

                if (kbase.getKsession(value) != null) {
                    Window.alert(Constants.INSTANCE.KSessionNameAlreadyExists());
                    textCell.clearViewData(KEY_PROVIDER.getKey(object));
                    dataProvider.flush();
                    dataProvider.refresh();
                    cellTable.redraw();
                } else {
                    final ServiceKSessionConfig updatedKsession = new ServiceKSessionConfig(value, object);
View Full Code Here

Examples of com.google.gwt.cell.client.EditTextCell

            @Override
            public String getValue( final EnumRow enumRow ) {
                return "";
            }
        };
        final Column<EnumRow, String> factNameColumn = new Column<EnumRow, String>( new EditTextCell() ) {
            @Override
            public String getValue( final EnumRow enumRow ) {
                return enumRow.getFactName();
            }
        };
        final Column<EnumRow, String> fieldNameColumn = new Column<EnumRow, String>( new EditTextCell() ) {
            @Override
            public String getValue( final EnumRow enumRow ) {
                return enumRow.getFieldName();
            }
        };
        final Column<EnumRow, String> contextColumn = new Column<EnumRow, String>( new EditTextCell() ) {
            @Override
            public String getValue( final EnumRow enumRow ) {
                return enumRow.getContext();
            }
        };
View Full Code Here

Examples of com.google.gwt.cell.client.EditTextCell

        Column<Attribute, String> valueColumn = new Column<Attribute, String>(new CustomEditTextCell()) {
            public String getValue(Attribute attribute) {
                return attribute.getValue();
            }
        };
        final EditTextCell partialScoreCell = new EditTextCell();
        Column<Attribute, String> partialScoreColumn = new Column<Attribute, String>(partialScoreCell) {
            public String getValue(Attribute attribute) {
                return "" + attribute.getPartialScore();
            }
        };

        Column<Attribute, String> reasonCodeColumn = new Column<Attribute, String>(new EditTextCell()) {
            public String getValue(Attribute attribute) {
                return attribute.getReasonCode();
            }
        };

        ActionCell.Delegate<Attribute> delegate = new ActionCell.Delegate<Attribute>() {
            public void execute(Attribute attribute) {
                if (Window.confirm("Remove this attribute?")) {
                    List<Attribute> list = characteristicsAttrMap.get(cGrid).getList();
                    list.remove(attribute);
                    ((EnumDropDown) cGrid.getWidget(2, 0)).setEnabled(list.size() == 0);
                    ((EnumDropDown) cGrid.getWidget(2, 1)).setEnabled(list.size() == 0);
                    ((Button)cGrid.getWidget(0, 3)).setEnabled(list.size() != 2);
                    attributeCellTable.redraw();
                }
            }
        };
        Cell<Attribute> actionCell = new ActionCell<Attribute>("Remove",delegate);
        Column<Attribute, String> actionColumn = new IdentityColumn(actionCell);

        reasonCodeColumn.setFieldUpdater(new FieldUpdater<Attribute, String>() {
            public void update(int index, Attribute object, String value) {
                object.setReasonCode(value);
                attributeCellTable.redraw();
            }
        });
        operatorColumn.setFieldUpdater(new FieldUpdater<Attribute, String>() {
            public void update(int index, Attribute object, String value) {
                object.setOperator(value);
                attributeCellTable.redraw();
            }
        });
        valueColumn.setFieldUpdater(new FieldUpdater<Attribute, String>() {
            public void update(int index, Attribute object, String value) {
                object.setValue(value);
                attributeCellTable.redraw();
            }
        });
        partialScoreColumn.setFieldUpdater(new FieldUpdater<Attribute, String>() {
            public void update(int index, Attribute object, String value) {
                try {
                    double d = Double.parseDouble(value);
                    object.setPartialScore(d);
                } catch (Exception e1) {
                    partialScoreCell.clearViewData(object);
                }
                attributeCellTable.redraw();
            }
        });
        // Add the columns.
View Full Code Here

Examples of com.google.gwt.cell.client.EditTextCell

                attributeCellTable.redraw();
            }
        } );

        //Partial Score column
        final EditTextCell partialScoreCell = new EditTextCell();
        final Column<Attribute, String> partialScoreColumn = new Column<Attribute, String>( partialScoreCell ) {
            public String getValue( final Attribute attribute ) {
                return "" + attribute.getPartialScore();
            }
        };
        partialScoreColumn.setFieldUpdater( new FieldUpdater<Attribute, String>() {
            public void update( int index,
                                Attribute object,
                                String value ) {
                try {
                    double d = Double.parseDouble( value );
                    object.setPartialScore( d );
                } catch ( Exception e1 ) {
                    partialScoreCell.clearViewData( object );
                }
                attributeCellTable.redraw();
            }
        } );

        //Reason Code column
        final Column<Attribute, String> reasonCodeColumn = new Column<Attribute, String>( new EditTextCell() ) {
            public String getValue( final Attribute attribute ) {
                return attribute.getReasonCode();
            }
        };
        reasonCodeColumn.setFieldUpdater( new FieldUpdater<Attribute, String>() {
View Full Code Here

Examples of com.google.gwt.cell.client.EditTextCell

                attributeCellTable.redraw();
            }
        } );

        //Partial Score column
        final EditTextCell partialScoreCell = new EditTextCell();
        final Column<Attribute, String> partialScoreColumn = new Column<Attribute, String>( partialScoreCell ) {
            public String getValue( final Attribute attribute ) {
                return "" + attribute.getPartialScore();
            }
        };
        partialScoreColumn.setFieldUpdater( new FieldUpdater<Attribute, String>() {
            public void update( int index,
                                Attribute object,
                                String value ) {
                try {
                    double d = Double.parseDouble( value );
                    object.setPartialScore( d );
                } catch ( Exception e1 ) {
                    partialScoreCell.clearViewData( object );
                }
                attributeCellTable.redraw();
            }
        } );

        //Reason Code column
        final Column<Attribute, String> reasonCodeColumn = new Column<Attribute, String>( new EditTextCell() ) {
            public String getValue( final Attribute attribute ) {
                return attribute.getReasonCode();
            }
        };
        reasonCodeColumn.setFieldUpdater( new FieldUpdater<Attribute, String>() {
View Full Code Here

Examples of com.google.gwt.cell.client.EditTextCell

   
      

       
      //Columna nombre
        EditTextCell txnombre2 = new EditTextCell();
        Column<ProyectoDTO, String> col_nombre = new Column<ProyectoDTO, String>(txnombre2){
          @Override
          public String getValue(ProyectoDTO object) {
            return object.nombre;
          }
        };
       
       
        col_nombre.setFieldUpdater(new FieldUpdater<ProyectoDTO, String>(){
          @Override
        public void update(int index, ProyectoDTO object, String value) {
          // TODO Auto-generated method stub
          object.nombre = value;
          actualizarNombreProyecto(value)
        }
        });
       
        tablaP.addColumn(col_nombre, constants.nombre());
        tablaP.setColumnWidth(col_nombre, Window.getClientWidth()*.25, Unit.PX);
       

     
       
        //columna id
        EditTextCell txid2 = new EditTextCell();
        Column<ProyectoDTO, String> col_des = new Column<ProyectoDTO, String>(txid2){
          @Override
          public String getValue(ProyectoDTO object) {
            return object.descripcion;
          }
View Full Code Here

Examples of com.google.gwt.cell.client.EditTextCell

        };
        PSeleccion.tabla.addColumn(txnumero, constants.numero());
        PSeleccion.tabla.setColumnWidth(txnumero, 10, Unit.PX);
       
        //Columna nombre
        EditTextCell txnombre = new EditTextCell();
        Column<TareaDTO, String> col_nombre = new Column<TareaDTO, String>(txnombre){
          @Override
          public String getValue(TareaDTO object) {
            return object.nombre;
          }
View Full Code Here

Examples of com.google.gwt.cell.client.EditTextCell

                attributeCellTable.redraw();
            }
        } );

        //Partial Score column
        final EditTextCell partialScoreCell = new EditTextCell();
        final Column<Attribute, String> partialScoreColumn = new Column<Attribute, String>( partialScoreCell ) {
            public String getValue( final Attribute attribute ) {
                return "" + attribute.getPartialScore();
            }
        };
        partialScoreColumn.setFieldUpdater( new FieldUpdater<Attribute, String>() {
            public void update( int index,
                                Attribute object,
                                String value ) {
                try {
                    double d = Double.parseDouble( value );
                    object.setPartialScore( d );
                } catch ( Exception e1 ) {
                    partialScoreCell.clearViewData( object );
                }
                attributeCellTable.redraw();
            }
        } );

        //Reason Code column
        final Column<Attribute, String> reasonCodeColumn = new Column<Attribute, String>( new EditTextCell() ) {
            public String getValue( final Attribute attribute ) {
                return attribute.getReasonCode();
            }
        };
        reasonCodeColumn.setFieldUpdater( new FieldUpdater<Attribute, String>() {
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.