Skip to content

Commit

Permalink
[modalx] Default initStyles() is modified to set Theme
Browse files Browse the repository at this point in the history
  • Loading branch information
solomax committed Dec 3, 2024
1 parent e949579 commit 720a3c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class HomePage extends ModalXPage implements IWindowCloseListener

/**
* Constructor that is invoked when page is invoked without a session.
*
*
* @param parameters
* Page parameters
*/
Expand Down Expand Up @@ -109,7 +109,7 @@ public void onClick(AjaxRequestTarget target)
* ModalFormPanel (including MessageBox) is closed. Pass the listener into the constructor of
* the ModelFormPanel or MessageBox
*/
@Override
@Override
public void windowClosed(Panel panel, AjaxRequestTarget target)
{
if (panel instanceof ModalFormPanel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/**
* � 2006, 2009. Step Ahead Software Pty Ltd. All rights reserved.
*
*
* Source file created and managed by Javelin (TM) Step Ahead Software. To
* maintain code and model synchronization you may directly edit code in method
* bodies and any sections starting with the 'Keep_*' marker. Make all other
Expand All @@ -15,6 +15,7 @@
import java.util.Optional;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalDialog;
import org.apache.wicket.extensions.ajax.markup.html.modal.theme.DefaultTheme;
import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.request.resource.PackageResourceReference;
Expand All @@ -27,7 +28,7 @@
* Class Name : ModalContentWindow Diagram : Wicket Generic Modal Windows Project : Echobase
* framework Type : concrete Specialized form of ModalWindow that knows how to interact with
* ModelContentPanels in a way which simplifies the code that opens a modal window.
*
*
* @author Chris Colman
*/
public class ModalContentWindow extends ModalDialog
Expand All @@ -42,8 +43,8 @@ public class ModalContentWindow extends ModalDialog

protected ModalMgr modalMgr;

protected WindowClosedCallback windowClosedCallback;
protected WindowClosedCallback windowClosedCallback;

// -[Methods]-

/**
Expand All @@ -59,6 +60,7 @@ public ModalMgr getModalMgr()
*/
public void initStyles()
{
add(new DefaultTheme());
}

@Override
Expand All @@ -81,7 +83,7 @@ public ModalContentWindow(ModalMgr iModalMgr, String id, boolean maskBehind)
initStyles();
}


public void setWindowClosedCallback(final WindowClosedCallback callback) {
this.windowClosedCallback = callback;
}
Expand All @@ -91,7 +93,7 @@ public ModalDialog close(AjaxRequestTarget target) {
Optional.ofNullable(windowClosedCallback).ifPresent(w -> w.onClose(target));
return super.close(target);
}

/**
* Callback called after the window has been closed. If no callback instance is specified using
* {@link BaseModal#setWindowClosedCallback(BaseModal.WindowClosedCallback)}, no ajax
Expand All @@ -106,5 +108,5 @@ public interface WindowClosedCallback extends IClusterable {
* @param target {@link org.apache.wicket.ajax.AjaxRequestTarget} instance bound with the ajax request.
*/
void onClose(AjaxRequestTarget target);
}
}
}

0 comments on commit 720a3c8

Please sign in to comment.