aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2007-07-11 11:43:12 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2007-07-11 11:43:12 +0000
commit97c496ed42b272fe2a15fe22619de50357d1ca7a (patch)
treed2c1fd6ec622b3f6e281fc72ee0cad614e6905c7 /src
parentbf22602607bc28cfb665855b2a707a44c2cc4470 (diff)
downloadvaadin-framework-97c496ed42b272fe2a15fe22619de50357d1ca7a.tar.gz
vaadin-framework-97c496ed42b272fe2a15fe22619de50357d1ca7a.zip
committing forgotten class
svn changeset:1841/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/ITreeAction.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITreeAction.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITreeAction.java
new file mode 100644
index 0000000000..dd8008da15
--- /dev/null
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITreeAction.java
@@ -0,0 +1,65 @@
+package com.itmill.toolkit.terminal.gwt.client.ui;
+
+
+/**
+ * This class is used for "row actions" in ITree and ITable
+ */
+public class ITreeAction extends IAction {
+
+ String targetKey = "";
+ String actionKey = "";
+
+ public ITreeAction(IActionOwner owner) {
+ super(owner);
+ }
+
+ public ITreeAction(IActionOwner owner, String target, String action) {
+ this(owner);
+ this.targetKey = target;
+ this.actionKey = action;
+ }
+
+
+ /**
+ * Sends message to server that this action has been fired.
+ * Messages are "standard" Toolkit messages whose value is comma
+ * separated pair of targetKey (row, treeNod ...) and actions id.
+ *
+ * Variablename is always "action".
+ *
+ * Actions are always sent immediatedly to server.
+ */
+ public void execute() {
+ owner.getClient().updateVariable(
+ owner.getPaintableId(),
+ "action",
+ targetKey + "," + actionKey,
+ true);
+ owner.getClient().getContextMenu().hide();
+ }
+
+ public String getActionKey() {
+ return actionKey;
+ }
+
+ public void setActionKey(String actionKey) {
+ this.actionKey = actionKey;
+ }
+
+ public String getTargetKey() {
+ return targetKey;
+ }
+
+ public void setTargetKey(String targetKey) {
+ this.targetKey = targetKey;
+ }
+
+ public String getHTML() {
+ StringBuffer sb = new StringBuffer();
+ if(iconUrl != null) {
+ sb.append("<img src=\""+iconUrl+"\" alt=\"icon\" />");
+ }
+ sb.append(caption);
+ return sb.toString();
+ }
+}