I have a similar problem

In my project it seams that i can't use treeset

i get this error: [ERROR] Type 'org.teepee.gui.client.DataTablePatch'
was not serializable and has no concrete serializable subtypes

DataTablePatch, the class i want to send via rpc, is:

import java.util.TreeSet;

public class DataTablePatch implements
com.google.gwt.user.client.rpc.IsSerializable{

    private TreeSet<DataRow> rowsSet = new TreeSet<DataRow>();

    public TreeSet<DataRow> getRowsSet() {
        return rowsSet;
    }

    public void add(DataRow row) {
        System.out.println("AddRow DataTable patch, sto aggiungendo la
riga con id " + row.getId());
        this.rowsSet.add(row);
    }
}


DataRow class is

public class DataRow implements Comparable,
com.google.gwt.user.client.rpc.IsSerializable {
    private byte status;
    private List<ValueWrapper> data = new ArrayList<ValueWrapper>();
    private int id; //l'id sarà univo, sempre lo stesso in tutta la
sessione, sarà l'indice dell'array in cui la row sarà salvata

    public DataRow(){}

    public DataRow(List<ValueWrapper> values) {
        this.data = values;
    }

    public DataRow(DataRow dr) {
        this.data = dr.getData();
        this.id = dr.getId();
        this.status = dr.status;
    }

    public boolean equals(Object o) {
        if (o instanceof DataRow) {
            DataRow dt = (DataRow) o;
            return (this.id == dt.getId());
        } else return false;
    }

    public int compareTo(Object o) {
        DataRow dt = (DataRow) o;
        int id1 = this.getId();
        int id2 = dt.getId();
        if (id1 < id2) return -1;
        if (id1 == id2) return 0;
        else return 1;
    }

    public void deleteData() {
        this.data = new ArrayList<ValueWrapper>(0);
    }

    public List<ValueWrapper> getData() {
        return data;
    }

    public void setData(List<ValueWrapper> lista) {
        this.data = lista;
    }

    public void setOnlyDeleted() {
        status = Gui.deletedMask;
    }

    public byte getStatus(){
        return this.status;
    }

    public void setSatus(byte value){
        this.status = value;
    }

    public int getId() {
        return id;
    }

    public void setId(int newid) {
        id = newid;
    }

    public void setDeleted(boolean b) {
        status = (byte) (b ? status | Gui.deletedMask : status &
~Gui.deletedMask);
    }

    public boolean isDeleted() {
        return (status & Gui.deletedMask) != 0;
    }

    public boolean isModified() {
        return (status != 0);
    }

    public void setEdited(boolean b) {
        status = (byte) (b ? status | Gui.editedMask : status &
~Gui.editedMask);
    }

    public boolean isEdited() {
        return (status & Gui.editedMask) != 0;
    }

    public void setCreated(boolean b) {
        status = (byte) (b ? status | Gui.createdMask : status &
~Gui.createdMask);
    }

    public boolean isCreated() {
        return (status & Gui.createdMask) != 0;
    }

    public void setMoved(boolean b) {
        status = (byte) (b ? status | Gui.movedMask : status &
~Gui.movedMask);
    }

    public boolean isMoved() {
        return (status & Gui.movedMask) != 0;
    }

    public void setGhost() {
        setGhost(true);
    }

    public void setGhost(boolean state) {
        status = (state ? Gui.ghostMask : Gui.editedMask);
    }

    public boolean isGhost() {
        return (status & Gui.ghostMask) != 0;
    }

    public boolean resetStatus() {
        if (!this.isGhost()) {
            this.status = 0;
            return true;
        } else {
            this.status = Gui.ghostMask;
            return false;
        }
    }

    public boolean isOnlyMoved() {
        Byte b = status;
        return (b.compareTo(Gui.movedMask) == 0);
    }


}



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to