Package com.github.gwtbootstrap.client.ui

Examples of com.github.gwtbootstrap.client.ui.Modal


    }

    public void setSize( final int width,
                         final int height ) {
        if ( getParent().getParent().getParent() instanceof Modal ) {
            final Modal modal = (Modal) getParent().getParent().getParent();
            modal.setWidth( width + "px" );
            modal.setHeight( height + "px" );
            modal.getElement().getStyle().setMarginLeft( ( width / 2 ) * -1, Style.Unit.PX );
            modal.getElement().getStyle().setMarginTop( ( height / 2 ) * -1, Style.Unit.PX );
            getParent().getParent().removeStyleName( "modal-body" );
            super.setSize( width + "px", ( height - 51 ) + "px" );
        }
    }
View Full Code Here


    *       GwtBootstrapModule(); module.onModuleLoad(); }
    **/

   @Test
   public void testModal() {
      Modal modal = new Modal();
      modal.add(new Label("Modal"));

      ModalFooter footer = new ModalFooter();
      footer.add(new Button("close"));
      modal.add(footer);

      modal.addShowHandler(showHandler);
      modal.addShownHandler(shownHandler);
      modal.addHideHandler(hideHandler);
      modal.addHiddenHandler(hiddenHandler);

      assertFalse(modal.isVisible());

      modal.show();
      assertTrue(modal.isVisible());

      verify(showHandler).onShow(any(ShowEvent.class));
      verify(shownHandler).onShown(any(ShownEvent.class));

      modal.hide();
      assertFalse(modal.isVisible());

      verify(hideHandler).onHide(any(HideEvent.class));
      verify(hiddenHandler).onHidden(any(HiddenEvent.class));

      modal.toggle();
      assertTrue(modal.isVisible());

      // for unsetHandlerFunctions
      modal.setDynamicSafe(true);
      modal.hide();
   }
View Full Code Here

TOP

Related Classes of com.github.gwtbootstrap.client.ui.Modal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.