summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/event
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2012-11-22 09:24:22 +0000
committerJohn Ahlroos <john@vaadin.com>2012-11-23 17:09:35 +0200
commit308d0451d5f98e207ff9d031da014304e422894d (patch)
tree0f979fddac16c8855cedce88748feae498ef16b3 /server/src/com/vaadin/event
parent3aa137c3aff923b5e9f0b0714a595f29165e423a (diff)
downloadvaadin-framework-308d0451d5f98e207ff9d031da014304e422894d.tar.gz
vaadin-framework-308d0451d5f98e207ff9d031da014304e422894d.zip
Revert "Merged shortcut action fix from 6.8 (#8484)"
This reverts commit a003c8724c1f719e3a9f3ab876396a180b19cae1 Change-Id: Ie73b6f0455a9f8ba1ed5a8cee7573ae998a67b17
Diffstat (limited to 'server/src/com/vaadin/event')
-rw-r--r--server/src/com/vaadin/event/ActionManager.java30
-rw-r--r--server/src/com/vaadin/event/ShortcutAction.java45
2 files changed, 6 insertions, 69 deletions
diff --git a/server/src/com/vaadin/event/ActionManager.java b/server/src/com/vaadin/event/ActionManager.java
index 50bb2f8dad..b644bb7422 100644
--- a/server/src/com/vaadin/event/ActionManager.java
+++ b/server/src/com/vaadin/event/ActionManager.java
@@ -24,7 +24,6 @@ import com.vaadin.server.KeyMapper;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
import com.vaadin.server.VariableOwner;
-import com.vaadin.shared.ui.ShortCutConstants;
import com.vaadin.ui.Component;
/**
@@ -188,28 +187,15 @@ public class ActionManager implements Action.Container, Action.Handler,
}
if (a instanceof ShortcutAction) {
final ShortcutAction sa = (ShortcutAction) a;
- paintTarget.addAttribute(
- ShortCutConstants.ACTION_SHORTCUT_KEY_ATTRIBUTE,
- sa.getKeyCode());
+ paintTarget.addAttribute("kc", sa.getKeyCode());
+
final int[] modifiers = sa.getModifiers();
if (modifiers != null) {
final String[] smodifiers = new String[modifiers.length];
for (int i = 0; i < modifiers.length; i++) {
smodifiers[i] = String.valueOf(modifiers[i]);
}
- paintTarget
- .addAttribute(
- ShortCutConstants.ACTION_MODIFIER_KEYS_ATTRIBUTE,
- smodifiers);
- }
- if (sa.getTarget() != null) {
- paintTarget.addAttribute(
- ShortCutConstants.ACTION_TARGET_ATTRIBUTE,
- sa.getTarget());
- paintTarget
- .addAttribute(
- ShortCutConstants.ACTION_TARGET_ACTION_ATTRIBUTE,
- sa.getTargetAction());
+ paintTarget.addAttribute("mk", smodifiers);
}
}
paintTarget.endTag("action");
@@ -227,14 +213,10 @@ public class ActionManager implements Action.Container, Action.Handler,
}
public void handleActions(Map<String, Object> variables, Container sender) {
- if (variables
- .containsKey(ShortCutConstants.ACTION_TARGET_ACTION_VARIABLE)
- && actionMapper != null) {
- final String key = (String) variables
- .get(ShortCutConstants.ACTION_TARGET_ACTION_VARIABLE);
+ if (variables.containsKey("action") && actionMapper != null) {
+ final String key = (String) variables.get("action");
final Action action = actionMapper.get(key);
- final Object target = variables
- .get(ShortCutConstants.ACTION_TARGET_VARIABLE);
+ final Object target = variables.get("actiontarget");
if (action != null) {
handleAction(action, sender, target);
}
diff --git a/server/src/com/vaadin/event/ShortcutAction.java b/server/src/com/vaadin/event/ShortcutAction.java
index 4583b04bf9..b1d14b15fe 100644
--- a/server/src/com/vaadin/event/ShortcutAction.java
+++ b/server/src/com/vaadin/event/ShortcutAction.java
@@ -21,7 +21,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.vaadin.server.Resource;
-import com.vaadin.ui.Component;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Window;
@@ -58,10 +57,6 @@ public class ShortcutAction extends Action {
private final int[] modifiers;
- private Component target;
-
- private String targetAction;
-
/**
* Creates a shortcut that reacts to the given {@link KeyCode} and
* (optionally) {@link ModifierKey}s. <br/>
@@ -242,46 +237,6 @@ public class ShortcutAction extends Action {
}
/**
- * Set the target for the shortcut action. If the target widget on the
- * client side implements ShortcutActionTarget it will be notified of the
- * action before the action is communicated to the server side
- *
- * @param target
- * The component which will be thet target of the action
- */
- public void setTarget(Component target) {
- this.target = target;
- }
-
- /**
- * Get the target of the shortcut action
- */
- public Component getTarget() {
- return target;
- }
-
- /**
- * Get the action string that is given to the ShortcutActionTarget on the
- * client side
- *
- * @return
- */
- public String getTargetAction() {
- return targetAction;
- }
-
- /**
- * Set the action string that is give to the ShortcutActionTarget on the
- * client side
- *
- * @param targetAction
- * The target action string
- */
- public void setTargetAction(String targetAction) {
- this.targetAction = targetAction;
- }
-
- /**
* Key codes that can be used for shortcuts
*
*/