Example usage for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow getPage

List of usage examples for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow getPage

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow getPage.

Prototype

@Override
public final Page getPage() 

Source Link

Document

Gets the page holding this component.

Usage

From source file:org.dcm4chee.web.war.folder.StudyListPage.java

License:LGPL

private Link<Object> getStudyPermissionLink(final ModalWindow modalWindow,
        final AbstractEditableDicomModel model, TooltipBehaviour tooltip) {

    int[] winSize = WebCfgDelegate.getInstance().getWindowSize("studyPerm");
    ModalWindowLink studyPermissionLink = new ModalWindowLink("studyPermissions", modalWindow, winSize[0],
            winSize[1]) {// w ww  .  j a  v  a2s  .  c o  m

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            if (checkExists(model, target)) {
                modalWindow.setPageCreator(new ModalWindow.PageCreator() {

                    private static final long serialVersionUID = 1L;

                    @Override
                    public Page createPage() {
                        return new StudyPermissionsPage(model);
                    }
                });

                modalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {

                    private static final long serialVersionUID = 1L;

                    @Override
                    public void onClose(AjaxRequestTarget target) {
                        updateStudyPermissions();
                        query(target);
                        modalWindow.getPage().setOutputMarkupId(true);
                        target.addComponent(modalWindow.getPage());
                        target.addComponent(header);
                    }
                });
                modalWindow.add(new ModalWindowLink.DisableDefaultConfirmBehavior());
                modalWindow.setTitle("");
                modalWindow.setCloseButtonCallback(null);
                modalWindow.show(target);
            }
        }

        @Override
        public boolean isVisible() {
            return studyPermissionHelper.isManageStudyPermissions() && model.getDataset() != null
                    && !(model instanceof PatientModel && !((PatientModel) model).isExpandable());
        }
    };
    Image image = new Image("studyPermissionsImg", ImageManager.IMAGE_FOLDER_STUDY_PERMISSIONS);
    image.add(new ImageSizeBehaviour("vertical-align: middle;"));
    if (tooltip != null)
        image.add(tooltip);
    studyPermissionLink.add(image);
    return studyPermissionLink;
}