I need to make the column headers of my celltable to do something on right click.
I implemented a header which uses by now a clickabletextcell, but can be anything.
here is how I declare my celltable so far:
Header header = new Header(new ClickableTextCell()) {
@Override
public String getValue() {
return actual.getCaption();
}
};
TextColumn<ObjetoDato> columna = new TextColumn<ObjetoDato>() {
@Override
public String getValue(ObjetoDato origen) {
return origen.getValor(actual.getNombreCampo());
}
};
columna.setSortable(true);
sortHandler.setComparator(columna, new Comparator<ObjetoDato>() {
@Override
public int compare(ObjetoDato o1, ObjetoDato o2) {
return o1.getValor(actual.getNombreCampo()).compareTo(o2.getValor(actual.getNombreCampo()));
}
});
table.addColumn(columna,header );