Java Code Examples for org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow#setMinimalHeight()

The following examples show how to use org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow#setMinimalHeight() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractUploadFilePanel.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
public AbstractUploadFilePanel(String id, final ModalWindow modal,final AbstractModalWindowCommand<?> command) {
	super(id);
	modal.setMinimalHeight(300);
	modal.showUnloadConfirmation(false);
	Form<?> uploadForm = new Form<Object>("uploadForm");
	final FileUploadField inputFile = new FileUploadField("inputFile");
	uploadForm.add(inputFile);
	uploadForm.add(new AjaxButton("loadFile",getLoadButtonTitle(),uploadForm)
	{
		private static final long serialVersionUID = 1L;

		@Override
		protected void onSubmit(AjaxRequestTarget target) {
			FileUpload file = inputFile.getFileUpload();
			if (file!=null){
				onLoadFile(file);
				command.onAfterModalSubmit();
				modal.close(target);
			}
		}
		
	});
	add(uploadForm);		
}
 
Example 2
Source File: AddOArtifactCommand.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected void initializeContent(ModalWindow modal) {
    modal.setOutputMarkupPlaceholderTag(true);
    modal.setTitle(new ResourceModel(MODAL_WINDOW_TITLE));

    modal.setPageCreator(new ModalWindow.PageCreator() {
        @Override
        public Page createPage() {
            return modalWindowPage;
        }
    });

    modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        @Override
        public void onClose(AjaxRequestTarget target) {
            target.add(table);
        }
    });

    modal.setAutoSize(true);
    modal.setMinimalWidth(800);
    modal.setMinimalHeight(600);
    modalWindowPage.setModalWindow(modal);
}
 
Example 3
Source File: LinkToSocialNetwork.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public Command<?> createCommand(String id) {
    IModel<ODocument> model = (IModel<ODocument>) getContext().getDisplayObjectModel();
    IModel<OrienteerUser> userModel = new ODocumentWrapperModel<>(new OrienteerUser(model.getObject()));

    return new AbstractModalWindowCommand<OrienteerUser>(id, getTitleModel(), userModel) {

        @Override
        protected void onInitialize() {
            super.onInitialize();
            applyVisualSettings(this);
            applyBehaviors(this);
        }

        @Override
        protected void onConfigure() {
            super.onConfigure();
            OrienteerUser user = getModelObject();

            setVisible(user.getSocialNetworks().size() < OAuth2Repository.getOAuth2Services().size());
        }

        @Override
        protected void initializeContent(ModalWindow modal) {
            modal.setTitle(getTitleModel());
            modal.setMinimalWidth(520);
            modal.setMinimalHeight(250);
            modal.setContent(new LinkToSocialNetworkPanel(modal.getContentId(), getModel()));
        }

        @Override
        public void onAfterModalSubmit() {
            sendActionPerformed();
        }

    };
}
 
Example 4
Source File: OArchitectEditorWidget.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
private ModalWindow createModalWindow(String id) {
    ModalWindow modal = new ModalWindow(id);
    modal.setOutputMarkupId(true);
    modal.setInitialWidth(MODAL_WINDOW_WIDTH);
    modal.setInitialHeight(MODAL_WINDOW_HEIGHT);
    modal.setMinimalWidth(MODAL_WINDOW_WIDTH);
    modal.setMinimalHeight(MODAL_WINDOW_HEIGHT);
    modal.setWindowClosedCallback(t -> t.appendJavaScript(OArchitectJsUtils.switchPageScroll(false)));
    return modal;
}
 
Example 5
Source File: ViewUMLCommand.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
protected void initializeContent(ModalWindow modal) {
	modal.setTitle(new ResourceModel("command.viewUml.modal.title"));
	modal.setContent(new ViewUMLDialogPanel(modal.getContentId(), new PropertyModel<String>(this, "uml")));
	modal.setAutoSize(true);
	modal.setMinimalWidth(600);
	modal.setMinimalHeight(400);
}