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

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

Introduction

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

Prototype

public IModel<String> getTitle() 

Source Link

Document

Returns the title of the window.

Usage

From source file:gr.interamerican.wicket.factories.TestModalWindowFactory.java

License:Open Source License

/**
 * //from w w  w.j  av a2  s  .  co m
 */
@Test
public void testCreateModalWindow() {
    String path = "/gr/interamerican/wicket/factories/sample.properties"; //$NON-NLS-1$
    ModalWindow modalWindow = ModalWindowFactory.createModalWindow(path);
    Assert.assertSame(ModalWindow.class, modalWindow.getClass());
    Assert.assertEquals("userNotAuthorizedWindow", modalWindow.getId()); //$NON-NLS-1$
    Assert.assertEquals(400, modalWindow.getInitialWidth());
    Assert.assertEquals(200, modalWindow.getInitialHeight());
    Assert.assertEquals("PX", modalWindow.getWidthUnit()); //$NON-NLS-1$
    Assert.assertEquals("PX", modalWindow.getHeightUnit()); //$NON-NLS-1$
    Assert.assertFalse(modalWindow.isResizable());
    Assert.assertTrue(modalWindow.isUseInitialHeight());
    Assert.assertEquals("Authorization Failed", modalWindow.getTitle().getObject()); //$NON-NLS-1$

}

From source file:org.geoserver.security.web.AbstractListPageTest.java

License:Open Source License

protected void doRemove(String pathForLink) throws Exception {

    GeoserverTablePanelTestPage testPage = new GeoserverTablePanelTestPage(new ComponentBuilder() {
        private static final long serialVersionUID = 1L;

        public Component buildComponent(String id) {
            try {
                return listPage(null);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }//w  w w . ja v a 2  s . c  om
        }
    });

    tester.startPage(testPage);

    String selectAllPath = testPage.getWicketPath() + ":table:listContainer:selectAllContainer:selectAll";
    tester.assertComponent(selectAllPath, CheckBox.class);

    FormTester ft = tester.newFormTester(GeoserverTablePanelTestPage.FORM);
    ft.setValue(testPage.getComponentId() + ":table:listContainer:selectAllContainer:selectAll", "true");
    tester.executeAjaxEvent(selectAllPath, "onclick");

    ModalWindow w = (ModalWindow) tester.getLastRenderedPage().get("dialog:dialog");
    assertNull(w.getTitle()); // window was not opened
    tester.executeAjaxEvent(pathForLink, "onclick");
    assertNotNull(w.getTitle()); // window was opened        
    simulateDeleteSubmit();
    executeModalWindowCloseButtonCallback(w);
}

From source file:org.geoserver.security.web.AbstractTabbedListPageTest.java

License:Open Source License

protected void doRemove(String pathForLink) throws Exception {

    GeoserverTablePanelTestPage testPage = new GeoserverTablePanelTestPage(new ComponentBuilder() {
        private static final long serialVersionUID = 1L;

        public Component buildComponent(String id) {
            try {
                return listPage(getServiceName());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }/*from  www  .  ja va2 s .co  m*/
        }
    });

    tester.startPage(testPage);

    String selectAllPath = testPage.getWicketPath() + ":" + getTabbedPanelPath()
            + ":panel:table:listContainer:selectAllContainer:selectAll";
    tester.assertComponent(selectAllPath, CheckBox.class);

    FormTester ft = tester.newFormTester(GeoserverTablePanelTestPage.FORM);
    ft.setValue(testPage.getComponentId() + ":" + getTabbedPanelPath()
            + ":panel:table:listContainer:selectAllContainer:selectAll", "true");
    tester.executeAjaxEvent(selectAllPath, "onclick");

    String windowPath = testPage.getWicketPath() + ":" + getTabbedPanelPath() + ":panel:dialog:dialog";
    ModalWindow w = (ModalWindow) testPage.get(windowPath);
    assertNull(w.getTitle()); // window was not opened
    tester.executeAjaxEvent(pathForLink, "onclick");
    assertNotNull(w.getTitle()); // window was opened        
    simulateDeleteSubmit();
    executeModalWindowCloseButtonCallback(w);
}