Example usage for com.vaadin.ui VerticalLayout setSizeFull

List of usage examples for com.vaadin.ui VerticalLayout setSizeFull

Introduction

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

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:edu.nps.moves.mmowgli.modules.userprofile.ManageAwardsDialog.java

License:Open Source License

@HibernateSessionThreadLocalConstructor
public ManageAwardsDialog(Object uId) {
    this.uId = uId;
    User u = User.getTL(uId);//from w ww  . ja v a 2s  .  com

    setCaption("Manage Awards for " + u.getUserName());
    setModal(true);
    setSizeUndefined();
    setWidth("625px");
    setHeight("400px");

    VerticalLayout vLay = new VerticalLayout();
    vLay.setMargin(true);
    vLay.setSpacing(true);
    vLay.setSizeFull();
    setContent(vLay);

    Panel p = new Panel("Award Assignments -- a check applies the award to player " + u.getUserName());
    p.setWidth("99%");
    p.setHeight("99%");
    vLay.addComponent(p);
    vLay.setExpandRatio(p, 1.0f);

    gridLayout = new GridLayout();
    gridLayout.addStyleName("m-headgrid");
    gridLayout.setWidth("100%");
    p.setContent(gridLayout);
    fillPanelTL(u); //@HibernateUserRead

    HorizontalLayout buttPan = new HorizontalLayout();
    buttPan.setWidth("100%");
    buttPan.setSpacing(true);
    NativeButton defineButt = new NativeButton("Define Award Types", new DefineListener());
    NativeButton saveButt = new NativeButton("Save", new SaveListener());
    NativeButton cancelButt = new NativeButton("Cancel", new CancelListener());

    buttPan.addComponent(defineButt);
    Label lab;
    buttPan.addComponent(lab = new Label());
    buttPan.setExpandRatio(lab, 1.0f);
    buttPan.addComponent(cancelButt);
    buttPan.addComponent(saveButt);
    vLay.addComponent(buttPan);
}

From source file:edu.nps.moves.mmowgli.utility.HistoryDialog.java

License:Open Source License

public HistoryDialog(SortedSet<Edits> set, String windowTitle, String tableTitle, String columnTitle,
        DoneListener dLis) {// w ww.  j  a v a  2  s  .  c  om
    this.set = set;
    this.doneListener = dLis;

    setCaption(windowTitle);
    setModal(true);
    setWidth("500px");
    setHeight("400px");

    VerticalLayout vLay = new VerticalLayout();
    setContent(vLay);
    vLay.setSizeFull();
    table = new Table(tableTitle);
    table.setSelectable(true);
    table.setContainerDataSource(makeContainer());
    table.addValueChangeListener(new TableListener());
    table.setVisibleColumns(new Object[] { "label", "string" });
    table.setColumnHeaders(new String[] { "", columnTitle });
    table.setImmediate(true);

    table.setSizeFull();
    table.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
        private static final long serialVersionUID = 1L;

        public String generateDescription(Component source, Object itemId, Object propertyId) {
            return ((StringBean) itemId).string;
        }
    });

    vLay.addComponent(table);
    vLay.setExpandRatio(table, 1.0f);
    MediaLocator mLoc = Mmowgli2UI.getGlobals().getMediaLocator();
    HorizontalLayout buttLay = new HorizontalLayout();
    vLay.addComponent(buttLay);
    vLay.setComponentAlignment(buttLay, Alignment.TOP_RIGHT);
    cancelButt = new NativeButton();
    mLoc.decorateCancelButton(cancelButt);
    buttLay.addComponent(cancelButt);
    buttLay.setComponentAlignment(cancelButt, Alignment.BOTTOM_RIGHT);

    okButt = new NativeButton();
    mLoc.decorateOkButton(okButt);
    buttLay.addComponent(okButt);
    buttLay.setComponentAlignment(okButt, Alignment.BOTTOM_RIGHT);
    okButt.setEnabled(false);

    cancelButt.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        @MmowgliCodeEntry
        @HibernateOpened
        @HibernateClosed
        public void buttonClick(ClickEvent event) {
            HSess.init();
            UI.getCurrent().removeWindow(HistoryDialog.this);
            if (doneListener != null)
                doneListener.doneTL(null, -1);
            HSess.close();
        }
    });
    okButt.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        @MmowgliCodeEntry
        @HibernateOpened
        @HibernateClosed
        public void buttonClick(ClickEvent event) {
            HSess.init();
            UI.getCurrent().removeWindow(HistoryDialog.this);
            StringBean obj = (StringBean) table.getValue();
            if (doneListener != null) {
                if (obj != null) {
                    int idx = obj.getOrder();
                    doneListener.doneTL(obj.getString(), idx);
                } else
                    doneListener.doneTL(null, -1);
            }
            HSess.close();
        }
    });
}

From source file:edu.vcu.csbc.vahmpexplorer.main.VaHMPExplorer.java

private void buildMainLayout() {
    main = new Window("VaHMP Explorer");
    setMainWindow(main);/*from  w ww . j  a v a  2s.  com*/
    setMainComponent(getListView());
    VerticalLayout v = new VerticalLayout();
    v.addComponent(createToolBar(showLogin));
    v.addComponent(horiztonalSplit);
    v.setSizeFull();

    v.setExpandRatio(horiztonalSplit, 1);
    horiztonalSplit.setSplitPosition(250, HorizontalSplitPanel.UNITS_PIXELS);

    horiztonalSplit.setFirstComponent(getRunViewer());
    getMainWindow().setContent(v);
    getMainWindow().addListener((Window.CloseListener) this);
    if (login != null) {
        getMainWindow().removeWindow(login);

        String newURL = getURL().toString().replace(":8080", "");
        newURL = getURL().toString();
        login.open(new ExternalResource(newURL));
    }

}

From source file:eu.eco2clouds.portal.component.apwizard.RequirementsStep.java

License:Apache License

private void render() {

    requirementTable.setMultiSelect(false);

    this.addComponent(this.newRequirementForm);

    VerticalLayout vl = new VerticalLayout();
    vl.setMargin(false);//from ww  w.java 2s  . c  o  m
    vl.setSpacing(true);
    vl.setSizeFull();

    vl.addComponent(requirementTable);

    Button btnDeleteReq = new Button("Remove");
    btnDeleteReq.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {

            RequirementTableBean r = (RequirementTableBean) requirementTable.getValue();

            if (r != null) {

                ApplicationProfile ap = ((E2CPortal) UI.getCurrent()).getSessionStatus()
                        .getApplicationProfile();
                if (ap != null) {
                    Constraint constrainttodelete = null;
                    for (Constraint constraint : ap.getRequirement().getConstraints()) {
                        if (constraint.getElement().equals(r.getElement())
                                && constraint.getIndicator().equals(r.getMetric())) {
                            constrainttodelete = constraint;
                        }
                    }

                    if (constrainttodelete != null) {
                        ap.getRequirement().getConstraints().remove(constrainttodelete);
                    }
                }
                requirementTable.getContainerDataSource().removeItem(r);

                mainLayout.getMenu().getRequirementStep().getNewRequirementForm().updateElementList();

                mainLayout.getAptext().update();

            }
        }
    });

    vl.addComponent(btnDeleteReq);
    this.addComponent(vl);
}

From source file:eu.eco2clouds.portal.component.apwizard.ResourcesStep.java

License:Apache License

private void render() {

    this.setMargin(true);
    this.setSpacing(true);
    this.setSizeFull();

    VerticalLayout vl = new VerticalLayout();
    vl.setSizeFull();
    vl.setMargin(false);//  w  w w.  jav  a2 s . c o m
    vl.setSpacing(true);

    vl.addComponent(this.newResourceTable);

    Button btnDeleteVM = new Button("Remove");
    btnDeleteVM.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {

            NewResourceTableBean r = (NewResourceTableBean) newResourceTable.getValue();

            if (r != null) {

                ExperimentDescriptor ed = ((E2CPortal) UI.getCurrent()).getSessionStatus()
                        .getApplicationProfile().getExperimentDescriptor();
                if (ed != null) {
                    ArrayList<ResourceCompute> rcList = ed.getResourcesCompute();

                    ResourceCompute rctodelete = null;
                    for (ResourceCompute rc : rcList) {
                        Compute c = rc.getCompute();
                        if (c != null) {
                            if (c.getName().equals(r.getName())) {
                                rctodelete = rc;
                            }
                        }
                    }
                    if (rctodelete != null) {
                        ed.getResourcesCompute().remove(rctodelete);
                    }
                }
                newResourceTable.getContainerDataSource().removeItem(r);

                ((E2CPortal) UI.getCurrent()).getSessionStatus().getApplicationProfile()
                        .setExperimentDescriptor(ed);

                mainLayout.getMenu().getRequirementStep().getNewRequirementForm().updateElementList();

                mainLayout.getAptext().update();

            }
        }
    });

    vl.addComponent(btnDeleteVM);

    this.addComponent(new NewResourceForm(this.newResourceTable, mainLayout));
    this.addComponent(vl);

}

From source file:eu.eco2clouds.portal.component.PictureWindow.java

License:Apache License

private void render() {

    VerticalLayout content = new VerticalLayout();
    content.setSpacing(true);/*w  w w  .j av  a  2  s . co m*/
    content.setMargin(true);
    content.setSizeFull();

    Image image = new Image();
    //image.setSource(new ThemeResource("img/applicationsample.png"));
    image.setSource(new FileResource(
            new File(Configuration.propertiesDir + File.separator + "sample_applicationprofile.png")));
    //image.setHeight("300px");
    content.addComponent(image);

    Button btnClose = new Button("Close");
    btnClose.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {

            close();
        }
    });

    content.addComponent(btnClose);
    content.setExpandRatio(image, 1.0f);
    content.setComponentAlignment(btnClose, Alignment.BOTTOM_CENTER);
    this.setContent(content);

    this.setHeight("450px");
    this.setWidth("900px");

    this.center();
    this.setModal(true);
}

From source file:eu.eco2clouds.portal.page.ExperimentLayout.java

License:Apache License

public void render() {

    TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();//  ww w.j ava  2s . c o m

    /* sheet on experiment details*/
    VerticalLayout detailsSheet = new VerticalLayout();
    detailsSheet.setSpacing(true);
    detailsSheet.setMargin(true);
    detailsSheet.setSizeFull();

    detailsSheet.addComponent(new ExperimentDetails(experiment));

    detailsSheet.addComponent(new ResourceTable());

    /* sheet reporting experiment energy */
    VerticalLayout ecoReportSheet = new VerticalLayout();
    ecoReportSheet.setSpacing(true);
    ecoReportSheet.setMargin(false);
    ecoReportSheet.setSizeFull();
    ecoReportSheet.addComponent(new EcoReport());

    /* sheet reporting adaptation actions */
    VerticalLayout adaptationActionSheet = new VerticalLayout();
    adaptationActionSheet.setSpacing(true);
    adaptationActionSheet.setMargin(false);
    adaptationActionSheet.setSizeFull();
    adaptationActionSheet.addComponent(new AdaptationReport());

    /* sheet reporting experiment energy */
    /*VerticalLayout recommendationReportSheet = new VerticalLayout();
     recommendationReportSheet.setSpacing(true);
     recommendationReportSheet.setMargin(false);
     recommendationReportSheet.setSizeFull();
     recommendationReportSheet.addComponent(new RecommendationReport());*/

    tabSheet.setStyleName(Reindeer.TABSHEET_MINIMAL);

    tabSheet.addTab(detailsSheet, "Details");
    tabSheet.addTab(ecoReportSheet, "Eco Report");
    tabSheet.addTab(adaptationActionSheet, "Adaptation Report");
    //tabSheet.addTab(recommendationReportSheet, "Recommendation Report");

    this.addComponent(tabSheet);

    Label space = new Label("");
    this.addComponent(space);
    Label version = new Label("<hr/>ECO2Clouds Portal v." + E2CPortal.VERSION
            + " - (c) ECO2Clouds project 2012-2014 (<a href='http://www.eco2clouds.eu' target='_blank'>http://www.eco2clouds.eu</a>)",
            ContentMode.HTML);
    this.addComponent(version);

    this.setExpandRatio(tabSheet, 2.0f);

}

From source file:eu.livotov.labs.webskel.app.MainUI.java

License:Apache License

protected void init(final VaadinRequest vaadinRequest) {
    Label hello = new Label("Hello Web Skeleton WebApp User !");
    hello.setStyleName(ValoTheme.LABEL_H1);

    Button b = new Button("Log me now !");
    b.setStyleName(ValoTheme.BUTTON_DANGER);
    b.addClickListener(new Button.ClickListener() {
        public void buttonClick(final Button.ClickEvent event) {
            logsDao.addLogEntry("Hello, it is me you looking for...");
        }//from  ww  w  .  j  av  a  2s  .com
    });

    VerticalLayout root = new VerticalLayout();
    root.setSizeFull();
    root.setMargin(true);
    root.setSpacing(true);
    root.addComponent(hello);
    root.addComponent(b);
    root.setExpandRatio(hello, 1.0f);

    setContent(root);
}

From source file:eu.lod2.OntoWikiQuery.java

License:Apache License

public OntoWikiQuery(LOD2DemoState st) {

    // The internal state and 
    state = st;/*from w  w w . j  ava 2 s  .c  om*/
    initLogin();

    VerticalLayout queryingTab = new VerticalLayout();

    final String query = "SELECT * where {?s ?p ?o.} LIMIT 20";
    String encodedQuery = "";
    String encodedGraphName = "";
    try {
        encodedQuery = URLEncoder.encode(query, "UTF-8");
        encodedGraphName = URLEncoder.encode(state.getCurrentGraph(), "UTF-8");
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    ;

    if (encodedGraphName.equals("")) {
        Label l = new Label("One must select a current graph to use this functionality.");
        queryingTab.addComponent(l);
    } else {
        String redirecturi = service + "/queries/editor/?query=" + encodedQuery + "&m=" + encodedGraphName;
        URL request = loginandqueryRequest(redirecturi);
        if (request == null) {
            Label l = new Label(
                    "The settings are incorrect to result in a valid URL which gives access to this functionality.");
            queryingTab.addComponent(l);
        } else {
            Embedded browser = new Embedded("", new ExternalResource(request));
            browser.setType(Embedded.TYPE_BROWSER);
            browser.setSizeFull();
            queryingTab.addComponent(browser);
        }
    }
    /*
       Label l = new Label(service + "/queries/editor/?query="+ encodedQuery + "&m=" + encodedGraphName);
       queryingTab.addComponent(l);
            
       Embedded browser = new Embedded();
       try { 
       URL url;
       if (encodedGraphName.equals("")) {
       url = new URL(service + "/queries/editor/?query="+ encodedQuery);
       } else {
       url = new URL(service + "/queries/editor/?query="+ encodedQuery + "&m=" + encodedGraphName);
       };
       browser = new Embedded("", new ExternalResource(url));
       browser.setType(Embedded.TYPE_BROWSER);
       browser.setSizeFull();
       } catch (MalformedURLException e) {
       e.printStackTrace();
       };
            
       queryingTab.addComponent(browser);
     */
    // The composition root MUST be set
    queryingTab.setSizeFull();
    setCompositionRoot(queryingTab);
}

From source file:eu.lod2.stat.dsdrepo.DSDRepoComponent.java

public DSDRepoComponent(Repository repository, String dataGraph, String repoGraph) {
    this.repository = repository;
    this.dataGraph = dataGraph;
    this.repoGraph = repoGraph;

    initializeRepoGraph();//from  w  w  w .  j av a 2s .c  o  m

    dcRepo = new SparqlDCRepository(repository);
    graph = new SparqlDCGraph(repository, dataGraph);

    setSizeFull();
    VerticalLayout rootLayout = new VerticalLayout();
    rootLayout.setSizeFull();
    rootLayout.setSpacing(true);
    setDebugId("dsd-repo");

    mainLayout = new VerticalLayout();
    mainLayout.setSizeUndefined();
    mainLayout.setWidth("100%");
    //        mainLayout.setHeight("800px");
    mainLayout.setSpacing(true);

    HorizontalLayout menuLayout = new HorizontalLayout();
    menuLayout.setSpacing(true);
    menuLayout.setWidth("100%");
    rootLayout.addComponent(menuLayout);
    rootLayout.setExpandRatio(menuLayout, 0.0f);

    final MenuBar menu = new MenuBar();
    menu.addStyleName("dsd");
    cmdFindDSD = new MenuBar.Command() {
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            for (MenuBar.MenuItem item : menu.getItems()) {
                if (item == selectedItem) {
                    if (!item.getStyleName().contains("selected")) {
                        if (ds != null)
                            item.setStyleName("selected");
                        findDSDs();
                    }
                } else
                    item.setStyleName("bleja");
            }
        }
    };
    menu.addItem("Find Suitable DSDs", cmdFindDSD).setStyleName("bleja");
    cmdCreateDSD = new MenuBar.Command() {
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            for (MenuBar.MenuItem item : menu.getItems()) {
                if (item == selectedItem) {
                    if (!item.getStyleName().contains("selected")) {
                        if (ds != null)
                            item.setStyleName("selected");
                        createDSD();
                    }
                } else
                    item.setStyleName("bleja");
            }
        }
    };
    menu.addItem("Create DSD", cmdCreateDSD).setStyleName("bleja");
    cmdStoreDSD = new MenuBar.Command() {
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            for (MenuBar.MenuItem item : menu.getItems()) {
                if (item == selectedItem) {
                    if (!item.getStyleName().contains("selected")) {
                        if (ds != null)
                            item.setStyleName("selected");
                        storeDSD();
                    }
                } else
                    item.setStyleName("bleja");
            }
        }
    };
    menu.addItem("Store DSD", cmdStoreDSD).setStyleName("bleja");

    menuLayout.addComponent(menu);
    Label spaceLbl = new Label("");
    menuLayout.addComponent(spaceLbl);
    menuLayout.setExpandRatio(spaceLbl, 2.0f);
    Label lbl = new Label("Choose dataset: ");
    lbl.setSizeUndefined();
    menuLayout.addComponent(lbl);

    Collection<DataSet> colDataSets = graph.getDataSets();
    if (colDataSets == null)
        colDataSets = new LinkedList<DataSet>();
    selectDataSet = new ComboBox(null, colDataSets);
    selectDataSet.setImmediate(true);
    selectDataSet.setNewItemsAllowed(false);
    selectDataSet.setNullSelectionAllowed(false);
    selectDataSet.setWidth("300px");
    selectDataSet.addListener(new Property.ValueChangeListener() {
        public void valueChange(Property.ValueChangeEvent event) {
            ds = (DataSet) event.getProperty().getValue();
        }
    });
    menuLayout.addComponent(selectDataSet);

    Panel mainPanel = new Panel(mainLayout);
    mainPanel.setSizeFull();
    mainPanel.setScrollable(true);
    mainPanel.setStyleName(Reindeer.PANEL_LIGHT);

    Label hrLabel = new Label("<hr/>", Label.CONTENT_XHTML);
    rootLayout.addComponent(hrLabel);
    rootLayout.setExpandRatio(hrLabel, 0.0f);
    rootLayout.addComponent(mainPanel);
    rootLayout.setExpandRatio(mainPanel, 2.0f);
    rootLayout.setMargin(true, false, true, false);

    setCompositionRoot(rootLayout);
}