]> source.dussan.org Git - vaadin-framework.git/commitdiff
icons for trees and tables context menus, added helper div for theme building, simple...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 1 Oct 2007 08:41:52 +0000 (08:41 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 1 Oct 2007 08:41:52 +0000 (08:41 +0000)
svn changeset:2399/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/Action.java
src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
src/com/itmill/toolkit/terminal/gwt/client/ui/ITree.java
src/com/itmill/toolkit/terminal/gwt/client/ui/TreeAction.java
src/com/itmill/toolkit/terminal/gwt/public/default/common/common.css

index 8e0dbbeeb5660a7b5f1704352e4dc06bcb539fb8..dce4342fbee0cc7c55663285cf8b702ba7df844f 100644 (file)
@@ -25,11 +25,12 @@ public abstract class Action implements Command {
 
        public String getHTML() {
                StringBuffer sb = new StringBuffer();
+               sb.append("<div>");
                if (getIconUrl() != null) {
                        sb.append("<img src=\"" + getIconUrl() + "\" alt=\"icon\" />");
                }
-
                sb.append(getCaption());
+               sb.append("</div>");
                return sb.toString();
        }
 
@@ -44,6 +45,10 @@ public abstract class Action implements Command {
        public String getIconUrl() {
                return iconUrl;
        }
+
+       public void setIconUrl(String url) {
+               iconUrl = url;
+       }
 }
 
 /**
index 0c75f03a248b0cd0716d1e54d3934e6fcb7d46b3..17286bbdf9deafc9eddf323f01c458340c8b6842 100644 (file)
@@ -1824,6 +1824,7 @@ public class IScrollTable extends Composite implements Table, ScrollListener {
                                        TreeAction a = new TreeAction(this, String.valueOf(rowKey),
                                                        actionKey);
                                        a.setCaption(getActionCaption(actionKey));
+                                       a.setIconUrl(getActionIcon(actionKey));
                                        actions[i] = a;
                                }
                                return actions;
index 04b220e69d9c7e57fc99e73b5de573576750090a..e8411096d79cbe7e67e70d28a1d08227718d19c5 100644 (file)
@@ -241,6 +241,7 @@ public class ITree extends Tree implements Paintable {
                                String actionKey = actionKeys[i];
                                TreeAction a = new TreeAction(this, String.valueOf(key), actionKey);
                                a.setCaption(getActionCaption(actionKey));
+                               a.setIconUrl(getActionIcon(actionKey));
                                actions[i] = a;
                        }
                        return actions;
index 1d630893a2442ddc0e69b84647ddab4bbee4bfc6..04e2aa00cf25973bc5d6b43c63ddc85d07760f82 100644 (file)
@@ -53,13 +53,4 @@ public class TreeAction extends Action {
        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();
-       }
 }
index 64dc530a007b4013772176ded16c996535476258..593815b23a2d7a1511c7da6871f8caa976b54c1e 100644 (file)
@@ -21,14 +21,57 @@ select {
        filter: Alpha(opacity=30);\r
 }\r
 \r
-.i-contextmenu {\r
-       background: #fff;       \r
-       border: #000;\r
-}\r
+.i-contextmenu {
+       background: #e9eced;
+       font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif;
+       background-color: #f6f7f7;
+       color: #464f52;
+       font-size: 12px;
+       line-height: 18px;
+}
+
+.i-contextmenu .gwt-MenuBar {
+       border-right: 1px solid #d0d4d5;
+       border-bottom: 2px solid #d0d4d5;
+       border-top: 1px solid #d0d4d5;
+       border-left: 2px solid #d0d4d5;
+}
+
+.i-contextmenu .gwt-MenuItem {
+       border-bottom: 1px solid #e6e9e9; 
+       padding:1px;
+       cursor: pointer;
+       vertical-align: middle;
+}
+
+.i-contextmenu .gwt-MenuItem div {
+       border: 1px solid #f6f7f7;
+       padding: 2px 10px 2px 5px;
+       cursor: pointer;
+       vertical-align: middle;
+}
+
+.i-contextmenu .gwt-MenuItem-selected {
+       background: #e6e9e9;
+}
+.i-contextmenu .gwt-MenuItem-selected div {
+       border: 1px solid #b6bbbc;
+}
+
+.i-contextmenu, table {
+       border-collapse:collapse;
+       margin:0;
+       padding:0;
+}
+.i-contextmenu .gwt-MenuItem img {
+       margin-right: 10px;
+       vertical-align: middle;
+}
 \r
 /* Provide some extra whitespace for wrapped elements\r
    (these elements usuallly need the extra space, since \r
    they aren't even handling their own caption) */\r
 .i-captionwrapper {\r
        margin: 0.3em 0 0 0;\r
-}
\ No newline at end of file
+}
+