X-Git-Url: https://code.grnet.gr/git/pithos-web-client/blobdiff_plain/749068baa7761f90d9896c1e2a70586afc655a04..ae1e8bca41220b840776d93558dc653830cf8eae:/src/gr/grnet/pithos/web/client/SessionExpiredDialog.java diff --git a/src/gr/grnet/pithos/web/client/SessionExpiredDialog.java b/src/gr/grnet/pithos/web/client/SessionExpiredDialog.java index e0b0d1f..199c81a 100644 --- a/src/gr/grnet/pithos/web/client/SessionExpiredDialog.java +++ b/src/gr/grnet/pithos/web/client/SessionExpiredDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 GRNET S.A. All rights reserved. + * Copyright 2011-2012 GRNET S.A. All rights reserved. * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following @@ -47,31 +47,41 @@ import com.google.gwt.user.client.ui.VerticalPanel; public class SessionExpiredDialog extends DialogBox { + protected Pithos app; /** * The widget constructor. */ - public SessionExpiredDialog() { + public SessionExpiredDialog(Pithos _app) { + app = _app; // Set the dialog's caption. setText("Session Expired"); setAnimationEnabled(true); + setGlassEnabled(true); + setStyleName("pithos-DialogBox"); + VerticalPanel outer = new VerticalPanel(); + VerticalPanel inner = new VerticalPanel(); + inner.addStyleName("inner"); + // Create the text and set a style name so we can style it with CSS. HTML text = new HTML("

Your session has expired. You will have to reauthenticate with your Identity Provider.

"); - text.setStyleName("pithos-AboutText"); - outer.add(text); + text.setStyleName("pithos-sessionExpired"); + inner.add(text); // Create the 'OK' button, along with a listener that hides the dialog // when the button is clicked. Button confirm = new Button("Proceed", new ClickHandler() { @Override public void onClick(ClickEvent event) { - Pithos.get().authenticateUser(); + app.authenticateUser(); hide(); } }); - outer.add(confirm); - outer.setCellHorizontalAlignment(confirm, HasHorizontalAlignment.ALIGN_CENTER); + confirm.addStyleName("button"); + inner.add(confirm); + outer.add(inner); + outer.setCellHorizontalAlignment(inner, HasHorizontalAlignment.ALIGN_CENTER); outer.setSpacing(8); setWidget(outer); } @@ -86,15 +96,9 @@ public class SessionExpiredDialog extends DialogBox { // enter or escape is pressed. switch (evt.getKeyCode()) { case KeyCodes.KEY_ENTER: - Pithos.get().authenticateUser(); - hide(); - break; - case KeyCodes.KEY_ESCAPE: + app.authenticateUser(); hide(); break; } } - - - }