List of usage examples for org.apache.wicket.markup.html.image ContextImage setOutputMarkupId
public final Component setOutputMarkupId(final boolean output)
From source file:org.obiba.onyx.webapp.base.page.BasePage.java
License:Open Source License
public BasePage() { super();/*from w w w.ja v a2 s. co m*/ add(reusableConfirmationDialog); reusablePrintDialog.addFormValidator(printableReportPanel.getFormValidator()); reusablePrintDialog.setCloseButtonCallback(new CloseButtonCallback() { private static final long serialVersionUID = 1L; public boolean onCloseButtonClicked(AjaxRequestTarget target, Status status) { if (status == null || status.equals(Status.WINDOW_CLOSED)) { return true; } else if (status.equals(Status.SUCCESS)) { printableReportPanel.printReports(); FeedbackPanel feedbackPanel = new FeedbackPanel("content"); if (!feedbackPanel.anyErrorMessage()) { printableReportPanel.getFeedbackWindow().setCloseButtonCallback(new CloseButtonCallback() { private static final long serialVersionUID = 1L; public boolean onCloseButtonClicked(AjaxRequestTarget target1, Status status1) { // Close the print dialog when the user dismisses the success message. reusablePrintDialog.close(target1); return true; } }); } printableReportPanel.getFeedbackWindow().setContent(feedbackPanel); printableReportPanel.getFeedbackWindow().show(target); return false; } else if (status.equals(Status.ERROR)) { printableReportPanel.getFeedbackWindow().setContent(new FeedbackPanel("content")); printableReportPanel.getFeedbackWindow().show(target); return false; } return true; } }); reusablePrintDialog.setWidthUnit("em"); reusablePrintDialog.setHeightUnit("em"); reusablePrintDialog.setInitialHeight(34); reusablePrintDialog.setInitialWidth(50); add(reusablePrintDialog); ContextImage img = new ContextImage("logo", new Model<String>("images/logo/logo_on_dark.png")); img.setMarkupId("logo"); img.setOutputMarkupId(true); Panel headerPanel = new EmptyPanel("header"); Panel menuBar = new EmptyPanel("menuBar"); menuBar.setMarkupId("menuBar"); setOutputMarkupId(true); Label userFullName = new Label("userFullName"); Label currentTime = new Label("currentTime"); Panel battery = new EmptyPanel("battery"); Session session = getSession(); // Tests the session type for unit testing if (session instanceof OnyxAuthenticatedSession) { if (((OnyxAuthenticatedSession) getSession()).isSignedIn()) { headerPanel = new HeaderPanel("header"); menuBar = new MenuBar("menuBar"); userFullName.setDefaultModel(new Model(OnyxAuthenticatedSession.get().getUserName())); currentTime.setDefaultModel(DateModelUtils.getDateTimeModel( new Model<DateFormat>(new SimpleDateFormat("yyyy-MM-dd - HH:mm:ss", getLocale())), new Model<Date>(new Date()))); battery = new BatteryLevelIndicator("battery"); } } add(currentTime); add(battery); add(img); add(userFullName); add(headerPanel); add(menuBar); add(new Label("baseAjaxIndicator", new StringResourceModel("Processing", this, null))); }
From source file:org.obiba.onyx.webapp.participant.page.InterviewPage.java
License:Open Source License
private ContextImage createContextImage(String id, String image) { ContextImage commentIcon = new ContextImage(id, new Model(image)); commentIcon.setMarkupId(id);//from w w w.j a v a2s . c o m commentIcon.setOutputMarkupId(true); return commentIcon; }