aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/demo/featurebrowser/ButtonExample.java
diff options
context:
space:
mode:
authorMarc Englund <marc.englund@itmill.com>2007-12-04 07:23:37 +0000
committerMarc Englund <marc.englund@itmill.com>2007-12-04 07:23:37 +0000
commit69b68fc5c336f6457390b6bff8eb303c27c7919f (patch)
tree2497ce454e2f2d376d2077a9a78e22c17768e6b6 /src/com/itmill/toolkit/demo/featurebrowser/ButtonExample.java
parent362efe6fdf7c3a627e3bb7e63c33d21228619e6c (diff)
downloadvaadin-framework-69b68fc5c336f6457390b6bff8eb303c27c7919f.tar.gz
vaadin-framework-69b68fc5c336f6457390b6bff8eb303c27c7919f.zip
Status labels -> Notifications.
Etc, etc. svn changeset:3132/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/demo/featurebrowser/ButtonExample.java')
-rw-r--r--src/com/itmill/toolkit/demo/featurebrowser/ButtonExample.java23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/com/itmill/toolkit/demo/featurebrowser/ButtonExample.java b/src/com/itmill/toolkit/demo/featurebrowser/ButtonExample.java
index 2fdcb135ca..b4406da7b4 100644
--- a/src/com/itmill/toolkit/demo/featurebrowser/ButtonExample.java
+++ b/src/com/itmill/toolkit/demo/featurebrowser/ButtonExample.java
@@ -19,8 +19,6 @@ import com.itmill.toolkit.ui.Button.ClickEvent;
public class ButtonExample extends CustomComponent implements
Button.ClickListener {
- Panel status;
-
public ButtonExample() {
OrderedLayout main = new OrderedLayout();
@@ -33,12 +31,10 @@ public class ButtonExample extends CustomComponent implements
Panel basic = new Panel("Basic buttons");
basic.setStyleName(Panel.STYLE_LIGHT);
horiz.addComponent(basic);
- Panel bells = new Panel("+ bells & whistles");
+
+ Panel bells = new Panel("w/ bells & whistles");
bells.setStyleName(Panel.STYLE_LIGHT);
horiz.addComponent(bells);
- status = new Panel("Clicked");
- status.setStyleName(Panel.STYLE_LIGHT);
- horiz.addComponent(status);
Button b = new Button("Basic button");
b.addListener(this);
@@ -127,16 +123,11 @@ public class ButtonExample extends CustomComponent implements
}
public void buttonClick(ClickEvent event) {
- Button clicked = event.getButton();
- String caption = clicked.getCaption();
- if (caption == null) {
- caption = "&lt;icon&gt;";
- }
- status.removeAllComponents();
- Label l = new Label("Clicked: " + caption + "<br/>" + "Value: "
- + clicked.getValue());
- l.setContentMode(Label.CONTENT_XHTML);
- status.addComponent(l);
+ Button b = event.getButton();
+ getWindow().showNotification(
+ "Clicked"
+ + (b instanceof CheckBox ? ", value: "
+ + event.getButton().getValue() : ""));
}