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

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


            // Render the cell and set inner HTML
            SafeHtmlBuilder cellBuilder = new SafeHtmlBuilder();
            if ( !cellData.isOtherwise() ) {
                Coordinate c = cellData.getCoordinate();
                Context context = new Context( c.getRow(),
                                               c.getCol(),
                                               c );
                column.render( context,
                               rowData,
                               cellBuilder );
View Full Code Here


        return columnData;
    }

    @Test
    public void testConstraints() {
        Context context;
        Map<String, String> values;

        //Row 0, Column 0
        context = new Context( 0,
                               0,
                               null );
        values = manager.getCurrentValueMap( context );
        assertNotNull( values );
        assertEquals( 2,
                      values.size() );

        assertTrue( values.containsKey( "sfc0p0" ) );
        assertNotNull( values.get( "sfc0p0" ) );
        assertEquals( "r0c0",
                      values.get( "sfc0p0" ) );

        assertTrue( values.containsKey( "sfc1p0" ) );
        assertNotNull( values.get( "sfc1p0" ) );
        assertEquals( "r0c1",
                      values.get( "sfc1p0" ) );

        //Row 1, Column 0
        context = new Context( 1,
                               0,
                               null );
        values = manager.getCurrentValueMap( context );
        assertNotNull( values );
        assertEquals( 2,
                      values.size() );

        assertTrue( values.containsKey( "sfc0p0" ) );
        assertNotNull( values.get( "sfc0p0" ) );
        assertEquals( "r1c0",
                      values.get( "sfc0p0" ) );

        assertTrue( values.containsKey( "sfc1p0" ) );
        assertNotNull( values.get( "sfc1p0" ) );
        assertEquals( "r1c1",
                      values.get( "sfc1p0" ) );

        //Row 0, Column 1
        context = new Context( 0,
                               1,
                               null );
        values = manager.getCurrentValueMap( context );
        assertNotNull( values );
        assertEquals( 2,
                      values.size() );

        assertTrue( values.containsKey( "sfc0p0" ) );
        assertNotNull( values.get( "sfc0p0" ) );
        assertEquals( "r0c0",
                      values.get( "sfc0p0" ) );

        assertTrue( values.containsKey( "sfc1p0" ) );
        assertNotNull( values.get( "sfc1p0" ) );
        assertEquals( "r0c1",
                      values.get( "sfc1p0" ) );

        //Row 1, Column 1
        context = new Context( 1,
                               1,
                               null );
        values = manager.getCurrentValueMap( context );
        assertNotNull( values );
        assertEquals( 2,
                      values.size() );

        assertTrue( values.containsKey( "sfc0p0" ) );
        assertNotNull( values.get( "sfc0p0" ) );
        assertEquals( "r1c0",
                      values.get( "sfc0p0" ) );

        assertTrue( values.containsKey( "sfc1p0" ) );
        assertNotNull( values.get( "sfc1p0" ) );
        assertEquals( "r1c1",
                      values.get( "sfc1p0" ) );

        //Row 0, Column 2
        context = new Context( 0,
                               2,
                               null );
        values = manager.getCurrentValueMap( context );
        assertNotNull( values );
        assertEquals( 2,
                      values.size() );

        assertTrue( values.containsKey( "sfc0p1" ) );
        assertNotNull( values.get( "sfc0p1" ) );
        assertEquals( "r0c2",
                      values.get( "sfc0p1" ) );

        assertTrue( values.containsKey( "sfc1p1" ) );
        assertNotNull( values.get( "sfc1p1" ) );
        assertEquals( "sfc1p1Value",
                      values.get( "sfc1p1" ) );

        //Row 1, Column 2
        context = new Context( 1,
                               2,
                               null );
        values = manager.getCurrentValueMap( context );
        assertNotNull( values );
        assertEquals( 2,
View Full Code Here

                      values.get( "sfc1p1" ) );
    }

    @Test
    public void testActions() {
        Context context;
        Map<String, String> values;

        //Row 0, Column 6
        context = new Context( 0,
                               6,
                               null );
        values = manager.getCurrentValueMap( context );
        assertNotNull( values );
        assertEquals( 2,
                      values.size() );

        assertTrue( values.containsKey( "AIF0F0" ) );
        assertNotNull( values.get( "AIF0F0" ) );
        assertEquals( "r0c3",
                      values.get( "AIF0F0" ) );

        assertTrue( values.containsKey( "AIF0F1" ) );
        assertNotNull( values.get( "AIF0F1" ) );
        assertEquals( "r0c4",
                      values.get( "AIF0F1" ) );

        //Row 1, Column 6
        context = new Context( 1,
                               6,
                               null );
        values = manager.getCurrentValueMap( context );
        assertNotNull( values );
        assertEquals( 2,
                      values.size() );

        assertTrue( values.containsKey( "AIF0F0" ) );
        assertNotNull( values.get( "AIF0F0" ) );
        assertEquals( "r1c3",
                      values.get( "AIF0F0" ) );

        assertTrue( values.containsKey( "AIF0F1" ) );
        assertNotNull( values.get( "AIF0F1" ) );
        assertEquals( "r1c4",
                      values.get( "AIF0F1" ) );

        //Row 0, Column 7
        context = new Context( 0,
                               7,
                               null );
        values = manager.getCurrentValueMap( context );
        assertNotNull( values );
        assertEquals( 2,
                      values.size() );

        assertTrue( values.containsKey( "AIF0F0" ) );
        assertNotNull( values.get( "AIF0F0" ) );
        assertEquals( "r0c3",
                      values.get( "AIF0F0" ) );

        assertTrue( values.containsKey( "AIF0F1" ) );
        assertNotNull( values.get( "AIF0F1" ) );
        assertEquals( "r0c4",
                      values.get( "AIF0F1" ) );

        //Row 1, Column 7
        context = new Context( 1,
                               7,
                               null );
        values = manager.getCurrentValueMap( context );
        assertNotNull( values );
        assertEquals( 2,
View Full Code Here

    }

    @Test
    public void testConstraintsEnumDependencies() {

        Context context;
        Set<Integer> columns;

        context = new Context( 0,
                               3,
                               null );
        columns = manager.getDependentColumnIndexes( context );
        assertNotNull( columns );
        assertEquals( 2,
                      columns.size() );
        assertTrue( columns.contains( new Integer( 4 ) ) );
        assertTrue( columns.contains( new Integer( 5 ) ) );

        context = new Context( 0,
                               4,
                               null );
        columns = manager.getDependentColumnIndexes( context );
        assertNotNull( columns );
        assertEquals( 1,
View Full Code Here

    }

    @Test
    public void testActionsEnumDependencies() {

        Context context;
        Set<Integer> columns;

        context = new Context( 0,
                               8,
                               null );
        columns = manager.getDependentColumnIndexes( context );
        assertNotNull( columns );
        assertEquals( 2,
                      columns.size() );
        assertTrue( columns.contains( new Integer( 9 ) ) );
        assertTrue( columns.contains( new Integer( 10 ) ) );

        context = new Context( 0,
                               9,
                               null );
        columns = manager.getDependentColumnIndexes( context );
        assertNotNull( columns );
        assertEquals( 1,
View Full Code Here

        Cell<CellValue< ? extends Comparable< ? >>> cellWidget = columns.get( eventPhysicalCoordinate.getCol() ).getCell();

        // Implementations of AbstractCell aren't forced to initialise consumed events
        Set<String> consumedEvents = cellWidget.getConsumedEvents();
        if ( consumedEvents != null && consumedEvents.contains( eventType ) ) {
            Context context = new Context( eventPhysicalCoordinate.getRow(),
                                           eventPhysicalCoordinate.getCol(),
                                           eventPhysicalCoordinate );

            //The element containing the cell's HTML is nested inside two DIVs
            Element parent = eventTableCell.getFirstChildElement().getFirstChildElement();
View Full Code Here

            // Render the cell and set inner HTML
            SafeHtmlBuilder cellBuilder = new SafeHtmlBuilder();
            if ( !cellData.isOtherwise() ) {
                Coordinate c = cellData.getCoordinate();
                Context context = new Context( c.getRow(),
                                               c.getCol(),
                                               c );
                column.render( context,
                               rowData,
                               cellBuilder );
View Full Code Here

      // Get the cell parent before doing selection in case the list is redrawn.
      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);
      if (isClick && !cellIsEditing && !isSelectionHandled) {
        doSelection(event, value, indexOnPage);
      }
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);

      if (i == keyboardSelectedRow) {
        // This is the focused item.
        if (isFocused) {
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

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.