blob: 6cd552b6b22fb01a945d96a7e9b4d646ed8ab59e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.terminal.UserError;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.OrderedLayout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
public class Ticket1966_3 extends Application {
@Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
w.setLayout(layout);
createUI(layout);
}
private void createUI(GridLayout layout) {
OrderedLayout ol = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL);
Panel p = new Panel(ol);
p.setWidth("300px");
p.setHeight("300px");
p.getLayout().setSizeFull();
TextField tf = new TextField("Long caption, longer than 100 pixels");
tf.setWidth("100px");
ol.addComponent(tf);
ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT,
OrderedLayout.ALIGNMENT_TOP);
tf = new TextField("Short caption");
tf.setWidth("100px");
tf.setComponentError(new UserError("error message"));
ol.addComponent(tf);
ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT,
OrderedLayout.ALIGNMENT_TOP);
tf = new TextField("Short caption");
tf.setComponentError(new UserError("error message"));
tf.setIcon(new ThemeResource("icons/16/calendar.png"));
tf.setWidth("100px");
tf.setComponentError(new UserError("error message"));
ol.addComponent(tf);
ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT,
OrderedLayout.ALIGNMENT_TOP);
tf = new TextField();
tf.setValue("No caption");
tf.setWidth("100px");
ol.addComponent(tf);
ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT,
OrderedLayout.ALIGNMENT_TOP);
layout.addComponent(p);
}
}
|