Search in sources :

Example 56 with Label

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();
}
Also used : Container(com.codename1.ui.Container) ComponentGroup(com.codename1.ui.ComponentGroup) Form(com.codename1.ui.Form) ButtonGroup(com.codename1.ui.ButtonGroup) Label(com.codename1.ui.Label)

Example 57 with Label

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();
}
Also used : Container(com.codename1.ui.Container) SwipeableContainer(com.codename1.ui.SwipeableContainer) BorderLayout(com.codename1.ui.layouts.BorderLayout) Form(com.codename1.ui.Form) SpanLabel(com.codename1.components.SpanLabel) Label(com.codename1.ui.Label) SwipeableContainer(com.codename1.ui.SwipeableContainer) SpanLabel(com.codename1.components.SpanLabel)

Example 58 with Label

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();
}
Also used : Container(com.codename1.ui.Container) GridLayout(com.codename1.ui.layouts.GridLayout) Switch(com.codename1.components.Switch) Form(com.codename1.ui.Form) BoxLayout(com.codename1.ui.layouts.BoxLayout) Label(com.codename1.ui.Label)

Example 59 with Label

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();
}
Also used : Switch(com.codename1.components.Switch) Form(com.codename1.ui.Form) Label(com.codename1.ui.Label)

Example 60 with Label

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<"));
}
Also used : Panel(com.vaadin.ui.Panel) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) CorpusListPanel(org.corpus_tools.annis.gui.controlpanel.CorpusListPanel) DocBrowserPanel(org.corpus_tools.annis.gui.docbrowser.DocBrowserPanel) TextField(com.vaadin.ui.TextField) Pair(kotlin.Pair) UI(com.vaadin.ui.UI) Autowired(org.springframework.beans.factory.annotation.Autowired) Window(com.vaadin.ui.Window) ExceptionDialog(org.corpus_tools.annis.gui.components.ExceptionDialog) SearchOptionsPanel(org.corpus_tools.annis.gui.controlpanel.SearchOptionsPanel) ActiveProfiles(org.springframework.test.context.ActiveProfiles) AnnotationGrid(org.corpus_tools.annis.gui.widgets.grid.AnnotationGrid) LocatorJ._find(com.github.mvysny.kaributesting.v8.LocatorJ._find) DocBrowserTable(org.corpus_tools.annis.gui.docbrowser.DocBrowserTable) ResultViewPanel(org.corpus_tools.annis.gui.resultview.ResultViewPanel) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) Page(com.vaadin.server.Page) OrderEnum(org.corpus_tools.annis.api.model.FindQuery.OrderEnum) LocatorJ._get(com.github.mvysny.kaributesting.v8.LocatorJ._get) VaadinIcons(com.vaadin.icons.VaadinIcons) GridEvent(org.corpus_tools.annis.gui.widgets.grid.GridEvent) URI(java.net.URI) GridKt(com.github.mvysny.kaributesting.v8.GridKt) WebAppConfiguration(org.springframework.test.context.web.WebAppConfiguration) NotificationsKt(com.github.mvysny.kaributesting.v8.NotificationsKt) KWICComponent(org.corpus_tools.annis.gui.visualizers.component.kwic.KWICComponent) Row(org.corpus_tools.annis.gui.widgets.grid.Row) LocatorJ._click(com.github.mvysny.kaributesting.v8.LocatorJ._click) UUID(java.util.UUID) LocatorJ._setValue(com.github.mvysny.kaributesting.v8.LocatorJ._setValue) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) Test(org.junit.jupiter.api.Test) List(java.util.List) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) TabSheet(com.vaadin.ui.TabSheet) URLEncodedUtils(org.apache.http.client.utils.URLEncodedUtils) Optional(java.util.Optional) NameValuePair(org.apache.http.NameValuePair) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) GridComponent(org.corpus_tools.annis.gui.visualizers.component.grid.GridComponent) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) ComboBox(com.vaadin.ui.ComboBox) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList) MockVaadin(com.github.mvysny.kaributesting.v8.MockVaadin) TestHelper.awaitCondition(org.corpus_tools.annis.gui.TestHelper.awaitCondition) Accordion(com.vaadin.ui.Accordion) Label(com.vaadin.ui.Label) UIScopeImpl(com.vaadin.spring.internal.UIScopeImpl) SingleCorpusResultPanel(org.corpus_tools.annis.gui.resultview.SingleCorpusResultPanel) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) DataProvider(com.vaadin.data.provider.DataProvider) AutoHeightIFrame(org.corpus_tools.annis.gui.widgets.AutoHeightIFrame) Tab(com.vaadin.ui.TabSheet.Tab) ListDataProvider(com.vaadin.data.provider.ListDataProvider) ContentMode(com.vaadin.shared.ui.ContentMode) AqlCodeEditor(org.corpus_tools.annis.gui.components.codemirror.AqlCodeEditor) Assert.assertTrue(org.junit.Assert.assertTrue) ControlPanel(org.corpus_tools.annis.gui.controlpanel.ControlPanel) Button(com.vaadin.ui.Button) AfterEach(org.junit.jupiter.api.AfterEach) MediaElementPlayer(org.corpus_tools.annis.gui.components.medialement.MediaElementPlayer) TextArea(com.vaadin.v7.ui.TextArea) SingleResultPanel(org.corpus_tools.annis.gui.resultview.SingleResultPanel) BeanFactory(org.springframework.beans.factory.BeanFactory) Annotation(org.corpus_tools.annis.api.model.Annotation) Component(com.vaadin.ui.Component) Grid(com.vaadin.ui.Grid) Panel(com.vaadin.ui.Panel) CorpusListPanel(org.corpus_tools.annis.gui.controlpanel.CorpusListPanel) DocBrowserPanel(org.corpus_tools.annis.gui.docbrowser.DocBrowserPanel) SearchOptionsPanel(org.corpus_tools.annis.gui.controlpanel.SearchOptionsPanel) ResultViewPanel(org.corpus_tools.annis.gui.resultview.ResultViewPanel) SingleCorpusResultPanel(org.corpus_tools.annis.gui.resultview.SingleCorpusResultPanel) ControlPanel(org.corpus_tools.annis.gui.controlpanel.ControlPanel) SingleResultPanel(org.corpus_tools.annis.gui.resultview.SingleResultPanel) Button(com.vaadin.ui.Button) Label(com.vaadin.ui.Label) SingleResultPanel(org.corpus_tools.annis.gui.resultview.SingleResultPanel) AutoHeightIFrame(org.corpus_tools.annis.gui.widgets.AutoHeightIFrame) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

Label (com.codename1.ui.Label)129 Form (com.codename1.ui.Form)85 Label (com.vaadin.ui.Label)56 Container (com.codename1.ui.Container)45 Button (com.codename1.ui.Button)41 Label (com.vaadin.v7.ui.Label)40 TextField (com.vaadin.v7.ui.TextField)32 BorderLayout (com.codename1.ui.layouts.BorderLayout)31 Button (com.vaadin.ui.Button)31 ComboBox (com.vaadin.v7.ui.ComboBox)31 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)31 Captions (de.symeda.sormas.api.i18n.Captions)29 Strings (de.symeda.sormas.api.i18n.Strings)28 VerticalLayout (com.vaadin.ui.VerticalLayout)26 FacadeProvider (de.symeda.sormas.api.FacadeProvider)26 HorizontalLayout (com.vaadin.ui.HorizontalLayout)24 Window (com.vaadin.ui.Window)24 CssStyles (de.symeda.sormas.ui.utils.CssStyles)24 ValoTheme (com.vaadin.ui.themes.ValoTheme)21 List (java.util.List)21