use of com.vaadin.v7.ui.Label in project CodenameOne by codenameone.
the class RadioButtonLeadComponentTest3105 method start.
public void start() {
if (current != null) {
current.show();
return;
}
Form hi = new Form("Lead component breaks ComponentGroup", BoxLayout.y());
ButtonGroup group = new ButtonGroup();
ComponentGroup cgroup = new ComponentGroup();
Label editFieldLabel = new Label("");
Container visibleField = BorderLayout.centerCenterEastWest(cgroup, editFieldLabel, null);
RadioButton r1 = new RadioButton("R1");
group.add(r1);
cgroup.add(r1);
RadioButton r2 = new RadioButton("R2");
group.add(r2);
cgroup.add(r2);
hi.add(visibleField);
ButtonGroup group2 = new ButtonGroup();
ComponentGroup cgroup2 = new ComponentGroup();
Label editFieldLabel2 = new Label("EDIT2");
Container visibleField2 = BorderLayout.centerCenterEastWest(cgroup2, editFieldLabel2, null);
RadioButton r3 = new RadioButton("R3");
group2.add(r3);
cgroup2.add(r3);
RadioButton r4 = new RadioButton("R4");
group2.add(r4);
cgroup2.add(r4);
hi.add(visibleField2);
// What causes the problem:
cgroup2.setBlockLead(true);
// making the ComponentGroup lead makes it impossible to select the radio buttons
visibleField2.setLeadComponent(cgroup2);
hi.show();
}
use of com.vaadin.v7.ui.Label in project CodenameOne by codenameone.
the class SwipableContainerTest2766 method start.
public void start() {
// TEST: SWIPEABLE CONTAINER ALSO SWIPES UNDERLYING CONTAINER AS WELL
Form hi = new Form("Welcome", new BorderLayout());
Container list = new Container(BoxLayout.y());
for (int i = 0; i < 20; i++) {
SwipeableContainer swip = new SwipeableContainer(null, new Label("SWIPE"), new Label("ListElement " + i + " + a lot of fill text to make the element span over several lines so the dragging of the underlying Swipeable is normally noticeable"));
list.add(swip);
}
list.setScrollableY(true);
Container cont = hi.getContentPane();
cont.add(BorderLayout.CENTER, list);
SwipeableContainer swip = new SwipeableContainer(null, new SpanLabel("SOUTHSWIPE"), new SpanLabel("SOUTH CONTAINER"));
cont.add(BorderLayout.SOUTH, swip);
hi.show();
}
use of com.vaadin.v7.ui.Label in project CodenameOne by codenameone.
the class SwitchScrollWheelingIssue method start.
public void start() {
if (current != null) {
current.show();
return;
}
Form f = new Form();
f.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
f.setScrollable(true);
for (int x = 1; x < 100; x++) {
Container cnt = new Container(new GridLayout(2));
cnt.addAll(new Label("Line" + x), new Switch());
f.add(cnt);
}
f.show();
}
use of com.vaadin.v7.ui.Label in project CodenameOne by codenameone.
the class SwitchTest2644 method start.
public void start() {
if (current != null) {
current.show();
return;
}
Form hi = new Form("Hi World", BoxLayout.y());
Switch sw = new Switch();
hi.add(new Label("Hi World"));
hi.add(sw);
hi.show();
}
use of com.vaadin.v7.ui.Label in project ANNIS by korpling.
the class AnnisUITest method openVisualizerPcc2.
@Test
void openVisualizerPcc2() throws Exception {
executeTokenSearch("pcc2", 399, 2);
SingleResultPanel resultPanel = _find(SingleResultPanel.class).get(0);
_get(resultPanel, KWICComponent.class);
// Open the coreference visualizer and check that IFrame component is loaded
Button btOpenCorefVisualizer = _get(resultPanel, Button.class, spec -> spec.withCaption("coreference (discourse)"));
_click(btOpenCorefVisualizer);
awaitCondition(120, () -> !_find(resultPanel, AutoHeightIFrame.class).isEmpty());
AutoHeightIFrame iframe = _get(resultPanel, AutoHeightIFrame.class, spec -> spec.withCount(1));
assertTrue(iframe.getState().getUrl().startsWith("/vis-iframe-res/"));
// Close the visualizer again
_click(btOpenCorefVisualizer);
awaitCondition(60, () -> _find(resultPanel, AutoHeightIFrame.class).isEmpty());
// Open a HTML visualizer
Button btOpenHtmlVisualizer = _get(resultPanel, Button.class, spec -> spec.withCaption("information structure (document)"));
_click(btOpenHtmlVisualizer);
awaitCondition(240, () -> !_find(resultPanel, Panel.class, spec -> spec.withPredicate(p -> p.getStyleName().startsWith("annis-wrapped-htmlvis-"))).isEmpty());
Panel htmlPanel = _get(resultPanel, Panel.class, spec -> spec.withPredicate(p -> p.getStyleName().startsWith("annis-wrapped-htmlvis-")));
Label htmlLabel = _get(htmlPanel, Label.class);
assertEquals(ContentMode.HTML, htmlLabel.getContentMode());
assertTrue(htmlLabel.getValue().startsWith("<span class=\"tok\" style=\" color:\" >Feigenblatt<"));
}
Aggregations