summaryrefslogtreecommitdiffstats
path: root/vaadin-app
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-10-06 10:59:36 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-10-06 10:59:36 +0200
commitcf607e8c6ab4a130f614967375d0004c792f8d95 (patch)
treefc636c5064c4424106aeb8ef832ea9e900066f01 /vaadin-app
parent831fc5b79248be4ea5d42762fa6c3de325cc533f (diff)
downloadskeletons-cf607e8c6ab4a130f614967375d0004c792f8d95.zip
skeletons-cf607e8c6ab4a130f614967375d0004c792f8d95.tar.gz
vaadin-app: MainLayout uses Resources class
Diffstat (limited to 'vaadin-app')
-rw-r--r--vaadin-app/src/ch/asynk/helloworld/MainLayout.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/vaadin-app/src/ch/asynk/helloworld/MainLayout.java b/vaadin-app/src/ch/asynk/helloworld/MainLayout.java
index 0ab997a..e04a7c4 100644
--- a/vaadin-app/src/ch/asynk/helloworld/MainLayout.java
+++ b/vaadin-app/src/ch/asynk/helloworld/MainLayout.java
@@ -1,6 +1,5 @@
package ch.asynk.helloworld;
-
import java.util.Date;
import com.vaadin.terminal.UserError;
@@ -23,8 +22,8 @@ public class MainLayout extends VerticalLayout {
ctx = context;
//
final AbstractComponent ctrlPanel = buildListsPanel();
- ctrlPanel.setWidth(500,UNITS_PIXELS);
- ctrlPanel.setHeight(400,UNITS_PIXELS);
+ ctrlPanel.setWidth(250,UNITS_PIXELS);
+ ctrlPanel.setHeight(300,UNITS_PIXELS);
addComponent(ctrlPanel);
setComponentAlignment(ctrlPanel, Alignment.MIDDLE_CENTER);
//
@@ -40,24 +39,25 @@ public class MainLayout extends VerticalLayout {
Label label = new Label("Hello world");
layout.addComponent(label);
//
- layout.addComponent( new Button("What is the time?", new Button.ClickListener() {
+ Button clockBtn = new Button("What is the time?");
+ layout.addComponent( clockBtn );
+ clockBtn.setIcon(Resources.clockIcon);
+ clockBtn.addListener( new Button.ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
ctx.getApp().notifyError("The time is " + new Date(), "<i>italic</i> <b>bold</b> description");
event.getButton().setComponentError( new UserError("Stop pressing this button !!") );
}
- }));
+ });
///
- Button exceptionButton = new Button("throw an exception");
- layout.addComponent(exceptionButton );
- exceptionButton.addListener( new Button.ClickListener() {
+ layout.addComponent( new Button("throw an exception", new Button.ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
throw new RuntimeException("Wahou !! : exception");
}
- });
+ }));
//
Button nextButton = new Button("next layout");
nextButton.setDescription("Go to next layout");