Package com.google.gwt.cell.client.Cell

Examples of com.google.gwt.cell.client.Cell.Context


        if (curColumn == columnCount - 1) {
          tdClasses += lastColumnStyle;
        }

        // Add class names specific to the cell.
        Context context = new Context(i, curColumn, getValueKey(value));
        String cellStyles = column.getCellStyleNames(context, value);
        if (cellStyles != null) {
          tdClasses += " " + cellStyles;
        }
View Full Code Here


    int row = getKeyboardSelectedRow();
    int col = getKeyboardSelectedColumn();
    T value = getVisibleItem(row);
    Object key = getValueKey(value);
    // TODO(pengzhuang): this doesn't support sub row selection?
    Context context = new Context(row + getPageStart(), col, key);
    HasCell<T, ?> column = tableBuilder.getColumn(context, value, elem);
    if (column == null) {
      // The selected element does not contain a Cell.
      return false;
    }
View Full Code Here

      boolean isSelectionHandled =
          cell.handlesSelection()
              || KeyboardSelectionPolicy.BOUND_TO_SELECTION == getKeyboardSelectionPolicy();
      Element cellParent = getCellParent(cellTarget);
      T value = getVisibleItem(indexOnPage);
      Context context = new Context(idx, 0, getValueKey(value));
      CellPreviewEvent<T> previewEvent =
          CellPreviewEvent.fire(this, event, this, context, value, cellIsEditing,
              isSelectionHandled);

      // Fire the event to the cell if the list has not been refreshed.
View Full Code Here

      if (i == keyboardSelectedRow) {
        classesBuilder.append(keyboardSelectedItem);
      }

      SafeHtmlBuilder cellBuilder = new SafeHtmlBuilder();
      Context context = new Context(i, 0, getValueKey(value));
      cell.render(context, value, cellBuilder);
      sb.append(TEMPLATE.div(i, classesBuilder.toString(), cellBuilder.toSafeHtml()));
    }
  }
View Full Code Here

    int row = getKeyboardSelectedRow();
    if (isRowWithinBounds(row)) {
      Element rowElem = getKeyboardSelectedElement();
      Element cellParent = getCellParent(rowElem);
      T value = getVisibleItem(row);
      Context context = new Context(row + getPageStart(), 0, getValueKey(value));
      return cell.resetFocus(context, cellParent, value);
    }
    return false;
  }
View Full Code Here

          text = v.toString();
        }
        cellBuilder.append(Util.isEmptyString(text) ? SafeHtmlUtils.fromTrustedString("&#160;")
            : SafeHtmlUtils.fromString(text));
      } else {
        Context context = new Context(i, 0, store.getKeyProvider().getKey(m));
        cell.render(context, v, cellBuilder);
      }

      appearance.renderItem(sb, cellBuilder.toSafeHtml());
    }
View Full Code Here

        if (isSelected) {
          classesBuilder.append(selectedItem);
        }

        SafeHtmlBuilder cellBuilder = new SafeHtmlBuilder();
        Context context = new Context(i, 0, getValueKey(value));
        cell.render(context, value, cellBuilder);

        // Figure out which image to use.
        SafeHtml image;
        if (isOpen) {
View Full Code Here

    // Select a different value.
    NativeEvent nativeEvent = Document.get().createClickEvent(0, 0, 0, 0, 0,
        false, false, false, false);
    CellPreviewEvent<String> event = new CellPreviewEvent<String>(nativeEvent,
        display, new Context(1, 0, null), "test 1", false, false);
    manager.handleSelectionEvent(event, null, model);
    assertEquals("test 1", model.getSelectedObject());

    // Select the same value.
    manager.handleSelectionEvent(event, null, model);
    assertEquals("test 1", model.getSelectedObject());

    // Ctrl+Select the same value.
    nativeEvent = Document.get().createClickEvent(0, 0, 0, 0, 0, true, false,
        false, true);
    event = new CellPreviewEvent<String>(nativeEvent, display, new Context(1,
        0, null), "test 1", false, false);
    manager.handleSelectionEvent(event, null, model);
    assertNull(model.getSelectedObject());

    // Spacebar a different value.
    nativeEvent = Document.get().createKeyUpEvent(false, false, false, false,
        32);
    event = new CellPreviewEvent<String>(nativeEvent, display, new Context(2,
        0, null), "test 2", false, false);
    manager.handleSelectionEvent(event, null, model);
    assertEquals("test 2", model.getSelectedObject());

    // Spacebar the same value.
View Full Code Here

    // Deselect a different value.
    NativeEvent nativeEvent = Document.get().createClickEvent(0, 0, 0, 0, 0,
        false, false, false, false);
    CellPreviewEvent<String> event = new CellPreviewEvent<String>(nativeEvent,
        display, new Context(1, 0, null), "test 1", false, false);
    manager.handleSelectionEvent(event, SelectAction.DESELECT, model);
    assertEquals("test 0", model.getSelectedObject());

    // Deselect the same value.
    event = new CellPreviewEvent<String>(nativeEvent, display, new Context(0,
        0, null), "test 0", false, false);
    manager.handleSelectionEvent(event, SelectAction.DESELECT, model);
    assertNull(model.getSelectedObject());
  }
View Full Code Here

    model.setSelected("test 0", true);

    NativeEvent nativeEvent = Document.get().createClickEvent(0, 0, 0, 0, 0,
        false, false, false, false);
    CellPreviewEvent<String> event = new CellPreviewEvent<String>(nativeEvent,
        display, new Context(3, 0, null), "test 3", false, false);
    manager.handleSelectionEvent(event, SelectAction.IGNORE, model);
    assertEquals("test 0", model.getSelectedObject());
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.cell.client.Cell.Context

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.