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.actionplans.AddAuthorDialog.java

License:Open Source License

@SuppressWarnings("serial")
public AddAuthorDialog(Collection<User> currentlySelectedNames, boolean removeExisting) {
    setCaption("Invite Players to be Authors");
    setClosable(false); // no x in corner
    setWidth("300px");
    setHeight("400px");
    VerticalLayout mainVL = new VerticalLayout();
    mainVL.setSpacing(true);//from   w w  w  .  jav a 2  s  .c o  m
    mainVL.setMargin(true);
    mainVL.setSizeFull();
    setContent(mainVL);

    mainVL.addComponent(infoLabel);
    userList = new ListSelect();
    userList.addStyleName("m-greyborder");

    List<QuickUser> qlis = AppMaster.instance().getMcache().getUsersQuickList();
    BeanItemContainer<QuickUser> beanContainerQ = new BeanItemContainer<QuickUser>(QuickUser.class, qlis);

    userList.setContainerDataSource(beanContainerQ);
    userList.setItemCaptionMode(ListSelect.ItemCaptionMode.PROPERTY); // works!
    userList.setItemCaptionPropertyId("uname");
    userList.setNewItemsAllowed(false);

    mainVL.addComponent(userList);
    userList.setSizeFull();
    mainVL.setExpandRatio(userList, 1.0f);
    userList.setRows(15);
    userList.setImmediate(true);
    setMultiSelect(true); //userList.setMultiSelect(true);
    userList.setNullSelectionAllowed(false);

    if (currentlySelectedNames != null)
        for (User selU : currentlySelectedNames) {
            Collection<?> all = userList.getItemIds();
            for (Object o : all) {
                QuickUser qu = (QuickUser) o;
                if (selU.getId() == qu.getId()) {
                    if (removeExisting)
                        userList.removeItem(o);
                    else
                        userList.select(o);
                    break;
                }
            }
        }

    buttHL = new HorizontalLayout();
    buttHL.setSpacing(true);
    mainVL.addComponent(buttHL);
    buttHL.setWidth("100%");
    Label spacer;
    buttHL.addComponent(spacer = new Label());
    spacer.setWidth("1px");
    buttHL.setExpandRatio(spacer, 1.0f);

    buttHL.addComponent(addButt = new Button("Select"));
    buttHL.addComponent(cancelButt = new Button("Cancel"));

    cancelButt.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            selected = null;
            addClicked = false;
            UI.getCurrent().removeWindow(AddAuthorDialog.this);//getParent().removeWindow(AddAuthorDialog.this);
            if (closer != null)
                closer.windowClose(null);
        }
    });
    addButt.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            selected = userList.getValue();

            addClicked = true;
            UI.getCurrent().removeWindow(AddAuthorDialog.this);//getParent().removeWindow(AddAuthorDialog.this);        
            if (closer != null)
                closer.windowClose(null);
        }
    });
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.HelpWantedDialog.java

License:Open Source License

@SuppressWarnings("serial")
@HibernateSessionThreadLocalConstructor// w w  w .ja va2s .  com
public HelpWantedDialog(final Object aplnId, boolean interested) {
    setCaption(interested ? "Express Interest in Action Plan" : "Offer Assistance with Action Plan");
    setModal(true);
    setSizeUndefined();
    setWidth("500px");
    setHeight("550px");

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

    StringBuilder sb = new StringBuilder();

    ActionPlan ap = ActionPlan.getTL(aplnId);
    String s = ap.getHelpWanted();

    if (s != null) {
        vLay.addComponent(new Label(msg1));
        Label helpWantedLab = new Label(s);
        helpWantedLab.addStyleName("m-helpWantedLabel");
        helpWantedLab.setWidth("100%");
        vLay.addComponent(helpWantedLab);
    }

    vLay.addComponent(new Label(msg2));
    final TextArea toTA = new TextArea("To");
    toTA.addStyleName("m-textareaboldcaption");
    toTA.setWidth("100%");
    toTA.setRows(1);
    toTA.setNullRepresentation("");
    toTA.setValue(getAuthors(sb, ap));
    vLay.addComponent(toTA);

    final TextArea ccTA = new TextArea("CC");
    ccTA.addStyleName("m-textareaboldcaption");
    ccTA.setWidth("100%");
    ccTA.setRows(1);
    ccTA.setNullRepresentation("");

    PagesData pd = new PagesData();
    ccTA.setValue(pd.gettroubleMailto());

    vLay.addComponent(ccTA);

    final TextArea subjTA = new TextArea("Subject");
    subjTA.addStyleName("m-textareaboldcaption");
    subjTA.setWidth("100%");
    subjTA.setRows(2);
    subjTA.setNullRepresentation("");
    sb.setLength(0);
    sb.append("My interest in Action Plan ");
    sb.append(ap.getId());
    sb.append(", \"");
    sb.append(ap.getTitle());
    sb.append('"');
    subjTA.setValue(sb.toString());
    vLay.addComponent(subjTA);

    final TextArea msgTA = new TextArea("Message");
    msgTA.addStyleName("m-textareaboldcaption");
    msgTA.setWidth("100%");
    msgTA.setHeight("100%");
    msgTA.setNullRepresentation("");
    vLay.addComponent(msgTA);
    vLay.setExpandRatio(msgTA, 1.0f);

    HorizontalLayout buttLay = new HorizontalLayout();
    vLay.addComponent(buttLay);
    buttLay.setSpacing(true);
    buttLay.setWidth("100%");
    Label sp;
    buttLay.addComponent(sp = new Label());
    sp.setHeight("1px");
    buttLay.setExpandRatio(sp, 1.0f);

    Button canButt = new Button("Cancel");
    buttLay.addComponent(canButt);

    Button sendButt = new Button("Send to authors");
    buttLay.addComponent(sendButt);

    canButt.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            UI.getCurrent().removeWindow(HelpWantedDialog.this);
        }
    });

    sendButt.addClickListener(new ClickListener() {
        @Override
        @MmowgliCodeEntry
        @HibernateOpened
        @HibernateClosed
        public void buttonClick(ClickEvent event) {
            Object tos = toTA.getValue();
            if (tos == null || tos.toString().length() <= 0) {
                Notification.show("No recipients", Notification.Type.ERROR_MESSAGE);
                return;
            }
            Object cc = ccTA.getValue();
            if (cc == null || cc.toString().length() <= 0)
                cc = null;

            Object msg = msgTA.getValue();
            if (msg == null || msg.toString().length() <= 0) {
                Notification.show("No Message", Notification.Type.ERROR_MESSAGE);
                return;
            }
            Object subj = subjTA.getValue();
            if (subj == null)
                subj = "";

            HSess.init();

            List<User> authors = parseAuthorsTL(tos.toString().trim());
            MmowgliSessionGlobals globs = Mmowgli2UI.getGlobals();
            MailManager mmgr = AppMaster.instance().getMailManager();
            User me = globs.getUserTL();
            for (User u : authors) {
                mmgr.mailToUserTL(me.getId(), u.getId(), subj.toString(), msg.toString());
            }

            if (cc == null)
                mmgr.mailToUserTL(me.getId(), me.getId(), "(CC:)" + subj.toString(), msg.toString());
            else
                mmgr.mailToUserTL(me.getId(), me.getId(), subj.toString(), msg.toString(), cc.toString(),
                        MailManager.Channel.BOTH); // the cc is an email, not a user name

            UI.getCurrent().removeWindow(HelpWantedDialog.this);
            Notification.show("Message(s) sent", Notification.Type.HUMANIZED_MESSAGE); // fixed 21 Jan 2015

            HSess.close();
        }
    });
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.MediaSubWindow.java

License:Open Source License

public MediaSubWindow(Resource res) {
    setCaption("Action Plan Image");
    setModal(true);/*from   w w  w.  ja v a  2 s  . co m*/
    setWidth("640px");
    setHeight("480px");

    TabSheet tabs = new TabSheet();
    tabs.setSizeFull();
    setContent(tabs);

    Panel pan = new Panel();
    tabs.addTab(pan, "Fit Window");
    pan.setSizeFull();

    VerticalLayout layout = new VerticalLayout();
    pan.setContent(layout);
    layout.setSizeFull();
    layout.addStyleName("m-background-lightgrey");
    layout.setMargin(false);

    image = new ScaleImage();
    image.setSizeFull();
    image.setSource(res);

    layout.addComponent(image);
    layout.setComponentAlignment(image, Alignment.MIDDLE_CENTER);
    layout.setExpandRatio(image, 1.0f);

    tabs.addTab(buildNestedImage(res), "Actual Size");
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.RfeDialog.java

License:Open Source License

@HibernateSessionThreadLocalConstructor
@SuppressWarnings("serial")
public RfeDialog(Object aplnId) {
    this.apId = aplnId;

    setCaption("Request for Expertise");
    setModal(true);//  www .ja v  a2s. co m
    setSizeUndefined();
    setWidth("500px");
    setHeight("400px");

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

    IDButton searchButt = new IDButton("Option 1: Search for players with needed expertise", SEARCHCLICK, null);
    searchButt.enableAction(false); // do manually
    searchButt.addClickListener(new SearchListener());
    vLay.addComponent(searchButt);

    VerticalLayout nuts = new VerticalLayout();
    vLay.addComponent(nuts);
    nuts.setSizeFull();
    vLay.setExpandRatio(nuts, 1.0f);
    Label lab;
    /*vLay*/nuts.addComponent(lab = new Label("Option 2: Post help-wanted notice to action plan"));
    lab.addStyleName("m-font-bold11");

    final VerticalLayout helpWantedPan = new VerticalLayout();
    /*vLay*/nuts.addComponent(helpWantedPan);
    helpWantedPan.addStyleName("m-greyborder");
    helpWantedPan.setWidth("99%");
    helpWantedPan.setHeight("99%");
    helpWantedPan.setSpacing(true);
    helpWantedPan.setMargin(true);
    /*vLay*/nuts.setExpandRatio(helpWantedPan, 1.0f);

    helpWantedTA = new TextArea("Current posting");
    helpWantedTA.setWidth("100%");
    helpWantedTA.setHeight("100%");
    helpWantedTA.setNullRepresentation("");
    helpWantedPan.addComponent(helpWantedTA);
    helpWantedPan.setExpandRatio(helpWantedTA, 1.0f);

    HorizontalLayout buttLay = new HorizontalLayout();
    helpWantedPan.addComponent(buttLay);
    buttLay.setSpacing(true);
    buttLay.setWidth("100%");

    buttLay.addComponent(lab = new Label());
    lab.setWidth("10px");

    clearButt = new Button("Clear");
    buttLay.addComponent(clearButt);
    clearButt.addClickListener(clearButtLis = new ClickListener() {
        @Override
        @MmowgliCodeEntry
        @HibernateOpened
        @HibernateClosed
        public void buttonClick(ClickEvent event) {
            HSess.init();
            ActionPlan ap = ActionPlan.getTL(apId);
            helpWantedTA.setValue(null);
            if (null != ap.getHelpWanted()) {
                ap.setHelpWanted(null);
                ActionPlan.updateTL(ap);
                Notification notif = new Notification("Cleared");
                notif.setDelayMsec(3000);
                notif.show(Page.getCurrent());
                GameEventLogger.logHelpWantedTL(ap);
                notifyAuthorsOfChangeTL(ap);
            }
            HSess.close();
        }
    });

    buttLay.addComponent(lab = new Label());
    buttLay.setExpandRatio(lab, 1.0f);

    postButt = new Button("Post");
    buttLay.addComponent(postButt);
    postButt.addClickListener(new ClickListener() {
        @Override
        @MmowgliCodeEntry
        @HibernateOpened
        @HibernateClosed
        public void buttonClick(ClickEvent event) {
            Object val = helpWantedTA.getValue();
            if (val == null || val.toString().length() <= 0) {
                clearButtLis.buttonClick(event);
                return;
            }

            HSess.init();
            String s = val.toString();
            ActionPlan ap = ActionPlan.getTL(apId);
            if (s == null ? ap.getHelpWanted() != null : !s.equals(ap.getHelpWanted())) {
                ap.setHelpWanted(s);
                ActionPlan.updateTL(ap);
                Notification notif = new Notification("Posted");
                notif.setDelayMsec(3000);
                notif.show(Page.getCurrent());
                GameEventLogger.logHelpWantedTL(ap);
                notifyAuthorsOfChangeTL(ap);
            }
            HSess.close();
        }
    });
    buttLay.addComponent(lab = new Label());
    lab.setWidth("10px");

    helpWantedPan.addComponent(lab = new Label());
    lab.setHeight("10px");

    IDButton troubleButt = new IDButton("Option 3: Post Trouble Report", POSTTROUBLECLICK, null);
    troubleButt.enableAction(false); // managed manually
    troubleButt.addClickListener(new TroubleListener());
    vLay.addComponent(troubleButt);

    Button closeButt = new Button("Close");
    vLay.addComponent(closeButt);
    closeButt.addClickListener(new CloseListener());

    vLay.setComponentAlignment(closeButt, Alignment.MIDDLE_RIGHT);

    ActionPlan ap = ActionPlan.getTL(apId);
    String s = ap.getHelpWanted();
    helpWantedTA.setValue(s);
}

From source file:edu.nps.moves.mmowgli.modules.administration.SessionReportWindow.java

License:Open Source License

public SessionReportWindow(String caption) {
    super(caption);
    setWidth("700px");
    setHeight("400px");
    VerticalLayout vLay = new VerticalLayout();
    vLay.setSizeFull();
    setContent(vLay);//from  www.  j  a  va2 s .  c  o  m

    String header = AppMaster.instance().getSessionReportHeader();
    String[] _headerArr = header.split("\t");
    widestRowSize = _headerArr.length;

    String svrName = AppMaster.instance().getServerName();
    int idx;
    if ((idx = svrName.indexOf('.')) != -1)
        svrName = svrName.substring(0, idx);

    String me = AppMaster.instance().getLocalNodeReportRaw().toString();
    me = svrName + "\n" + me;
    String[][] localReport = parseReport(me);

    String all = AppMaster.instance().getCompletePlayerReportRaw().toString();
    String[][] remoteReports = parseReport(all);

    String[] headerArr;
    if (widestRowSize > _headerArr.length) {
        headerArr = new String[widestRowSize];
        Arrays.fill(headerArr, " ");
        for (int i = 0; i < _headerArr.length; i++)
            headerArr[i] = _headerArr[i];
    } else
        headerArr = _headerArr;

    table = new Table();
    table.setSizeFull();

    for (int col = 0; col < headerArr.length; col++) {
        if (col == 0)
            table.addContainerProperty(headerArr[col], Label.class, null);
        else
            table.addContainerProperty(headerArr[col], String.class, null);
    }
    addReportToTable(headerArr, localReport);
    addReportToTable(headerArr, remoteReports);

    vLay.addComponent(makeTopSummary(localReport, remoteReports));
    vLay.addComponent(table);
    vLay.setExpandRatio(table, 1.0f);
}

From source file:edu.nps.moves.mmowgli.modules.administration.VipListManager.java

License:Open Source License

private void showAddDialogOrCancel(final DoneListener lis) {
    dialog = new Window("Add to VIP list");
    dialog.setModal(true);/*w  w  w.ja  v a  2s.c  om*/
    dialog.setWidth("400px");
    dialog.setHeight("350px");

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

    List<String> rtypes = Arrays.asList(new String[] { EMAILTYPE, DOMAINTYPE });
    radios = new OptionGroup("Select type", rtypes);

    radios.setNullSelectionAllowed(false); // user can not 'unselect'
    radios.select("Emails"); // select this by default
    radios.setImmediate(false); // don't send the change to the server at once
    layout.addComponent(radios);

    final TextArea ta = new TextArea();
    //ta.setColumns(40);
    ta.setSizeFull();
    ta.setInputPrompt(
            "Type or paste a tab-, comma- or space-separated list of emails or domains.  For domains, "
                    + "use forms such as \"army.mil\", \"nmci.navy.mil\", \"ucla.edu\", \"gov\", etc.");
    layout.addComponent(ta);

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);
    @SuppressWarnings("serial")
    Button cancelButt = new Button("Cancel", new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            dialog.close();
            lis.continueOrCancel(null);
        }
    });

    @SuppressWarnings("serial")
    Button addButt = new Button("Add", new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            String[] returnArr = null;
            String result = ta.getValue().toString();
            if (result == null || result.length() <= 0)
                returnArr = null;
            else if ((returnArr = parseIt(result)) == null)
                return;

            dialog.close();
            lis.continueOrCancel(returnArr);
        }
    });

    hl.addComponent(cancelButt);
    hl.addComponent(addButt);
    hl.setComponentAlignment(cancelButt, Alignment.MIDDLE_RIGHT);
    hl.setExpandRatio(cancelButt, 1.0f);

    // The components added to the window are actually added to the window's
    // layout; you can use either. Alignments are set using the layout
    layout.addComponent(hl);

    hl.setWidth("100%");
    ta.setWidth("100%");
    ta.setHeight("100%");
    layout.setExpandRatio(ta, 1.0f);

    UI.getCurrent().addWindow(dialog);
    dialog.center();
}

From source file:edu.nps.moves.mmowgli.modules.administration.VipListManager.java

License:Open Source License

@SuppressWarnings({ "unchecked", "serial" })
private void showViewOrDelete(final DeleteListener lis) {
    dialog = new Window("View / Delete VIPs");
    dialog.setModal(true);/*from www  .j  ava  2  s  . co  m*/

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

    List<VipPii> vLis = VHibPii.getAllVips();

    vipListSelect = new ListSelect("Select items to delete");
    StringBuffer sb = new StringBuffer(); // for popup
    vipListSelect.addStyleName("m-greyborder");
    String lf = System.getProperty("line.separator");
    for (int i = 0; i < vLis.size(); i++) {
        VipPii v;
        vipListSelect.addItem(v = vLis.get(i));
        sb.append(v.getEntry());
        sb.append(lf);
    }
    if (sb.length() > 0)
        sb.setLength(sb.length() - 1); // last space

    vipListSelect.setNullSelectionAllowed(true);
    vipListSelect.setMultiSelect(true);
    vipListSelect.setImmediate(true);
    vipListSelect.addValueChangeListener(new VipSelectListener());

    layout.addComponent(vipListSelect);

    Label copyPopupList = new HtmlLabel("<pre>" + sb.toString() + "</pre>");
    Panel p = new Panel();
    VerticalLayout lay = new VerticalLayout();
    p.setContent(lay);
    lay.addComponent(copyPopupList);
    p.setWidth("400px");
    p.setHeight("300px");
    PopupView popup = new PopupView("Display list as copyable text", p);
    popup.setHideOnMouseOut(false);
    if (sb.length() <= 0)
        popup.setEnabled(false);

    layout.addComponent(popup);
    layout.setComponentAlignment(popup, Alignment.MIDDLE_CENTER);

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);
    Button cancelButt = new Button("Cancel", new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            dialog.close();
            lis.continueOrCancel(null);
        }
    });

    deleteButt = new Button("Delete & Close", new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            Set<VipPii> set = (Set<VipPii>) vipListSelect.getValue();
            if (set.size() <= 0)
                set = null;
            dialog.close();
            lis.continueOrCancel(set);
        }
    });
    deleteButt.setEnabled(false);
    hl.addComponent(cancelButt);
    hl.addComponent(deleteButt);
    hl.setComponentAlignment(cancelButt, Alignment.MIDDLE_RIGHT);
    hl.setExpandRatio(cancelButt, 1.0f);

    // The components added to the window are actually added to the window's
    // layout; you can use either. Alignments are set using the layout
    layout.addComponent(hl);
    dialog.setWidth("300px");
    dialog.setHeight("350px");
    hl.setWidth("100%");
    vipListSelect.setWidth("99%");
    vipListSelect.setHeight("99%");
    layout.setExpandRatio(vipListSelect, 1.0f);

    UI.getCurrent().addWindow(dialog);
    dialog.center();
}

From source file:edu.nps.moves.mmowgli.modules.gamemaster.AddAuthorEventHandler.java

License:Open Source License

@SuppressWarnings("serial")
public static void inviteAuthorsToActionPlan() {
    final Window win = new Window("Choose Action Plan");
    win.setWidth("600px");
    win.setHeight("500px");

    VerticalLayout layout = new VerticalLayout();
    win.setContent(layout);//from  w  ww.j  a  v a  2 s . co m
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeFull();

    final ActionPlanTable apt = new ActionPlanTable() {
        @Override
        public ItemClickListener getItemClickListener() {
            return new ItemClickListener() {
                public void itemClick(ItemClickEvent event) {
                }
            }; // null listener
        }
    };
    apt.setMultiSelect(false);
    apt.setPageLength(10);
    apt.setSizeFull();
    layout.addComponent(apt);
    layout.setExpandRatio(apt, 1.0f);

    HorizontalLayout buttHL = new HorizontalLayout();
    layout.addComponent(buttHL);
    buttHL.setWidth("100%");
    buttHL.setSpacing(true);
    Label sp;
    buttHL.addComponent(sp = new Label());
    sp.setWidth("1px");
    buttHL.setExpandRatio(sp, 1.0f);

    Button selectButton = new Button("Select");
    buttHL.addComponent(selectButton);
    Button cancelButton = new Button("Cancel");
    buttHL.addComponent(cancelButton);

    UI.getCurrent().addWindow(win);
    win.center();

    selectButton.addClickListener(new ClickListener() {
        @Override
        @MmowgliCodeEntry
        @HibernateOpened
        @HibernateClosed
        public void buttonClick(ClickEvent event) {
            win.close();
            Object o = apt.getValue();
            if (o != null) {
                HSess.init();
                inviteAuthorsToActionPlanTL(o);
                HSess.close();
            }
        }
    });
    cancelButton.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            win.close();
        }
    });
}

From source file:edu.nps.moves.mmowgli.modules.gamemaster.SetBlogHeadlineWindow.java

License:Open Source License

@Override
public void attach() {
    Panel p = new Panel();
    setContent(p);/*w w w .  ja v a 2s  . c  om*/
    p.setSizeFull();

    VerticalLayout layout = new VerticalLayout();
    layout.addStyleName("m-blogheadline");
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeFull();
    p.setContent(layout);

    layout.addComponent(infoLab = new Label(
            "Game masters can communicate with players throughout the game.  Add a new headling, tooltip and link here."));

    layout.addComponent(textLab = new Label("Enter headline:"));
    textTF = new TextField();
    textTF.setInputPrompt("Enter new headline or choose from previous ones below");
    textTF.setWidth("100%");
    textTF.addStyleName("m-blogtextfield");
    layout.addComponent(textTF);

    layout.addComponent(toolTipLab = new Label("Enter headline tooltip:"));
    toolTipTF = new TextField();
    toolTipTF.setWidth("100%");
    layout.addComponent(toolTipTF);

    layout.addComponent(urlLab = new Label("Enter blog entry url:"));
    urlTF = new TextField();
    urlTF.setWidth("100%");
    layout.addComponent(urlTF);

    table = new Table("Previous headlines");
    table.setSizeFull();
    table.setImmediate(true);
    table.setColumnExpandRatio("date", 1);
    table.setColumnExpandRatio("text", 1);
    table.setColumnExpandRatio("tooltip", 1);
    table.setColumnExpandRatio("url", 1);
    table.setSelectable(true);
    table.setMultiSelect(true); // return whole pojo
    table.addItemClickListener(this);
    table.setContainerDataSource(MessageUrl.getContainer());
    layout.addComponent(table);

    layout.addComponent(nullCheckBox);
    nullCheckBox.addValueChangeListener(new CBListener());
    HorizontalLayout buttHl = new HorizontalLayout();
    buttHl.setSpacing(true);
    buttHl.addComponent(cancelButt);
    buttHl.addComponent(okButt);
    layout.addComponent(buttHl);
    layout.setComponentAlignment(buttHl, Alignment.TOP_RIGHT);
    layout.setExpandRatio(table, 1.0f); // gets all
    setWidth("675px");
    setHeight("455px");
}

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

License:Open Source License

@HibernateSessionThreadLocalConstructor
public DefineAwardsDialog() {
    setCaption("Define Player Award Types");
    setModal(true);/*from w  ww . j a  va2 s.  c o  m*/
    setSizeUndefined();
    setWidth("700px");
    setHeight("400px");

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

    vLay.addComponent(new HtmlLabel("<b>This dialog is not yet functional</b>"));

    Panel p = new Panel();
    p.setWidth("99%");
    p.setHeight("100%");
    vLay.addComponent(p);
    vLay.setExpandRatio(p, 1.0f);

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

    HorizontalLayout buttPan = new HorizontalLayout();
    buttPan.setWidth("100%");
    buttPan.setSpacing(true);
    NativeButton addButt = new NativeButton("Add new type", new AddListener());
    NativeButton delButt = new NativeButton("Delete type", new DelListener());
    NativeButton saveButt = new NativeButton("Save", new SaveListener());
    NativeButton cancelButt = new NativeButton("Cancel", new CancelListener());
    buttPan.addComponent(addButt);
    buttPan.addComponent(delButt);

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

    //temp
    saveButt.setEnabled(false);
    delButt.setEnabled(false);
}