1. #1
    Sencha User
    Join Date
    Nov 2007
    Posts
    35
    Vote Rating
    0
    albertogiantin is on a distinguished road

      0  

    Default Generic NumberCell

    Generic NumberCell


    Hi all,
    I can't understand why NumberCell extends the typed class AbstractCell<Number>?
    Would not be better if the class were built in this way?

    Code:
    public class NumberCell<T extends Number> extends AbstractCell<T> {
    ...
    With current implementation of NumberCell configuring ColumnConfig like this:

    Code:
    		ColumnConfig<CPP, Long> cpp2 = new ColumnConfig<CPP, Long>(props.cpp2(), 100, constants.fairValue());
    		cpp2.setCell(new NumberCell(cnfmt));
    I get this error: The method setCell(Cell<Long>) in the type ColumnConfig<CPP,Long> is not applicable for the arguments (NumberCell) because the field cpp2 is of type Long.

    The other hand with the implementation of the above, I can write something like:

    Code:
    		ColumnConfig<CPP, Long> cpp2 = new ColumnConfig<CPP, Long>(props.cpp2(), 100, constants.fairValue());
    		cpp2.setCell(new NumberCell<Long>(cnfmt));
    Can anyone tell me if I'm doing something wrong?

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,640
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    It is that way:
    Code:
    package com.sencha.gxt.cell.core.client;
    
    //...
    
    public class NumberCell<N extends Number> extends AbstractCell<N> {
    I think you might be looking at the GWT NumberCell implementation, which does restrict you to Number:
    Code:
    package com.google.gwt.cell.client;
    
    //...
    
    /**
     * A {@link Cell} used to render formatted numbers.
     */
    public class NumberCell extends AbstractCell<Number> {

  3. #3
    Sencha User
    Join Date
    Nov 2007
    Posts
    35
    Vote Rating
    0
    albertogiantin is on a distinguished road

      0  

    Default


    You're right, sorry for this oversight.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar