modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
| 29 +++++-----
1 file changed, 15 insertions(+), 14 deletions(-)
New commits:
commit 9941c387a8863aefbe5e80906098c749336b7993
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Mar 26 10:50:56 2010 -0400
get the 'logged in as' message area formatted a bit better
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index caf4ffb..e134f04 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
@@ -22,9 +22,11 @@ import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.Hyperlink;
-import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.Img;
+import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
@@ -39,7 +41,7 @@ public class MenuBarView extends VLayout {
private AboutModalWindow aboutModalWindow;
- public static final String[] SECTIONS = {"Dashboard", "Demo",
"Inventory", "Bundles", "Administration"};
+ public static final String[] SECTIONS = { "Dashboard", "Demo",
"Inventory", "Bundles", "Administration" };
private String selected = "Dashboard";
@@ -65,14 +67,12 @@ public class MenuBarView extends VLayout {
protected void onDraw() {
super.onDraw();
-
ToolStrip topStrip = new ToolStrip();
topStrip.setHeight(34);
topStrip.setWidth100();
topStrip.setBackgroundImage("header/header_bg.png");
topStrip.setMembersMargin(20);
-
this.aboutModalWindow = new AboutModalWindow();
Img logo = new Img("header/rhq_logo_28px.png", 80, 28);
logo.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
@@ -82,7 +82,6 @@ public class MenuBarView extends VLayout {
});
topStrip.addMember(logo);
-
linksPane = new HTMLFlow();
linksPane.setContents(setupLinks());
@@ -90,12 +89,15 @@ public class MenuBarView extends VLayout {
topStrip.addMember(new LayoutSpacer());
- topStrip.addMember(new HTMLFlow("Logged in as " +
CoreGUI.getSessionSubject().getName()));
-
- topStrip.addMember(new Hyperlink("Help", "Help"));
- topStrip.addMember(new Hyperlink("Preferences",
"Preferences"));
- topStrip.addMember(new Hyperlink("Log Out", "LogOut"));
-
+ HLayout helpLayout = new HLayout();
+ Label loggedInAs = new Label("Logged in as " +
CoreGUI.getSessionSubject().getName());
+ loggedInAs.setValign(VerticalAlignment.CENTER);
+ helpLayout.addMember(loggedInAs);
+ helpLayout.addMember(new Hyperlink("Help", "Help"));
+ helpLayout.addMember(new Hyperlink("Preferences",
"Preferences"));
+ helpLayout.addMember(new Hyperlink("Log Out", "LogOut"));
+ helpLayout.setLayoutAlign(VerticalAlignment.CENTER);
+ topStrip.addMember(helpLayout);
/* DynamicForm links = new DynamicForm();
links.setNumCols(SECTIONS.length * 2);
@@ -128,9 +130,9 @@ public class MenuBarView extends VLayout {
markForRedraw();
}
-
private String setupLinks() {
- StringBuilder headerString = new StringBuilder("<table
style=\"height: 34px;\" cellpadding=\"0\"
cellspacing=\"0\"><tr>");
+ StringBuilder headerString = new StringBuilder(
+ "<table style=\"height: 34px;\" cellpadding=\"0\"
cellspacing=\"0\"><tr>");
boolean first = true;
for (String section : SECTIONS) {
@@ -144,7 +146,6 @@ public class MenuBarView extends VLayout {
styleClass += "Selected";
}
-
headerString.append("<td class=\"" + styleClass +
"\" onclick=\"document.location='#" + section + "'\"
>");
headerString.append(section);
headerString.append("</td>\n");
Show replies by date