diff options
author | Marc Englund <marc.englund@itmill.com> | 2007-12-04 07:23:37 +0000 |
---|---|---|
committer | Marc Englund <marc.englund@itmill.com> | 2007-12-04 07:23:37 +0000 |
commit | 69b68fc5c336f6457390b6bff8eb303c27c7919f (patch) | |
tree | 2497ce454e2f2d376d2077a9a78e22c17768e6b6 /src/com/itmill/toolkit/demo/featurebrowser/ButtonExample.java | |
parent | 362efe6fdf7c3a627e3bb7e63c33d21228619e6c (diff) | |
download | vaadin-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.java | 23 |
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 = "<icon>";
- }
- 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() : ""));
}
|