/*
- * 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
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("<p>Your session has expired. You will have to reauthenticate with your Identity Provider.</p> ");
- 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);
}
// 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;
}
}
-
-
-
}