Search in sources :

Example 1 with HorizontalSplitPanel

use of com.vaadin.ui.HorizontalSplitPanel in project opennms by OpenNMS.

the class MBeansView method initMainPanel.

private AbstractSplitPanel initMainPanel(Tree first, Component second) {
    AbstractSplitPanel splitPanel = new HorizontalSplitPanel();
    splitPanel.setSizeFull();
    splitPanel.setLocked(false);
    splitPanel.setSplitPosition(25, Unit.PERCENTAGE);
    splitPanel.setFirstComponent(first);
    splitPanel.setSecondComponent(second);
    splitPanel.setCaption(first.getCaption());
    return splitPanel;
}
Also used : HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) AbstractSplitPanel(com.vaadin.ui.AbstractSplitPanel)

Example 2 with HorizontalSplitPanel

use of com.vaadin.ui.HorizontalSplitPanel in project v-leaflet by mstahv.

the class SplitpanelIssue170 method getTestComponent.

@Override
public Component getTestComponent() {
    LMap leafletMap = new LMap();
    leafletMap.setSizeFull();
    Bounds bounds = new Bounds();
    bounds.setSouthWestLon(15.3308);
    bounds.setSouthWestLat(41.1427);
    bounds.setNorthEastLat(39.8847);
    bounds.setNorthEastLon(16.887);
    leafletMap.zoomToExtent(bounds);
    leafletMap.addLayer(new LTileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"));
    HorizontalSplitPanel sp = new HorizontalSplitPanel();
    sp.setSizeFull();
    sp.setFirstComponent(leafletMap);
    sp.setSecondComponent(new Label("My Label"));
    return sp;
}
Also used : LMap(org.vaadin.addon.leaflet.LMap) LTileLayer(org.vaadin.addon.leaflet.LTileLayer) Bounds(org.vaadin.addon.leaflet.shared.Bounds) HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) Label(com.vaadin.ui.Label)

Example 3 with HorizontalSplitPanel

use of com.vaadin.ui.HorizontalSplitPanel in project opennms by OpenNMS.

the class MibCompilerApplication method init.

/* (non-Javadoc)
     * @see com.vaadin.Application#init()
     */
@Override
public void init(VaadinRequest request) {
    if (eventProxy == null)
        throw new RuntimeException("eventProxy cannot be null.");
    if (eventConfDao == null)
        throw new RuntimeException("eventConfDao cannot be null.");
    if (dataCollectionDao == null)
        throw new RuntimeException("dataCollectionDao cannot be null.");
    final HorizontalSplitPanel mainPanel = new HorizontalSplitPanel();
    final MibConsolePanel mibConsole = new MibConsolePanel();
    final MibCompilerPanel mibPanel = new MibCompilerPanel(dataCollectionDao, eventConfDao, eventProxy, mibParser, mibConsole);
    mainPanel.setSizeFull();
    mainPanel.setSplitPosition(25, Unit.PERCENTAGE);
    mainPanel.addComponent(mibPanel);
    mainPanel.addComponent(mibConsole);
    setContent(mainPanel);
}
Also used : HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel)

Example 4 with HorizontalSplitPanel

use of com.vaadin.ui.HorizontalSplitPanel in project linkki by linkki-framework.

the class BindingSampleUI method init.

@Override
protected void init(VaadinRequest request) {
    Page.getCurrent().setTitle("linkki Sample :: Bindings");
    List<Contact> personStorage = new ArrayList<>();
    BindingManager bindingManager = new DefaultBindingManager(ValidationService.NOP_VALIDATION_SERVICE);
    BindingContext context = bindingManager.startNewContext("binding-sample");
    ContactComponent contactComponent = new ContactComponent(p -> save(p, personStorage), context);
    ContactsTableComponent contactsTable = new ContactsTableComponent(personStorage, contactComponent::editContact, context);
    bindingManager.addUiUpdateObserver(contactsTable);
    HorizontalSplitPanel panel = new HorizontalSplitPanel(contactComponent, contactsTable);
    panel.setLocked(true);
    setContent(panel);
}
Also used : DefaultBindingManager(org.linkki.core.binding.DefaultBindingManager) BindingManager(org.linkki.core.binding.BindingManager) ContactsTableComponent(org.linkki.samples.binding.components.ContactsTableComponent) HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) ArrayList(java.util.ArrayList) ContactComponent(org.linkki.samples.binding.components.ContactComponent) BindingContext(org.linkki.core.binding.BindingContext) DefaultBindingManager(org.linkki.core.binding.DefaultBindingManager) Contact(org.linkki.samples.binding.model.Contact)

Example 5 with HorizontalSplitPanel

use of com.vaadin.ui.HorizontalSplitPanel in project charts by vaadin.

the class ChartsDemoUI method init.

@Override
protected void init(VaadinRequest request) {
    initGATracker();
    tabSheet = new TabSheet();
    tabSheet.addSelectedTabChangeListener(new TabSheet.SelectedTabChangeListener() {

        @Override
        public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) {
            com.vaadin.ui.JavaScript.eval("setTimeout(function(){prettyPrint();},300);");
        }
    });
    tabSheet.setSizeFull();
    tabSheet.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
    Link homepage = new Link("Home Page", new ExternalResource("https://vaadin.com/components/vaadin-charts"));
    Link javadoc = new Link("JavaDoc", new ExternalResource("https://vaadin.com/api/com.vaadin/vaadin-charts/" + getVersion() + "/"));
    Link manual = new Link("Manual", new ExternalResource("https://vaadin.com/docs/v8/charts/charts-overview.html"));
    Link pricing = new Link("Pricing", new ExternalResource("https://vaadin.com/pricing"));
    Label version = new Label("Version " + getVersion());
    version.addStyleName("version");
    HorizontalLayout links = new HorizontalLayout(homepage, pricing, javadoc, manual);
    links.setSpacing(true);
    links.addStyleName("links");
    final HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel();
    horizontalSplitPanel.setSecondComponent(tabSheet);
    horizontalSplitPanel.setSplitPosition(300, Unit.PIXELS);
    horizontalSplitPanel.addStyleName("main-layout");
    ChartOptions.get().setTheme(new ValoLightTheme());
    themeSelector = new ComboBox("Charts Theme:");
    themeSelector.addStyleName("theme-selector");
    themeSelector.addStyleName(ValoTheme.COMBOBOX_SMALL);
    themeSelector.setTextInputAllowed(false);
    com.vaadin.addon.charts.model.style.Theme defaultTheme = new ValoLightTheme();
    Map<com.vaadin.addon.charts.model.style.Theme, String> mapThemes = new HashMap<>();
    com.vaadin.addon.charts.model.style.Theme[] themes = new com.vaadin.addon.charts.model.style.Theme[] { defaultTheme, new ValoDarkTheme(), new VaadinTheme(), new HighChartsDefaultTheme(), new GridTheme(), new GrayTheme(), new SkiesTheme() };
    mapThemes.put(themes[0], "Valo Light");
    mapThemes.put(themes[1], "Valo Dark");
    mapThemes.put(themes[2], "Vaadin");
    mapThemes.put(themes[3], "HighCharts");
    mapThemes.put(themes[4], "Grid");
    mapThemes.put(themes[5], "Gray");
    mapThemes.put(themes[6], "Skies");
    themeSelector.setEmptySelectionAllowed(false);
    themeSelector.setItems(themes);
    themeSelector.setSelectedItem(defaultTheme);
    themeSelector.setItemCaptionGenerator(mapThemes::get);
    themeSelector.addSelectionListener(e -> {
        ChartOptions.get().setTheme(e.getValue());
    });
    final HierarchicalContainer container = getContainer();
    VerticalLayout content = new VerticalLayout();
    content.setSpacing(true);
    content.setMargin(false);
    Label logo = new Label("Vaadin Charts for Vaadin 8");
    logo.setWidth("100%");
    logo.addStyleName("h3");
    logo.addStyleName("logo");
    TextField filterField = new TextField();
    filterField.setPlaceholder("Filter examples");
    filterField.setIcon(FontAwesome.SEARCH);
    filterField.addStyleName("filter");
    filterField.setWidth("100%");
    filterField.addValueChangeListener(e -> {
        container.removeAllContainerFilters();
        String text = e.getValue();
        if (text != null && !text.isEmpty()) {
            expandForFiltering();
            container.addContainerFilter("searchName", text, true, false);
        } else {
            restoreExpandedStates();
        }
    });
    tree = new Tree();
    tree.setImmediate(true);
    tree.setContainerDataSource(container);
    tree.setItemCaptionPropertyId("displayName");
    tree.setNullSelectionAllowed(false);
    tree.setWidth("100%");
    tree.addValueChangeListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            Object value = event.getProperty().getValue();
            if (value instanceof Class) {
                updateTabSheet((Class) value);
            } else {
                tree.expandItemsRecursively(value);
            }
        }
    });
    Button trial = new Button("Start Free Trial");
    trial.addStyleName(ValoTheme.BUTTON_PRIMARY);
    trial.addStyleName(ValoTheme.BUTTON_TINY);
    trial.addClickListener(e -> {
        getUI().getPage().open("https://vaadin.com/trial", "_blank");
    });
    content.addComponents(logo, links, trial, filterField, tree, version);
    content.setComponentAlignment(trial, Alignment.MIDDLE_CENTER);
    horizontalSplitPanel.setFirstComponent(content);
    selectItem();
    Page.getCurrent().addUriFragmentChangedListener(new Page.UriFragmentChangedListener() {

        @Override
        public void uriFragmentChanged(Page.UriFragmentChangedEvent event) {
            selectItem();
        }
    });
    setContent(new CssLayout() {

        {
            setSizeFull();
            addComponent(horizontalSplitPanel);
            addComponent(themeSelector);
        }
    });
    if (tracker != null) {
        tracker.trackPageview("/charts");
    }
}
Also used : SkiesTheme(com.vaadin.addon.charts.themes.SkiesTheme) HighChartsDefaultTheme(com.vaadin.addon.charts.themes.HighChartsDefaultTheme) ValoLightTheme(com.vaadin.addon.charts.themes.ValoLightTheme) HashMap(java.util.HashMap) Label(com.vaadin.ui.Label) VaadinTheme(com.vaadin.addon.charts.themes.VaadinTheme) Page(com.vaadin.server.Page) GrayTheme(com.vaadin.addon.charts.themes.GrayTheme) HorizontalLayout(com.vaadin.ui.HorizontalLayout) ValoDarkTheme(com.vaadin.addon.charts.themes.ValoDarkTheme) CssLayout(com.vaadin.ui.CssLayout) Button(com.vaadin.ui.Button) VerticalLayout(com.vaadin.ui.VerticalLayout) TextField(com.vaadin.ui.TextField) Tree(com.vaadin.v7.ui.Tree) Property(com.vaadin.v7.data.Property) ComboBox(com.vaadin.ui.ComboBox) GridTheme(com.vaadin.addon.charts.themes.GridTheme) ExternalResource(com.vaadin.server.ExternalResource) TabSheet(com.vaadin.ui.TabSheet) HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) ValoLightTheme(com.vaadin.addon.charts.themes.ValoLightTheme) ValoDarkTheme(com.vaadin.addon.charts.themes.ValoDarkTheme) ValoTheme(com.vaadin.ui.themes.ValoTheme) Theme(com.vaadin.annotations.Theme) GrayTheme(com.vaadin.addon.charts.themes.GrayTheme) VaadinTheme(com.vaadin.addon.charts.themes.VaadinTheme) GridTheme(com.vaadin.addon.charts.themes.GridTheme) HighChartsDefaultTheme(com.vaadin.addon.charts.themes.HighChartsDefaultTheme) SkiesTheme(com.vaadin.addon.charts.themes.SkiesTheme) HierarchicalContainer(com.vaadin.v7.data.util.HierarchicalContainer) Link(com.vaadin.ui.Link)

Aggregations

HorizontalSplitPanel (com.vaadin.ui.HorizontalSplitPanel)6 Label (com.vaadin.ui.Label)3 Button (com.vaadin.ui.Button)2 VerticalLayout (com.vaadin.ui.VerticalLayout)2 GrayTheme (com.vaadin.addon.charts.themes.GrayTheme)1 GridTheme (com.vaadin.addon.charts.themes.GridTheme)1 HighChartsDefaultTheme (com.vaadin.addon.charts.themes.HighChartsDefaultTheme)1 SkiesTheme (com.vaadin.addon.charts.themes.SkiesTheme)1 VaadinTheme (com.vaadin.addon.charts.themes.VaadinTheme)1 ValoDarkTheme (com.vaadin.addon.charts.themes.ValoDarkTheme)1 ValoLightTheme (com.vaadin.addon.charts.themes.ValoLightTheme)1 Theme (com.vaadin.annotations.Theme)1 ExternalResource (com.vaadin.server.ExternalResource)1 Page (com.vaadin.server.Page)1 AbstractSplitPanel (com.vaadin.ui.AbstractSplitPanel)1 ClickEvent (com.vaadin.ui.Button.ClickEvent)1 ClickListener (com.vaadin.ui.Button.ClickListener)1 ComboBox (com.vaadin.ui.ComboBox)1 CssLayout (com.vaadin.ui.CssLayout)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1