You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ActionsWithoutKeyCode.java 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package com.vaadin.tests.actions;
  2. import com.vaadin.event.Action;
  3. import com.vaadin.server.VaadinRequest;
  4. import com.vaadin.tests.components.AbstractTestUIWithLog;
  5. import com.vaadin.v7.ui.TextField;
  6. @SuppressWarnings("serial")
  7. public class ActionsWithoutKeyCode extends AbstractTestUIWithLog {
  8. @Override
  9. protected void setup(VaadinRequest request) {
  10. TextField tf = new TextField();
  11. tf.setWidth("100%");
  12. tf.setInputPrompt(
  13. "Enter text with å,ä or ä or press windows key while textfield is focused");
  14. addComponent(tf);
  15. addActionHandler(new Action.Handler() {
  16. private Action[] actions;
  17. {
  18. actions = new Action[] { new Action("test1") };
  19. }
  20. @Override
  21. public Action[] getActions(Object target, Object sender) {
  22. return actions;
  23. }
  24. @Override
  25. public void handleAction(Action action, Object sender,
  26. Object target) {
  27. log("action " + action.getCaption() + " triggered by "
  28. + sender.getClass().getSimpleName() + " on "
  29. + target.getClass().getSimpleName());
  30. }
  31. });
  32. }
  33. }