Search in sources :

Example 1 with ModalBody

use of org.gwtbootstrap3.client.ui.ModalBody in project kie-wb-common by kiegroup.

the class ModalFormDisplayerViewImpl method initialize.

@PostConstruct
public void initialize() {
    modal = new Modal();
    modal.setHideOtherModals(false);
    modal.setClosable(true);
    modal.setFade(true);
    modal.setDataKeyboard(true);
    modal.setDataBackdrop(ModalBackdrop.FALSE);
    modal.setSize(ModalSize.LARGE);
    modal.setRemoveOnHide(true);
    modalBody = new ModalBody();
    modalBody.add(this);
    modal.add(modalBody);
    submit = new Button(translationService.getTranslation(CrudComponentConstants.ModalFormDisplayerViewImplAccept));
    submit.setType(ButtonType.PRIMARY);
    cancel = new Button(translationService.getTranslation(CrudComponentConstants.ModalFormDisplayerViewImplCancel));
    modal.add(new ModalFooter() {

        {
            add(submit);
            add(cancel);
        }
    });
    submit.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            presenter.submitForm();
        }
    });
    cancel.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            doCancel();
        }
    });
    modal.addHiddenHandler(new ModalHiddenHandler() {

        @Override
        public void onHidden(ModalHiddenEvent evt) {
            doCancel();
        }
    });
}
Also used : ModalBody(org.gwtbootstrap3.client.ui.ModalBody) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(org.gwtbootstrap3.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ModalFooter(org.gwtbootstrap3.client.ui.ModalFooter) ModalHiddenHandler(org.gwtbootstrap3.client.shared.event.ModalHiddenHandler) Modal(org.gwtbootstrap3.client.ui.Modal) ModalHiddenEvent(org.gwtbootstrap3.client.shared.event.ModalHiddenEvent) PostConstruct(javax.annotation.PostConstruct)

Aggregations

ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 PostConstruct (javax.annotation.PostConstruct)1 ModalHiddenEvent (org.gwtbootstrap3.client.shared.event.ModalHiddenEvent)1 ModalHiddenHandler (org.gwtbootstrap3.client.shared.event.ModalHiddenHandler)1 Button (org.gwtbootstrap3.client.ui.Button)1 Modal (org.gwtbootstrap3.client.ui.Modal)1 ModalBody (org.gwtbootstrap3.client.ui.ModalBody)1 ModalFooter (org.gwtbootstrap3.client.ui.ModalFooter)1