[jboss-svn-commits] JBL Code SVN: r5326 - labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jul 27 17:33:58 EDT 2006


Author: szimano
Date: 2006-07-27 17:33:57 -0400 (Thu, 27 Jul 2006)
New Revision: 5326

Modified:
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeShowPopupListener.java
Log:
css intergartion


Modified: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeShowPopupListener.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeShowPopupListener.java	2006-07-27 21:08:28 UTC (rev 5325)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeShowPopupListener.java	2006-07-27 21:33:57 UTC (rev 5326)
@@ -39,6 +39,7 @@
 import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.ListBox;
+import com.google.gwt.user.client.ui.SimplePanel;
 import com.google.gwt.user.client.ui.TabPanel;
 import com.google.gwt.user.client.ui.TextArea;
 import com.google.gwt.user.client.ui.TextBox;
@@ -169,10 +170,17 @@
 			public void onSuccess(Object result) {
 				Vector vect = (Vector) result;
 
-				table.setHTML(0, 1, "# Subscribers");
-				table.setHTML(0, 2, "Author");
-				table.setHTML(0, 3, "Tags");
+				table.setHTML(0, 0, "# Subscribers");
+				table.setHTML(0, 1, "Author");
+				table.setHTML(0, 2, "Tags");
 
+				table.getCellFormatter()
+						.setStyleName(0, 0, "tagmetable-header");
+				table.getCellFormatter()
+						.setStyleName(0, 1, "tagmetable-header");
+				table.getCellFormatter().setStyleName(0, 2,
+						"tagmetable-headernr");
+
 				HashMap rows = new HashMap();
 
 				int rowsNum = 0;
@@ -193,15 +201,17 @@
 
 					if (!rows.keySet().contains(user)) {
 						rows.put(user, new Integer(rowsNum + 1));
-						table.setHTML(rowsNum + 1, 1, String.valueOf(subsc));
-						table.setWidget(++rowsNum, 2, getAuthorLink(fullName,
+						table.setHTML(rowsNum + 1, 0, String.valueOf(subsc));
+						table.setWidget(++rowsNum, 1, getAuthorLink(fullName,
 								user, authorFeed, authorUniqueFeed));
-						
-						//delete all cells (if they are any from last refreshing)
+
+						// delete all cells (if they are any from last
+						// refreshing)
 						while (table.getCellCount(rowsNum) > 3) {
-							table.removeCell(rowsNum, table.getCellCount(rowsNum) - 1);
+							table.removeCell(rowsNum, table
+									.getCellCount(rowsNum) - 1);
 						}
-						
+
 					}
 
 					int curRow = ((Integer) rows.get(user)).intValue();
@@ -228,14 +238,40 @@
 								getLink(desc, feed, allResFeed, tag, user));
 					}
 				}
-				
-				if ((rowsNum + 1)< table.getRowCount()) {
+
+				if ((rowsNum + 1) < table.getRowCount()) {
 					for (int i = rowsNum + 1; i < table.getRowCount(); i++) {
 						for (int j = 0; j < table.getCellCount(i); j++) {
 							table.setWidget(i, j, new Label(""));
 						}
 					}
 				}
+
+				// set styles
+				for (int i = 1; i < table.getRowCount(); i++) {
+
+					for (int j = 0; j < 2 && j < table.getCellCount(i); j++) {
+						switch (i % 2) {
+						case 0:
+							table.getCellFormatter().setStyleName(i, j,
+									"tagmetable-stripegrey"); break;
+						case 1:
+							table.getCellFormatter().setStyleName(i, j,
+									"tagmetable-stripewhite"); break;
+						}
+					}
+
+					for (int j = 2; j < table.getCellCount(i); j++) {
+						switch (i % 2) {
+						case 0:
+							table.getCellFormatter().setStyleName(i, j,
+									"tagmetable-stripegreynr"); break;
+						case 1:
+							table.getCellFormatter().setStyleName(i, j,
+									"tagmetable-stripewhitenr"); break;
+						}
+					}
+				}
 			}
 
 			public void onFailure(Throwable caught) {
@@ -243,7 +279,7 @@
 						+ caught);
 			}
 		};
-		
+
 		// call AJAX methos, after that callback is going to be executed
 		tagging.getTags(path, clas, callback);
 
@@ -288,6 +324,10 @@
 
 		table = new FlexTable();
 
+		table.setStyleName("tagmetable");
+		
+		DOM.setAttribute(table.getElement(), "cellspacing", "0");
+
 		panel.add(table);
 
 		HorizontalPanel hPanel = new HorizontalPanel();
@@ -341,16 +381,32 @@
 				currentUser, clas, textBoxes, descBoxes, info,
 				suggestionCheckboxes, this, website));
 		btnPanel.add(saveBtn);
-		btnPanel.add(new Button("Close", new ClickListener() {
 
+		saveBtn.setStyleName("button");
+
+		Button closeBtn = new Button("Close", new ClickListener() {
+
 			public void onClick(Widget sender) {
 				dialog.hide();
 			}
 
-		}));
+		});
 
-		panel.add(btnPanel);
+		closeBtn.setStyleName("button");
 
+		btnPanel.add(closeBtn);
+
+		LabsSimplePanel outlinePanel = new LabsSimplePanel();
+
+		outlinePanel.add(panel);
+
+		DOM.setAttribute(outlinePanel.getElement(), "id", "tagmeoutline");
+
+		VerticalPanel wholeTagme = new VerticalPanel();
+
+		wholeTagme.add(outlinePanel);
+		wholeTagme.add(btnPanel);
+
 		// PopupPanel popUp = new PopupPanel(true);
 
 		// popUp.setStyleName(TAGME_STYLE);
@@ -363,9 +419,11 @@
 		// popUp.show();
 
 		TabPanel tabs = new TabPanel();
+		
+		DOM.setAttribute(tabs.getTabBar().getElement(), "id", "tabnav");
+		
+		tabs.add(wholeTagme, "<div class='tagBar-inside'><span class='bar' >Tag&nbsp;Content</span></div>", true);
 
-		tabs.add(panel, "Tag&nbsp;Content");
-
 		VerticalPanel searchPanel = new VerticalPanel();
 		searchPanel
 				.add(new Label(
@@ -387,7 +445,8 @@
 
 		searchPanel.add(bio);
 
-		searchPanel.add(new HTML("<div class=\"tagme-search-results\">Search results</div>"));
+		searchPanel.add(new HTML(
+				"<div class=\"tagme-search-results\">Search results</div>"));
 
 		VerticalPanel results = new VerticalPanel();
 
@@ -410,7 +469,7 @@
 
 		searchPanel.add(buttons);
 
-		tabs.add(searchPanel, "Tag&nbsp;Search");
+		tabs.add(searchPanel, "<div class='tagBar-inside'><span class='bar' >Tag&nbsp;Search</span></div>", true);
 
 		tabs.selectTab(0);
 
@@ -418,7 +477,7 @@
 
 		dialog.setStyleName(TAGME_STYLE);
 
-		dialog.setText("TagMe!");
+		dialog.setText("Tag Me");
 
 		dialog.setPopupPosition(DOM.getAbsoluteLeft(parentButton.getElement()),
 				DOM.getAbsoluteTop(parentButton.getElement()));




More information about the jboss-svn-commits mailing list