Example usage for com.vaadin.ui Alignment MIDDLE_RIGHT

List of usage examples for com.vaadin.ui Alignment MIDDLE_RIGHT

Introduction

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

Prototype

Alignment MIDDLE_RIGHT

To view the source code for com.vaadin.ui Alignment MIDDLE_RIGHT.

Click Source Link

Usage

From source file:edu.kit.dama.ui.components.ConfirmationWindow7.java

License:Apache License

/**
 * Builds a customized subwindow <b>ConfirmationWindow</b> that allows the
 * user to confirm his previously requested action.
 *
 * @param pTitle The title of the window.
 * @param pMessage The message shown in the window.
 * @param pOptionType The type of the window (OK or YES_NO) which defines the
 * visible buttons.//from ww w  .j  a  v a 2s. co m
 * @param pMessageType The message type (INFORMATION, WARNING, ERROR) which
 * determines the icon. If pMessageType is null, no icon will be shown.
 * @param pListener The listener which receives the result if a button was
 * pressed or the window was closed.
 *
 */
ConfirmationWindow7(String pTitle, String pMessage, OPTION_TYPE pOptionType, MESSAGE_TYPE pMessageType,
        IConfirmationWindowListener7 pListener) {
    this.listener = pListener;
    //basic setup

    //set caption depending on type
    String caption = pTitle;
    if (caption == null) {
        if (pMessageType != null) {
            switch (pMessageType) {
            case QUESTION:
                caption = DEFAULT_TITLE;
                break;
            case INFORMATION:
                caption = "Information";
                break;
            case WARNING:
                caption = "Warning";
                break;
            case ERROR:
                caption = "Error";
                break;
            }
        } else {
            //no type provided...use default title
            caption = DEFAULT_TITLE;
        }
    }

    setCaption(caption);
    setModal(true);
    center();

    // Build line of buttons depending on pOptionType
    HorizontalLayout buttonLine = new HorizontalLayout();
    buttonLine.setSpacing(true);
    buttonLine.setWidth("100%");
    //add spacer
    Label spacer = new Label();
    buttonLine.addComponent(spacer);
    //add buttons
    if (OPTION_TYPE.YES_NO_OPTION.equals(pOptionType)) {
        buttonLine.addComponent(buildYesButton("Yes"));
        buttonLine.addComponent(buildNoButton());
        buttonLine.setComponentAlignment(yesButton, Alignment.MIDDLE_RIGHT);
        buttonLine.setComponentAlignment(noButton, Alignment.MIDDLE_RIGHT);
        //Assign ENTER to the YES button
        yesButton.setClickShortcut(ShortcutAction.KeyCode.ENTER, null);
        //Assign ESC to the NO button
        noButton.setClickShortcut(ShortcutAction.KeyCode.ESCAPE, null);
    } else {
        buttonLine.addComponent(buildYesButton("OK"));
        buttonLine.setComponentAlignment(yesButton, Alignment.MIDDLE_RIGHT);
        //Assign ENTER to the OK button
        yesButton.setClickShortcut(ShortcutAction.KeyCode.ENTER, null);
        //Assign ESC to close the dialog
        setCloseShortcut(ShortcutAction.KeyCode.ESCAPE, null);
    }

    buttonLine.setExpandRatio(spacer, 1.0f);

    //determine the icon depending on pMessageType
    ThemeResource icon = null;

    if (pMessageType != null) {
        switch (pMessageType) {
        case QUESTION:
            icon = new ThemeResource("img/24x24/question.png");
            break;
        case INFORMATION:
            icon = new ThemeResource("img/24x24/information.png");
            break;
        case WARNING:
            icon = new ThemeResource("img/24x24/warning.png");
            break;
        case ERROR:
            icon = new ThemeResource("img/24x24/forbidden.png");
            break;
        }
    }
    Component iconComponent = new Label();
    if (icon != null) {
        //icon was set, overwrite icon component
        iconComponent = new Image(null, icon);
    }

    //build the message label
    Label message = new Label(pMessage, ContentMode.HTML);
    message.setSizeUndefined();
    //build the main layout
    GridLayout mainLayout = new UIUtils7.GridLayoutBuilder(2, 2)
            .addComponent(iconComponent, Alignment.TOP_LEFT, 0, 0, 1, 1).addComponent(message, 1, 0, 1, 1)
            .addComponent(buttonLine, 0, 1, 2, 1).getLayout();
    mainLayout.setMargin(true);
    mainLayout.setSpacing(true);
    mainLayout.setColumnExpandRatio(0, .05f);
    mainLayout.setColumnExpandRatio(1, 1f);
    mainLayout.setRowExpandRatio(0, 1f);
    mainLayout.setRowExpandRatio(1, .05f);
    setContent(mainLayout);

    //add the close listener
    addCloseListener(new CloseListener() {
        @Override
        public void windowClose(CloseEvent e) {
            fireCloseEvents(RESULT.CANCEL);
        }
    });
}

From source file:edu.nps.moves.mmowgli.AbstractMmowgliController.java

License:Open Source License

@SuppressWarnings("serial")
private void handleAdminMessage(Game g) {
    final Window dialog = new Window("Important!");
    VerticalLayout vl = new VerticalLayout();
    dialog.setContent(vl);/*from w  w  w  . j  av a2  s.c om*/
    vl.setSizeUndefined();
    vl.setMargin(true);
    vl.setSpacing(true);

    vl.addComponent(new HtmlLabel(g.getAdminLoginMessage()));

    HorizontalLayout buttHL = new HorizontalLayout();
    buttHL.setSpacing(true);
    final CheckBox cb;
    buttHL.addComponent(cb = new CheckBox("Show this message again on the next administrator login"));
    cb.setValue(true);
    Button closeButt;
    buttHL.addComponent(closeButt = new Button("Close"));
    closeButt.addClickListener(new ClickListener() {
        @Override
        @MmowgliCodeEntry
        @HibernateOpened
        @HibernateClosed
        public void buttonClick(ClickEvent event) {
            if (Boolean.parseBoolean(cb.getValue().toString()))
                ; // do nothing
            else {
                HSess.init();
                Game.getTL().setAdminLoginMessage(null);
                Game.updateTL();
                HSess.close();
            }
            UI.getCurrent().removeWindow(dialog);
        }
    });

    vl.addComponent(buttHL);
    vl.setComponentAlignment(buttHL, Alignment.MIDDLE_RIGHT);

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

From source file:edu.nps.moves.mmowgli.AbstractMmowgliControllerHelper.java

License:Open Source License

void handleShowActiveUsersPerServer(MenuBar mbar) {
    Object[][] oa = Mmowgli2UI.getGlobals().getSessionCountByServer();

    Window svrCountWin = new Window("Display Active Users Per Server");
    svrCountWin.setModal(true);/*from w w  w .  j av  a2  s  .c o m*/
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setWidth("99%");
    svrCountWin.setContent(layout);

    GridLayout gl = new GridLayout(2, Math.max(1, oa.length));
    gl.setSpacing(true);
    gl.addStyleName("m-greyborder");
    for (Object[] row : oa) {
        Label lab = new Label();
        lab.setSizeUndefined();
        lab.setValue(row[0].toString());
        gl.addComponent(lab);
        gl.setComponentAlignment(lab, Alignment.MIDDLE_RIGHT);

        gl.addComponent(new Label(row[1].toString()));
    }
    layout.addComponent(gl);
    layout.setComponentAlignment(gl, Alignment.MIDDLE_CENTER);

    svrCountWin.setWidth("250px");
    UI.getCurrent().addWindow(svrCountWin);
    svrCountWin.center();
}

From source file:edu.nps.moves.mmowgli.AbstractMmowgliControllerHelper.java

License:Open Source License

public void handleDumpEmailsTL() {
    final TextField tf;

    final Window dialog = new Window("Filter Player Email Dump");
    dialog.setModal(true);/*w ww.j av  a2  s  .co m*/

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

    final OptionGroup radios = new OptionGroup(null, Arrays.asList(opts));
    layout.addComponent(radios);

    layout.addComponent(tf = new MTextField().withWidth("50%"));
    tf.setCaption("value");

    Label lab;

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

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

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

    @SuppressWarnings("serial")
    Button addButt = new Button("Dump", new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            Float val = null;
            String valS = "";
            boolean parseError = false;
            try {
                val = Float.parseFloat(tf.getValue());
                valS = formatter.valueToString(val);
            } catch (Exception ex) {
                parseError = true;
            }

            HSess.init();
            Object sel = radios.getValue();
            Criteria crit = null;
            String windowTitle = "";
            boolean isExpl = true;
            if (sel == allp) {
                crit = HSess.get().createCriteria(User.class);
                windowTitle = new String("All users");
                isExpl = true;
                if (parseError) {
                    Notification.show("Value ignored", Notification.Type.WARNING_MESSAGE);
                    System.out.println("Tried to show a Notification");
                }
            } else if (sel == grex) {
                crit = getExplorationGreaterThanTL(val);
                windowTitle = "Users with exploration points greater than " + valS;
                isExpl = true;
            } else if (sel == lsex) {
                crit = getExplorationLessThanTL(val);
                windowTitle = "Users with exploration points less than " + valS;
                isExpl = true;
            } else if (sel == grim) {
                crit = getImplementationGreaterThanTL(val);
                windowTitle = "Users with implementation points greater than " + valS;
                isExpl = false;
            } else if (sel == lsim) {
                crit = getImplementationLessThanTL(val);
                windowTitle = "Users with implementation points less than " + valS;
                isExpl = false;
            }

            if (crit != null) {
                @SuppressWarnings("unchecked")
                List<User> lis = (List<User>) crit.list();
                StringBuilder sb = new StringBuilder();
                handleEmailListNoHeader(lis, sb, isExpl);

                String title = windowTitle + " - " + UUID.randomUUID();
                BrowserWindowOpener.openWithInnerHTML(sb.toString(), title, "_blank");
            } else {
                Notification.show("Invalid value", Notification.Type.ERROR_MESSAGE);
                HSess.close();
                return;
            }

            dialog.close();
            HSess.close();
        }
    });

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

    layout.addComponent(hl);

    hl.setWidth("100%");

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

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

From source file:edu.nps.moves.mmowgli.components.Leaderboard.java

License:Open Source License

public void initGuiTL() {
    setSizeUndefined();//from w  w w .j  a  v  a 2s.  c  om
    setWidth(APPLICATION_SCREEN_WIDTH);
    setSpacing(false);

    MmowgliSessionGlobals globs = Mmowgli2UI.getGlobals();
    Label sp;

    HorizontalLayout titleHL = new HorizontalLayout();
    addComponent(titleHL);
    titleHL.setMargin(new MarginInfo(false, true, false, true)); //sides only
    titleHL.setWidth("100%");

    Component c;
    titleHL.addComponent(c = globs.getMediaLocator().getLeaderboardTitle());
    titleHL.setComponentAlignment(c, Alignment.MIDDLE_LEFT);
    titleHL.setExpandRatio(c, .5f);

    maybeShowMoveSelector(titleHL);

    tips.setStyleName(BaseTheme.BUTTON_LINK);
    tips.addStyleName("m-link-button");
    titleHL.addComponent(tips);
    titleHL.setComponentAlignment(tips, Alignment.MIDDLE_RIGHT);
    titleHL.setExpandRatio(tips, 0.5f);

    tableVLayout = new VerticalLayout();
    tableVLayout.setSizeUndefined();
    tableVLayout.setWidth(APPLICATION_SCREEN_WIDTH);
    tableVLayout.setSpacing(true);
    tableVLayout.setMargin(true);
    tableVLayout.addStyleName("m-whitepage-header");

    addComponent(tableVLayout);

    tableVLayout.addComponent(sp = new Label());
    sp.setHeight("20px"); // to fit top of background

    tableVLayout.addComponent(table = createTableTL());
    tableVLayout.setComponentAlignment(table, Alignment.TOP_CENTER);
    table.setValue(globs.getUserID());
    tableVLayout.setExpandRatio(table, 1.0f);

    /* I can't get this to properly refresh, todo
    refreshButt = new Button("Refresh");
    mainVLayout.addComponent(refreshButt);
    mainVLayout.setComponentAlignment(refreshButt, Alignment.TOP_CENTER);
            
    refreshButt.addListener(new RefreshListener());
    refreshButt.setEnabled(false);
    */
}

From source file:edu.nps.moves.mmowgli.components.SendMessageWindow.java

License:Open Source License

@HibernateSessionThreadLocalConstructor
public SendMessageWindow(List<String> emails) {
    super("A message to mmowgli followers");

    this.emails = emails;

    setModal(true);/*from   ww w . j a v  a2 s. c o m*/
    VerticalLayout layout = new VerticalLayout();
    setContent(layout);
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setWidth("100%");
    layout.setHeight("100%");

    Label lab = new Label(makeString(emails));
    lab.setCaption("To: (other addresses hidden from each recipient)");
    lab.setDescription(lab.getValue().toString());
    lab.addStyleName("m-nowrap");
    //   lab.setHeight("100%"); // makes label clip
    lab.addStyleName("m-greyborder");
    layout.addComponent(lab);

    subjTf = new TextField();
    subjTf.setCaption("Subject:");
    subjTf.setWidth("100%");

    Game game = Game.getTL();
    String acronym = game.getAcronym();
    acronym = acronym == null ? "" : acronym + " ";
    subjTf.setValue("Message from " + acronym + "Mmowgli");
    layout.addComponent(subjTf);

    ta = new TextArea();
    ta.setCaption("Content: (may include HTML tags)");
    ta.setRows(10);
    ta.setColumns(50);
    ta.setWidth("100%");
    ta.setHeight("100%");
    ta.setInputPrompt("Type message here");
    layout.addComponent(ta);
    layout.setExpandRatio(ta, 1.0f);
    HorizontalLayout buttHL = new HorizontalLayout();
    buttHL.setSpacing(true);

    ClickListener closeListener = new SignupsWindowCloser(this);
    cancelButt = new Button("Cancel", closeListener);
    buttHL.addComponent(cancelButt);

    sendButt = new Button("Send", closeListener);
    sendButt.addClickListener(closeListener);
    buttHL.addComponent(sendButt);

    layout.addComponent(buttHL);
    layout.setComponentAlignment(buttHL, Alignment.MIDDLE_RIGHT);
    setWidth("650px");
    setHeight("500px");
    UI.getCurrent().addWindow(this);
    ta.focus();
}

From source file:edu.nps.moves.mmowgli.components.SendMessageWindow.java

License:Open Source License

public SendMessageWindow(User user, boolean ccSelf, MailManager.Channel channel, boolean showCcTroubleList) {
    super("A message to " + user.getUserName());

    this.usr = user;
    this.ccSelf = ccSelf;
    this.channel = channel;

    setModal(true);//from   ww  w  . j a  va2 s  .c  om
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    setContent(layout);

    subjTf = new TextField();
    subjTf.setCaption("Subject");
    subjTf.setWidth("100%");

    User me = Mmowgli2UI.getGlobals().getUserTL();
    Game game = Game.getTL();
    String acronym = game.getAcronym();
    acronym = acronym == null ? "" : acronym + " ";
    subjTf.setValue(acronym + "Mmowgli message to " + usr.getUserName() + " from " + me.getUserName());
    layout.addComponent(subjTf);
    if (showCcTroubleList) {
        layout.addComponent(ccTroubleListCB = new CheckBox("CC mmowgli trouble list"));
        ccTroubleListCB.setValue(false);
    }
    ta = new TextArea();
    ta.setCaption("Content");
    ta.setRows(10);
    ta.setColumns(50);
    ta.setInputPrompt("Type message here");
    layout.addComponent(ta);

    HorizontalLayout buttHL = new HorizontalLayout();
    buttHL.setSpacing(true);

    WindowCloser closeListener = new WindowCloser(this);
    cancelButt = new Button("Cancel", closeListener);
    buttHL.addComponent(cancelButt);

    sendButt = new Button("Send", closeListener);//new IDButton("Send", SENDPRIVATEMESSAGECLICK, user);
    sendButt.addClickListener(closeListener);
    buttHL.addComponent(sendButt);

    layout.addComponent(buttHL);
    layout.setComponentAlignment(buttHL, Alignment.MIDDLE_RIGHT);
    layout.setSizeUndefined(); // does a "pack"

    UI.getCurrent().addWindow(this);
    ta.focus();
}

From source file:edu.nps.moves.mmowgli.components.SignupsTable.java

License:Open Source License

@SuppressWarnings("serial")
public static void showDialog(String title) {
    final Button bulkMailButt = new Button("Initiate bulk mail job sending to filtered list");

    final Button emailButt = new Button("Compose email");
    emailButt.setDescription("Opens editing dialog to compose an email message to the selected individuals");
    final Button displayButt = new Button("Display as plain text");
    Button closeButt;//from   w ww.  jav a  2s  .  c  o  m

    final SignupsTable tab = new SignupsTable(null, null, new ValueChangeListener() // selected
    {
        @Override
        public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
            emailButt.setEnabled(true);
        }
    });

    final Window dialog = new Window(title);
    dialog.setWidth("950px");
    dialog.setHeight("650px");

    VerticalLayout vl = new VerticalLayout();
    dialog.setContent(vl);
    vl.setSizeFull();
    vl.setMargin(true);
    vl.setSpacing(true);
    addFilterCheckBoxes(vl);
    vl.addComponent(new Label("Individuals who have established game accounts are shown faintly"));

    tab.setSizeFull();
    vl.addComponent(tab);
    vl.setExpandRatio(tab, 1.0f);

    HorizontalLayout buttHL = new HorizontalLayout();
    buttHL.setSpacing(true);

    buttHL.addComponent(bulkMailButt);
    bulkMailButt.setImmediate(true);
    ;
    Label lab = new Label("");
    buttHL.addComponent(lab);
    buttHL.setExpandRatio(lab, 1.0f);

    buttHL.addComponent(emailButt);
    emailButt.setImmediate(true);
    buttHL.addComponent(displayButt);
    displayButt.setImmediate(true);
    buttHL.addComponent(closeButt = new Button("Close"));
    closeButt.setImmediate(true);

    emailButt.setEnabled(false);

    closeButt.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            dialog.close();
        }
    });

    emailButt.addClickListener(new ClickListener() {
        @SuppressWarnings("rawtypes")
        @Override
        public void buttonClick(ClickEvent event) {
            HSess.init();
            Set set = (Set) tab.getValue();
            ArrayList<String> emails = new ArrayList<String>(set.size());
            Iterator itr = set.iterator();
            while (itr.hasNext()) {
                QueryWrapper wrap = (QueryWrapper) itr.next();
                emails.add(wrap.getEmail());
            }
            new SendMessageWindow(emails);
            HSess.close();
        }
    });

    displayButt.addClickListener(new ClickListener() {
        @Override
        @MmowgliCodeEntry
        @HibernateOpened
        @HibernateClosed
        public void buttonClick(ClickEvent event) {
            HSess.init();
            dumpSignupsTL();
            HSess.close();
        }
    });

    bulkMailButt.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            BulkMailHandler.showDialog((QueryContainer) tab.getContainerDataSource());
        }
    });

    vl.addComponent(buttHL);
    vl.setComponentAlignment(buttHL, Alignment.MIDDLE_RIGHT);

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

From source file:edu.nps.moves.mmowgli.export.BaseExporter.java

License:Open Source License

protected void getMetaStringOrCancel(final MetaListener lis, String title, final Map<String, String> params) {
    final Window dialog = new Window(title);
    final TextField[] parameterFields;

    dialog.setModal(true);/*  w  w  w .  j  a  v a 2  s  .co m*/

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

    final TextArea ta = new TextArea();
    ta.setWidth("100%");
    ta.setInputPrompt("Type a description of this data, or the game which generated this data (optional)");

    ta.setImmediate(true);
    layout.addComponent(ta);

    Set<String> keySet = params.keySet();
    parameterFields = new TextField[keySet.size()];
    int i = 0;
    GridLayout pGL = new GridLayout();
    pGL.addStyleName("m-greyborder");
    pGL.setColumns(2);
    Label hdr = new HtmlLabel("<b>Parameters</b>");
    hdr.addStyleName("m-textaligncenter");
    pGL.addComponent(hdr, 0, 0, 1, 0); // top row
    pGL.setComponentAlignment(hdr, Alignment.MIDDLE_CENTER);
    pGL.setSpacing(false);
    for (String key : keySet) {
        pGL.addComponent(new HtmlLabel("&nbsp;" + key + "&nbsp;&nbsp;"));
        pGL.addComponent(parameterFields[i] = new TextField());
        parameterFields[i++].setValue(params.get(key));
    }
    if (i > 0) {
        layout.addComponent(pGL);
        layout.setComponentAlignment(pGL, Alignment.TOP_CENTER);
    }

    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 exportButt = new Button("Export", new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            dialog.close();

            Set<String> keySet = params.keySet();
            int i = 0;
            for (String key : keySet)
                params.put(key, parameterFields[i++].getValue().toString());

            lis.continueOrCancel(ta.getValue().toString());
        }
    });
    hl.addComponent(cancelButt);
    hl.addComponent(exportButt);
    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("385px");
    dialog.setHeight("310px");
    hl.setWidth("100%");
    ta.setWidth("100%");
    ta.setHeight("100%");
    layout.setExpandRatio(ta, 1.0f);

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

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);/*from w  w  w  .ja va  2 s . c  om*/
    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);
}