Author: heiko.braun(a)jboss.com
Date: 2010-02-12 09:27:49 -0500 (Fri, 12 Feb 2010)
New Revision: 966
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/public/console.css
Log:
fix login behaviour and styles
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2010-02-12
11:42:58 UTC (rev 965)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2010-02-12
14:27:49 UTC (rev 966)
@@ -31,6 +31,7 @@
import com.mvc4g.client.Controller;
import com.mvc4g.client.ViewInterface;
import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.WidgetWrapper;
import org.gwt.mosaic.ui.client.WindowPanel;
import org.gwt.mosaic.ui.client.layout.*;
import org.jboss.bpm.console.client.util.ConsoleLog;
@@ -196,9 +197,10 @@
public void onLoginFailed(Request request, Throwable t)
{
- // auth failed
- MessageBox.error("Login failed", t.getMessage());
- ConsoleLog.error("Login failed", t);
+ // auth failed
+ window.hide();
+ //MessageBox.error("Login failed", t.getMessage());
+ alert("Login failed", t.getMessage());
}
}
);
@@ -226,6 +228,44 @@
}
}
+ private void alert(String caption, String message) {
+ final MessageBox alert = new MessageBox(MessageBox.MessageBoxType.ALERT, caption)
{
+ @Override
+ public void onClose(boolean result) {
+ hide();
+ window.show();
+ }
+ };
+ alert.setAnimationEnabled(false);
+ int preferredWidth = Window.getClientWidth();
+ preferredWidth = Math.max(preferredWidth / 3, 256);
+ alert.setWidth(preferredWidth + "px");
+
+ final Button buttonOK = new Button("OK");
+ buttonOK.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ alert.hide();
+ window.show();
+ }
+ });
+ alert.getButtonPanel().add(buttonOK);
+
+ alert.setWidget(new WidgetWrapper(new HTML(message),
+ HasAlignment.ALIGN_LEFT, HasAlignment.ALIGN_TOP));
+ alert.showModal();
+
+ if (alert.getOffsetWidth() < preferredWidth) {
+ alert.setWidth(preferredWidth + "px");
+ alert.center();
+ }
+
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ buttonOK.setFocus(true);
+ }
+ });
+ }
+
/**
* The 'layout' window panel.
*/
@@ -236,18 +276,10 @@
MosaicPanel panel = new MosaicPanel();
-
+ panel.addStyleName("bpm-login");
+
createLayoutContent(panel);
- window.setWidget(panel);
-
- window.addWindowClosingHandler(
- new Window.ClosingHandler() {
- public void onWindowClosing(Window.ClosingEvent event)
- {
- window = null;
- }
- }
- );
+ window.setWidget(panel);
}
/**
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/public/console.css
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/public/console.css 2010-02-12
11:42:58 UTC (rev 965)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/public/console.css 2010-02-12
14:27:49 UTC (rev 966)
@@ -6,6 +6,10 @@
background:#edf0f4 url(header_background.png) repeat-x;
}
+.bpm-login {
+ background: #edf0f4;
+}
+
.bpm-layout {
border: 1px solid green;
margin: 10px;
@@ -417,25 +421,15 @@
border-bottom: 1px solid #bcbcbc;
}
-
-/** navigation? ***/
-
-.mosaic-DropDownPanel,
-.mosaic-DropDownPanel .mosaic-ColumnWidget,
-.mosaic-DropDownPanel .mosaic-ScrollTreeTable {
- border-color: #F8F8F8;/*#aaa;*/
- border-style: solid;
- border-width: 1px 1px 1px 1px;
-}
-
/*** StackLayoutPanel ***/
.mosaic-StackLayoutPanel {
}
+
.mosaic-StackLayoutPanel .mosaic-StackLayoutPanelItem {
cursor: pointer;
cursor: hand;
- background:#ffffff;
+ background:#ffffff;
}
.mosaic-StackLayoutPanel .mosaic-StackLayoutPanelItem-selected {
cursor: pointer;
@@ -572,7 +566,7 @@
.mosaic-ColumnWidget .footerWrapper,
.mosaic-ScrollTreeTable .footerWrapper {
border-top: 1px solid #aaa;
- background: #8bd url(images/scrolltable/bg_header_gradient.gif) repeat-x bottom left;
+ background: #666;
}
.gwt-ScrollTable .dataTable td,
@@ -584,11 +578,12 @@
.mosaic-ScrollTreeTable .dataTable td,
.mosaic-ScrollTreeTable .headerTable td,
.mosaic-ScrollTreeTable .footerTable td {
- border-color: #aaa;
+ border-color: #ccc;
border-style: solid;
border-width: 0px 1px 1px 0px;
white-space: nowrap;
overflow: hidden;
+ font-size:12px;
}
.gwt-ScrollTable .headerTable td,
@@ -619,7 +614,7 @@
.gwt-ScrollTable .dataTable tr.selected,
.mosaic-ColumnWidget .dataTable tr.selected,
.mosaic-ScrollTreeTable .dataTable tr.selected {
- background: #EFF5F9;/*#7AA5D6;*/ /*light blue*/
+ background: #7AA5D6;/*#7AA5D6;*/ /*light blue*/
}
.gwt-ScrollTable .pagingOptions {
@@ -653,8 +648,9 @@
cursor: hand;
}
-/*** DropDownPanel & Tables***/
+/*** DropDownPanel ***/
+
.mosaic-DropDownPanel {
}
@@ -677,14 +673,14 @@
.mosaic-DropDownPanel .gwt-ScrollTable .headerWrapper,
.mosaic-DropDownPanel .mosaic-ColumnWidget .headerWrapper,
.mosaic-DropDownPanel .mosaic-ScrollTreeTable .headerWrapper {
- background: #8bd url(images/scrolltable/bg_header_gradient.gif) repeat-x bottom left;
+ background: #666;
}
.mosaic-DropDownPanel .gwt-ScrollTable .footerWrapper,
.mosaic-DropDownPanel .mosaic-ColumnWidget .footerWrapper,
.mosaic-DropDownPanel .mosaic-ScrollTreeTable .footerWrapper {
border-top: 1px solid #aaa;
- background: #8bd url(images/scrolltable/bg_header_gradient.gif) repeat-x bottom left;
+ background: #666;
}
.mosaic-DropDownPanel .gwt-ScrollTable .dataTable td,
@@ -736,7 +732,7 @@
.mosaic-DropDownPanel .gwt-ScrollTable .dataTable tr.selected td,
.mosaic-DropDownPanel .mosaic-ColumnWidget .dataTable tr.selected td,
.mosaic-DropDownPanel .mosaic-ScrollTreeTable .dataTable tr.selected td {
- background: green;/*#7AA5D6*/
+ background: #7AA5D6;
}