Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. public static Column<vTO, vTO>
  2. createReissueButtonColumn(String columnName) {
  3. ActionCell<VolunteerTO> reListCell = new ActionCell<VTO>("Reissue",
  4. new ActionCell.Delegate<VTO>() {
  5. @Override
  6. public void execute(VTO object) {
  7. // code to be executed
  8. }
  9. })
  10. {
  11. @Override
  12. public void render(Cell.Context context,VTO value,SafeHtmlBuilder sb) {
  13. if(null != value.getStatus() && !"".equalsIgnoreCase(value.getStatus())) {
  14. super.render(context,value,sb);
  15. }
  16. }
  17. };
  18.  
  19. Column<VTO, VTO> reListColumn = new Column<VTO, VTO>(reListCell) {
  20. @Override
  21. public VTO getValue(VTO object) {
  22. return object;
  23. }
  24. };
  25.  
  26. reListColumn.setDataStoreName(columnName);
  27. reListColumn.setSortable(false);
  28. return reListColumn;
  29. }
  30.  
  31. unitTable.addCellPreviewHandler(new Handler<Unit>() {
  32. @Override
  33. public void onCellPreview(CellPreviewEvent<Unit> event) {
  34. if ("click".equals(event.getNativeEvent().getType())) {
  35. if (event.getColumn() != myTable.getColumnIndex(reListColumn)) {
  36. // Check some condition. If necessary:
  37. event.setCanceled(true);
  38. }
  39. }
  40. }
  41. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement