List of usage examples for org.apache.wicket.markup.html.basic MultiLineLabel setVisible
public final Component setVisible(final boolean visible)
From source file:nl.mpi.lamus.web.components.ConfirmPanel.java
License:Open Source License
public ConfirmPanel(String id, final ModalWindow modalWindow, final ConfirmationOptions options) { super(id);/*w w w . j av a 2 s. c o m*/ Form confirmSubmitForm = new Form("confirmSubmitForm"); MultiLineLabel infoText = new MultiLineLabel("confirmation_info_text", options.getConfirmationInfoText()); confirmSubmitForm.add(infoText); confirmSubmitForm.add(new Label("confirmation_text", options.getConfirmationText())); CheckBox keepUnlinkedFilesCheckbox = new CheckBox("checkbox", Model.of(options.isKeepUnlinkedFiles())) { @Override protected void onSelectionChanged(Boolean newSelection) { options.setKeepUnlinkedFiles(newSelection); } @Override protected void onModelChanged() { options.setKeepUnlinkedFiles(getModelObject()); } }; keepUnlinkedFilesCheckbox.setLabel(Model.of("keep unlinked files")); confirmSubmitForm.add(keepUnlinkedFilesCheckbox); modalWindow.setTitle("Please confirm"); if (options.getConfirmationInfoText() != null && !options.getConfirmationInfoText().isEmpty()) { modalWindow.setInitialHeight(300); modalWindow.setInitialWidth(580); } else { infoText.setVisible(Boolean.FALSE); modalWindow.setInitialHeight(200); modalWindow.setInitialWidth(350); } AjaxButton yesButton = new AjaxButton("yesButton", confirmSubmitForm) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { if (target != null) { options.setConfirmed(true); modalWindow.close(target); } } }; AjaxButton noButton = new AjaxButton("noButton", confirmSubmitForm) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { if (target != null) { options.setConfirmed(false); modalWindow.close(target); } } }; confirmSubmitForm.add(yesButton); confirmSubmitForm.add(noButton); add(confirmSubmitForm); }