Example usage for com.vaadin.ui Panel Panel

List of usage examples for com.vaadin.ui Panel Panel

Introduction

In this page you can find the example usage for com.vaadin.ui Panel Panel.

Prototype

public Panel() 

Source Link

Document

Creates a new empty panel.

Usage

From source file:net.sourceforge.javydreamercsw.validation.manager.web.component.DataEntryTypeComponent.java

License:Apache License

@Override
protected Component initContent() {
    Panel p = new Panel();
    FormLayout l = new FormLayout();
    p.setContent(l);/*from  ww w.j av a2s .  c o  m*/
    BeanFieldGroup binder = new BeanFieldGroup(getInternalValue().getClass());
    binder.setItemDataSource(getInternalValue());
    l.addComponent(binder.buildAndBind(TRANSLATOR.translate("general.name"), "typeName"));
    l.addComponent(binder.buildAndBind(TRANSLATOR.translate("general.description"), "typeDescription"));
    binder.setReadOnly(!edit);
    return p;
}

From source file:net.sourceforge.javydreamercsw.validation.manager.web.template.TemplateScreenProvider.java

License:Apache License

@Override
public Component getContent() {
    Panel p = new Panel();
    hs.setSplitPosition(30, Sizeable.Unit.PERCENTAGE);
    hs.setFirstComponent(getLeftComponent());
    hs.setSecondComponent(getRightComponent());
    hs.setSizeFull();//from   www  .  ja  v a2 s . com
    p.setContent(hs);
    p.setId(getComponentCaption());
    return p;
}

From source file:net.sourceforge.javydreamercsw.validation.manager.web.template.TemplateScreenProvider.java

License:Apache License

private Component getLeftComponent() {
    Panel p = new Panel();
    VerticalLayout layout = new VerticalLayout();
    templates.setNullSelectionAllowed(true);
    templates.setWidth(100, Sizeable.Unit.PERCENTAGE);
    BeanItemContainer<Template> container = new BeanItemContainer<>(Template.class,
            new TemplateJpaController(DataBaseManager.getEntityManagerFactory()).findTemplateEntities());
    templates.setContainerDataSource(container);
    templates.getItemIds().forEach(id -> {
        Template temp = ((Template) id);
        templates.setItemCaption(id, TRANSLATOR.translate(temp.getTemplateName()));
    });//from w  w  w  .  j a  va 2  s  . c  o m
    templates.addValueChangeListener(event -> {
        hs.setSecondComponent(getRightComponent());
    });
    templates.setNullSelectionAllowed(false);
    templates.setWidth(100, Sizeable.Unit.PERCENTAGE);
    layout.addComponent(templates);
    HorizontalLayout hl = new HorizontalLayout();
    Button create = new Button(TRANSLATOR.translate("general.add"));
    create.addClickListener(listener -> {
        displayTemplateCreateWizard();
    });
    hl.addComponent(create);
    Button copy = new Button(TRANSLATOR.translate("general.copy"));
    copy.addClickListener(listener -> {
        displayTemplateCopyWizard();
    });
    hl.addComponent(copy);
    Button delete = new Button(TRANSLATOR.translate("general.delete"));
    delete.addClickListener(listener -> {
        displayTemplateDeleteWizard();
    });
    hl.addComponent(delete);
    templates.addValueChangeListener(listener -> {
        if (templates.getValue() != null) {
            Template t = (Template) templates.getValue();
            delete.setEnabled(t.getId() >= 1_000);
            copy.setEnabled(t.getTemplateNodeList().size() > 0);
        }
    });
    layout.addComponent(hl);
    layout.setSizeFull();
    p.setContent(layout);
    p.setSizeFull();
    return p;
}

From source file:net.sourceforge.javydreamercsw.validation.manager.web.template.TemplateScreenProvider.java

License:Apache License

private Component getRightComponent() {
    Template t = (Template) templates.getValue();
    return t == null ? new Panel() : new TemplateComponent(t, t.getId() >= 1000);
}

From source file:nl.kpmg.lcm.ui.Application.java

License:Apache License

@Override
protected void init(VaadinRequest vaadinRequest) {
    getPage().setTitle("Local Catalog Manager");

    final VerticalLayout root = new VerticalLayout();
    root.setSizeFull();/*from ww w  .  j a  va  2s . c om*/
    root.setMargin(true);
    root.setSpacing(true);
    setContent(root);

    final CssLayout navigationBar = new CssLayout();
    navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);

    Label logo = new Label("LCM");
    logo.addStyleName("logo");
    logo.setWidthUndefined();

    navigationBar.addComponent(logo);
    navigationBar.addComponent(createNavigationButton("Metadata", MetadataOverviewViewImpl.VIEW_NAME));
    navigationBar.addComponent(createNotImplementedButton("Analytics"));
    navigationBar.addComponent(createNavigationButton("Transfer", TransferViewImpl.VIEW_NAME));
    navigationBar.addComponent(createNavigationButton("Administration", AdministrationViewImpl.VIEW_NAME));
    navigationBar.addComponent(createLogoutButton("Logout"));
    root.addComponent(navigationBar);

    final Panel viewContainer = new Panel();
    viewContainer.setSizeFull();
    root.addComponent(viewContainer);
    root.setExpandRatio(viewContainer, 1.0f);

    navigator = new Navigator(this, viewContainer);
    navigator.addProvider(viewProvider);
    navigator.navigateTo("login");
}

From source file:nl.kpmg.lcm.ui.component.DefinedLabel.java

License:Apache License

public DefinedLabel(String title, String content, String tooltip) {
    // A layout structure used for composition
    Panel panel = new Panel();
    panel.setStyleName("v-panel-borderless");
    panel.setWidth("100%");

    VerticalLayout panelContent = new VerticalLayout();
    panelContent.setMargin(true); // Very useful
    panelContent.setWidth("100%");

    panel.setContent(panelContent);/* w  w  w.  ja va 2 s.c  om*/

    // Compose from multiple components
    Label titleLabel = new Label(title);
    titleLabel.setStyleName("v-label-h4");
    panelContent.addComponent(titleLabel);

    Label contentLabel = new Label(content);
    panelContent.addComponent(contentLabel);

    // The composition root MUST be set
    setCompositionRoot(panel);
}

From source file:nl.kpmg.lcm.ui.view.administration.LcmIdPanel.java

License:Apache License

public LcmIdPanel(String certificateFilepath) {
    panel = new Panel();
    this.certificateFilepath = certificateFilepath;
    setCompositionRoot(panel);
}

From source file:nl.kpmg.lcm.ui.view.administration.TasksPanel.java

License:Apache License

public TasksPanel() {
    Panel panel = new Panel();
    VerticalLayout root = new VerticalLayout();

    Panel schedulePanel = new Panel();
    VerticalLayout schedulePanelLayout = new VerticalLayout();
    scheduleTable = new Table();
    scheduleTable.setWidth("100%");
    scheduleTable.setHeight("300px");
    scheduleTable.addContainerProperty("Name", String.class, null);
    scheduleTable.addContainerProperty("Cron", String.class, null);
    scheduleTable.addContainerProperty("Job", String.class, null);
    scheduleTable.addContainerProperty("Target", String.class, null);
    Label scheduleLabel = new Label("Schedule");
    scheduleLabel.setStyleName("v-label-h2");
    schedulePanelLayout.addComponent(scheduleLabel);
    schedulePanelLayout.addComponent(scheduleTable);
    schedulePanel.setContent(schedulePanelLayout);

    Panel tasksPanel = new Panel();
    VerticalLayout tasksPanelLayout = new VerticalLayout();
    tasksTable = new Table();
    tasksTable.setWidth("100%");
    tasksTable.addContainerProperty("Job", String.class, null);
    tasksTable.addContainerProperty("Target", String.class, null);
    tasksTable.addContainerProperty("Start", Date.class, null);
    tasksTable.addContainerProperty("End", Date.class, null);
    tasksTable.addContainerProperty("Status", String.class, null);
    Label tasksLabel = new Label("Tasks");
    tasksLabel.setStyleName("v-label-h2");
    tasksPanelLayout.addComponent(tasksLabel);
    tasksPanelLayout.addComponent(tasksTable);
    tasksPanel.setContent(tasksPanelLayout);

    root.addComponent(schedulePanel);/*w  w w .j ava 2  s. c  om*/
    root.addComponent(tasksPanel);

    root.setSpacing(true);
    root.setMargin(true);
    root.setWidth("100%");

    panel.setContent(root);

    setCompositionRoot(panel);
}

From source file:no.uib.probe.mnpc_2017.view.ApplicationLayout.java

public ApplicationLayout() {
    this.setWidth("100%");
    this.setHeightUndefined();
    //        this.setStyleName(Reindeer.LAYOUT_WHITE);
    this.setMargin(false);
    this.setSpacing(true);

    VerticalLayout headerLayout = new VerticalLayout();
    headerLayout.setWidth("100%");
    headerLayout.setHeight("77px");
    this.addComponent(headerLayout);

    Panel mainBodyPanel = new Panel();
    //        headerLayout.setStyleName(Reindeer.LAYOUT_BLUE);

    HorizontalLayout topLayoutContainer = new HorizontalLayout();
    headerLayout.addComponent(topLayoutContainer);
    headerLayout.setComponentAlignment(topLayoutContainer, Alignment.MIDDLE_CENTER);
    topLayoutContainer.setWidthUndefined();
    topLayoutContainer.setHeight("100%");

    VerticalLayout logoLayout = new VerticalLayout();
    logoLayout.setWidth("200px");
    logoLayout.setHeight("100%");
    logoLayout.setStyleName("starlogo");
    logoLayout.setMargin(new MarginInfo(false, true, false, false));

    Label title = new Label("NPC 2017");
    logoLayout.addComponent(title);/*from   www.j a v a2  s.  c o m*/

    topLayoutContainer.addComponent(logoLayout);
    topLayoutContainer.setComponentAlignment(logoLayout, Alignment.MIDDLE_RIGHT);

    HorizontalLayout mainMenuContainer = new HorizontalLayout();
    mainMenuContainer.setWidth("780px");
    topLayoutContainer.addComponent(mainMenuContainer);
    topLayoutContainer.setComponentAlignment(mainMenuContainer, Alignment.MIDDLE_RIGHT);

    VerticalLayout layoutI = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Home", layoutI));

    VerticalLayout layoutII = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Programme", layoutII));

    VerticalLayout layoutIII = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Practical Information", layoutIII));

    VerticalLayout layoutIV = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Exhibition & Sponsorship", layoutIV));

    VerticalLayout layoutV = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Registration", layoutV));

    VerticalLayout layoutVI = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Contact", layoutVI));

}

From source file:nz.co.senanque.vaadinsupport.viewmanager.HelpLayout.java

License:Apache License

public void afterPropertiesSet() throws Exception {
    setSizeFull();//from   w w w .ja  v a  2s .c o  m
    Panel panel = new Panel();
    panel.setWidth("50%");
    panel.addComponent(new Label(getI18nHTML(), Label.CONTENT_XHTML));
    addComponent(panel);
    setComponentAlignment(panel, Alignment.MIDDLE_CENTER);
    m_OKButton = new Button("OK");
    panel.addComponent(m_OKButton);
    m_OKButton.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = 1904763239654990140L;

        public void buttonClick(ClickEvent event) {
            getViewManager().popScreen();
            getViewManager().getMainWindow().requestRepaint();
        }
    });
}