Package com.google.gwt.cell.client

Examples of com.google.gwt.cell.client.TextInputCell$Template


    // Create a CellTable with a key provider.
    final CellTable<Contact> table = new CellTable<Contact>(KEY_PROVIDER);
    table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);

    // Add a text input column to edit the name.
    final TextInputCell nameCell = new TextInputCell();
    Column<Contact, String> nameColumn = new Column<Contact, String>(nameCell) {
      @Override
      public String getValue(Contact object) {
        return object.name;
      }
    };
    table.addColumn(nameColumn, "Name");

    // Add a field updater to be notified when the user enters a new name.
    nameColumn.setFieldUpdater(new FieldUpdater<Contact, String>() {
      @Override
      public void update(int index, Contact object, String value) {
        // Validate the data.
        if (value.length() < 3) {
          Window.alert("Names must be at least three characters long.");

          /*
           * Clear the view data. The view data contains the pending change and
           * allows the table to render with the pending value until the data is
           * committed. If the data is committed into the object, the view data
           * is automatically cleared out. If the data is not committed because
           * it is invalid, you must delete.
           */
          nameCell.clearViewData(KEY_PROVIDER.getKey(object));

          // Redraw the table.
          table.redraw();
          return;
        }
View Full Code Here


  public void onModuleLoad() {
    // Create a CellTable with a key provider.
    final CellTable<Contact> table = new CellTable<Contact>(KEY_PROVIDER);

    // Add a text input column to edit the name.
    final TextInputCell nameCell = new TextInputCell();
    Column<Contact, String> nameColumn = new Column<Contact, String>(nameCell) {
      @Override
      public String getValue(Contact object) {
        // Return the name as the value of this column.
        return object.name;
View Full Code Here

  private static final List<String> DAYS = Arrays.asList("Sunday", "Monday",
      "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");

  public void onModuleLoad() {
    // Create a cell that will interact with a value updater.
    TextInputCell inputCell = new TextInputCell();

    // Create a CellList that uses the cell.
    CellList<String> cellList = new CellList<String>(inputCell);

    // Create a value updater that will be called when the value in a cell
View Full Code Here

   * @author Pal Hargitai
   */
  public class BoodschapNaamColumn extends Column<Boodschap.Builder, String> {
    /** Default constructor. */
    public BoodschapNaamColumn() {
      super(new TextInputCell());
      setFieldUpdater(new BoodschapNaamUpdate());
    }
View Full Code Here

   * @author Pal Hargitai
   */
  public class BoodschapHoeveelheidColumn extends Column<Boodschap.Builder, String> {
    /** Default constructor. */
    public BoodschapHoeveelheidColumn() {
      super(new TextInputCell());
      setFieldUpdater(new BoodschapHoeveelheidUpdate());
    }
View Full Code Here

        // add Name column
        Column<Property, String> nameCol = null;

        if (options == null) {
            nameCol = new Column<Property, String>(new TextInputCell()) {
                @Override
                public String getValue(Property object) {
                    return object.getName();
                }
            };
        }
        else {
            nameCol = new Column<Property, String>(new SelectionCell(options)) {
                @Override
                public String getValue(Property object) {
                    return object.getName();
                }
            };
        }

        // set event for updating value
        nameCol.setFieldUpdater(new FieldUpdater<Property, String>() {
            @Override
            public void update(int index, Property object, String value) {
                object.setName(value);
            }
        });
        table.addColumn(nameCol, colname1);

        // Add Value column
        Column<Property, String> valueCol = new Column<Property, String>(new TextInputCell()) {
            @Override
            public String getValue(Property object) {
                return object.getValue();
            }
        };
View Full Code Here

        // Add Name column
        Column<String, String> argCol = null;

        // when editText is used for name column

        argCol = new Column<String, String>(new TextInputCell()) {
            @Override
            public String getValue(String object) {
                return object;
            }
        };
View Full Code Here

        };

        table.addColumn(label1Col);

        // Add Column for 1st parameter of delete/mkdir/chmod/move/touchz
        Column<FSActionData, String> param1Col = new Column<FSActionData, String>(new TextInputCell()) {
            @Override
            public String getValue(FSActionData object) {
                String op = object.getOp();
                if (op.equals("delete") || op.equals("mkdir") || op.equals("chmod") || op.equals("touchz")) {
                    if (object.getParams().containsKey("path") && object.getParams().get("path") != null)
View Full Code Here

        return result;
    }
   
    @Test
    public void testSimple() {
        Template t = new Template("This is a test @[foo]\n@[bar]");
        Assert.assertEquals("This is a test FOO\nBAR", t.eval(env(
                "foo", "FOO",
                "bar", "BAR")));
    }
View Full Code Here

                "bar", "BAR")));
    }
   
    @Test
    public void testJustPlaceholder() {
        Template t = new Template("@[foo]");
        Assert.assertEquals("FOO", t.eval(env(
                "foo", "FOO")));
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.cell.client.TextInputCell$Template

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.