Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

TreeAction.java 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client.ui;
  5. /**
  6. * This class is used for "row actions" in VTree and ITable
  7. */
  8. public class TreeAction extends Action {
  9. String targetKey = "";
  10. String actionKey = "";
  11. public TreeAction(ActionOwner owner) {
  12. super(owner);
  13. }
  14. public TreeAction(ActionOwner owner, String target, String action) {
  15. this(owner);
  16. targetKey = target;
  17. actionKey = action;
  18. }
  19. /**
  20. * Sends message to server that this action has been fired. Messages are
  21. * "standard" Toolkit messages whose value is comma separated pair of
  22. * targetKey (row, treeNod ...) and actions id.
  23. *
  24. * Variablename is always "action".
  25. *
  26. * Actions are always sent immediatedly to server.
  27. */
  28. @Override
  29. public void execute() {
  30. owner.getClient().updateVariable(owner.getPaintableId(), "action",
  31. targetKey + "," + actionKey, true);
  32. owner.getClient().getContextMenu().hide();
  33. }
  34. public String getActionKey() {
  35. return actionKey;
  36. }
  37. public void setActionKey(String actionKey) {
  38. this.actionKey = actionKey;
  39. }
  40. public String getTargetKey() {
  41. return targetKey;
  42. }
  43. public void setTargetKey(String targetKey) {
  44. this.targetKey = targetKey;
  45. }
  46. }