[jbosstools-commits] JBoss Tools SVN: r7144 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Mar 27 07:05:47 EDT 2008


Author: dmaliarevich
Date: 2008-03-27 07:05:47 -0400 (Thu, 27 Mar 2008)
New Revision: 7144

Modified:
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tabPanel/activeBackground.gif
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tabPanel/tabPanel.css
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabPanelTemplate.java
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1697, css style updated, labelWidth added.

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tabPanel/activeBackground.gif
===================================================================
(Binary files differ)

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tabPanel/tabPanel.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tabPanel/tabPanel.css	2008-03-27 10:38:30 UTC (rev 7143)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tabPanel/tabPanel.css	2008-03-27 11:05:47 UTC (rev 7144)
@@ -1,28 +1,62 @@
-.dr-tbpnl-cntnt {
+
+.rich-tabpanel{
+	
+}
+
+.rich-tabpanel-content {
 	border-width: 1px;
 	border-style: solid;
 	font-size: 11px;
 	font-family: verdana;
 	color: #000000;
 	vertical-align: top;
+	background-color: #FFFFFF;
+	border-color: #C4C0B9;
 }
 
-.dr-tbpnl-tbtopbrdr {
+.rich-tabpanel-content-position {
+	top: -1px;
+	height: 100%;
+}
+
+.rich-tabhdr-side-border {
 	border-top-width: 1px;
 	border-top-style: solid;
 }
 
-.dr-tbpnl-tb {
+.rich-tabhdr-side-cell {
+	border-top-color: #C4C0B9;
+	background-repeat: no-repeat;
+	background-position: top;
+}
+
+.rich-tabhdr-cell-active {
+	
+}
+
+.rich-tabhdr-cell-inactive {
+	padding-top: 2px;
+	padding-bottom: 1px;
+}
+
+.rich-tabhdr-cell-disabled {
+	padding-top: 2px;
+	padding-bottom: 1px;
+}
+
+.rich-tab-header {
 	padding: 2px 10px 2px 10px;
 	text-align: center;
+	color: #000000;
+	font-size: 11px;
+	font-family: Arial, Verdana, sans-serif;
 }
 
-.dr-tbpnl-tbbrdr {
-	background-repeat: no-repeat;
-	background-position: top;
+rich-tab-label {
+	
 }
 
-.dr-tbpnl-tb-act {
+.rich-tab-active {
 	border-width: 1px;
 	border-style: solid;
 	padding: 3px 10px 4px 10px;
@@ -30,79 +64,29 @@
 	background-repeat: repeat-x;
 	background-position: top;
 	cursor: default;
+	color:#000000;
+	border-color: #FFFFFF;
+	background-color:#FFFFFF;
 }
 
-.dr-tbpnl-tb-inact {
+.rich-tab-inactive {
 	border-width: 1px;
 	border-style: solid;
 	border-bottom: 0px;
 	background-repeat: repeat-x;
 	background-position: top;
 	cursor: default;
+	border-color: #ffffff;
 }
 
-.dr-tbpnl-tb-dsbld {
+.rich-tab-disabled {
 	border-width: 1px;
 	border-style: solid;
 	border-bottom: 0px;
 	background-repeat: repeat-x;
 	background-position: top;
 	cursor: default;
-}
-
-.dr-tbpnl-tbcell-dsbl, .dr-tbpnl-tbcell-inact {
-	padding-top: 2px;
-	padding-bottom: 1px;
-}
-
-.dr-tbpnl-tb {
-	color: #000000;
-	font-size: 11px;
-	font-family: Arial, Verdana, sans-serif;
-}
-
-.dr-tbpnl-tb-act {
-	color:#000000;
 	border-color: #ffffff;
-}
-
-.dr-tbpnl-tb-inact {
-	border-color: #ffffff;
-}
-
-.dr-tbpnl-tb-dsbl {
-	border-color: #ffffff;
 	color: #848079;
 }
 
-.dr-tbpnl-tb-sel {
-	border-width: 1px;
-	border-style: solid;
-	border-bottom: 0px;
-	color: #000000;
-	background-repeat: repeat-x;
-	background-position: top;
-	cursor: default;
-}
-
-.dr-tbpnl-cntnt-pstn {
-	top: -1px;
-	height: 100%;
-}
-
-.dr-tbpnl-tb-sel {
-	border-color: #E79A00;
-}
-
-.dr-tbpnl-tbtopbrdr {
-	border-top-color: #C4C0B9;
-}
-
-.dr-tbpnl-cntnt {
-	background-color: #FFFFFF;
-	border-color: #C4C0B9;
-}
-
-.dr-tbpnl-tb-act {
-	background-color:#FFFFFF;
-}
\ No newline at end of file

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabPanelTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabPanelTemplate.java	2008-03-27 10:38:30 UTC (rev 7143)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabPanelTemplate.java	2008-03-27 11:05:47 UTC (rev 7144)
@@ -105,8 +105,6 @@
 		inerTable.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, ZERO);
 		inerTable.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, ZERO);
 		inerTable.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, ZERO);
-		inerTable.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, 
-				CSS_CONTENT + SPACE + CSS_CONTENT_POSITION);
 
 		// Encode header
 		nsIDOMElement inerTr = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
@@ -145,13 +143,19 @@
 						(Element) child,
 						visualDocument, inerTr, active, 
 						ComponentUtil.getAttribute(sourceElement, 
-								HEADER_CLASS),
+								HEADER_CLASS) 
+								+ SPACE 
+								+ ComponentUtil.getAttribute(sourceElement,	
+									TAB_CLASS),
 						ComponentUtil.getAttribute(sourceElement, 
-								ACTIVE_TAB_CLASS),
+								ACTIVE_TAB_CLASS)
+								+ SPACE + CSS_CELL_ACTIVE,
 						ComponentUtil.getAttribute(sourceElement,
-								INACTIVE_TAB_CLASS),
+								INACTIVE_TAB_CLASS)
+								+ SPACE + CSS_CELL_INACTIVE,
 						ComponentUtil.getAttribute(sourceElement,
-								DISABLED_TAB_CLASS), 
+								DISABLED_TAB_CLASS)
+								+ SPACE + CSS_CELL_DISABLED, 
 								String.valueOf(i));
 				i++;
 				addSpacer(visualDocument, inerTr, headerSpacing);
@@ -180,20 +184,7 @@
 				if (active) {
 					RichFacesTabTemplate.encodeBody(creationData,
 							(Element) child, visualDocument, inerTr, true,
-							ComponentUtil.getAttribute(sourceElement,	
-									TAB_CLASS)
-									+ SPACE + CSS_SIDE_CELL
-									+ SPACE + CSS_SIDE_BORDER, 
-							ComponentUtil.getAttribute(sourceElement, 
-									ACTIVE_TAB_CLASS)
-									+ SPACE + CSS_CELL_ACTIVE,
 							ComponentUtil.getAttribute(sourceElement,
-									INACTIVE_TAB_CLASS)
-									+ SPACE + CSS_CELL_INACTIVE, 
-							ComponentUtil.getAttribute(sourceElement,
-									DISABLED_TAB_CLASS)
-									+ SPACE + CSS_CELL_DISABLED,
-							ComponentUtil.getAttribute(sourceElement,
 									CONTENT_CLASS)
 									+ SPACE + CSS_PANEL
 									+ SPACE + CSS_CONTENT

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java	2008-03-27 10:38:30 UTC (rev 7143)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java	2008-03-27 11:05:47 UTC (rev 7144)
@@ -49,6 +49,7 @@
 	
 	private static final String ZERO = "0"; //$NON-NLS-1$
 	private static final String ONE = "1"; //$NON-NLS-1$
+	private static final String TEN = "10"; //$NON-NLS-1$
 	private static final String SPACE = " "; //$NON-NLS-1$
 	private static final String EMPTY = ""; //$NON-NLS-1$
 	
@@ -56,7 +57,12 @@
 	private static final String HEIGHT_STYLE_NAME = "height: "; //$NON-NLS-1$
 	private static final String WIDTH_STYLE_NAME = "width: "; //$NON-NLS-1$
 	private static final String STYLE_SEMICOLUMN = "; "; //$NON-NLS-1$
+	private static final String PX = "px"; //$NON-NLS-1$
 	
+	private static final String BODY_TABLE_STYLE = "position: relative; z-index: 1;"; //$NON-NLS-1$
+	private static final String HEADER_TABLE_STYLE = "height : 100%; position : relative; z-index : 2;"; //$NON-NLS-1$
+	private static final String HEADER_TD_STYLE = "height: 100%; vertical-align: bottom;"; //$NON-NLS-1$
+	private static final String TRUE = "true"; //$NON-NLS-1$
 	
 	/**
 	 * Encode body of tab
@@ -65,23 +71,15 @@
 	 * @param visualDocument
 	 * @param parentTr
 	 * @param active
-	 * @param tabClass
-	 * @param activeTabClass
-	 * @param inactiveTabClass
-	 * @param disabledTabClass
 	 * @param contentClass
 	 * @param contentStyle
-	 * @return
+	 * @return the tab body
 	 */
 	public static VpeCreationData encodeBody(VpeCreationData creationData, 
 			Element sourceElement, 
 			nsIDOMDocument visualDocument, 
 			nsIDOMElement parentTr, 
 			boolean active,
-			String tabClass,
-			String activeTabClass,
-			String inactiveTabClass,
-			String disabledTabClass,
 			String contentClass,
 			String contentStyle) {
 
@@ -101,11 +99,11 @@
 		nsIDOMElement table = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
 		td.appendChild(table);
 		table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, ZERO);
-		table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "10"); //$NON-NLS-1$
+		table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, TEN);
 		table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, ZERO);
 		table.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, HUNDRED_PERCENTS);
-		table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "dr-tbpnl-cntnt-pstn" + SPACE + RichFacesTabPanelTemplate.CSS_CONTENT_POSITION); //$NON-NLS-1$
-		table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, "position: relative; z-index: 1;"); //$NON-NLS-1$
+		table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,RichFacesTabPanelTemplate.CSS_CONTENT_POSITION);
+		table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, BODY_TABLE_STYLE);
 
 		nsIDOMElement tr = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
 		table.appendChild(tr);
@@ -113,7 +111,6 @@
 		tr.appendChild(td);
 		td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, 
 				ComponentUtil.getAttribute(sourceElement, HtmlComponentUtil.HTML_STYLECLASS_ATTR)
-				+ SPACE + "dr-tbpnl-cntnt" //$NON-NLS-1$
 				+ SPACE + contentClass);
 		td.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, 
 				ComponentUtil.getAttribute(sourceElement, HtmlComponentUtil.HTML_STYLE_ATTR)
@@ -150,7 +147,7 @@
 		//bodyTable.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, HtmlComponentUtil.CSS_DISPLAY+" : "+DISABLED_ELEMENT_STYLE+";"); //$NON-NLS-1$ //$NON-NLS-2$
 		table.appendChild(headerTable);
 		table.appendChild(bodyTable);
-		encodeBody(creationData, (Element)sourceNode, visualDocument, bodyTable, true, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY);
+		encodeBody(creationData, (Element)sourceNode, visualDocument, bodyTable, true, EMPTY, EMPTY);
 		return creationData;
 
 	}
@@ -178,18 +175,16 @@
 	    
 		nsIDOMElement headerTd = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
 		parentTr.appendChild(headerTd);
-		headerTd.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, "height: 100%; vertical-align: bottom;"); //$NON-NLS-1$
-		String styleClass = "dr-tbpnl-tbcell-dsbl rich-tabhdr-cell-dsbl"; //$NON-NLS-1$
-		if(!"true".equalsIgnoreCase(sourceElement.getAttribute(DISABLED))) { //$NON-NLS-1$
+		headerTd.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, HEADER_TD_STYLE);
+		String styleClass = RichFacesTabPanelTemplate.CSS_CELL_DISABLED
+			+	SPACE + CSS_DISABLED;
+		if(!TRUE.equalsIgnoreCase(sourceElement.getAttribute(DISABLED))) {
 			if(active) {
-				styleClass = "dr-tbpnl-tbcell-act"  //$NON-NLS-1$
-					+ SPACE + RichFacesTabPanelTemplate.CSS_CELL_ACTIVE;
+				styleClass = RichFacesTabPanelTemplate.CSS_CELL_ACTIVE;
 			} else {
-				styleClass = "dr-tbpnl-tbcell-inact" //$NON-NLS-1$
-					+ SPACE + RichFacesTabPanelTemplate.CSS_CELL_INACTIVE;
+				styleClass = RichFacesTabPanelTemplate.CSS_CELL_INACTIVE;
 			}
 		}
-		styleClass += SPACE + headerClass;
 		headerTd.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
 		headerTd.setAttribute(VPE_USER_TOGGLE_ID, toggleId);
 
@@ -198,7 +193,7 @@
 		table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, ZERO);
 		table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, ZERO);
 		table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, ZERO);
-		table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, "height : 100%; position : relative; z-index : 2;"); //$NON-NLS-1$
+		table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, HEADER_TABLE_STYLE);
 		table.setAttribute(VPE_USER_TOGGLE_ID, toggleId);
 
 		nsIDOMElement mainTr = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
@@ -224,7 +219,7 @@
 				 */
 			}
 			if (val > 0) {
-				labelWidth = val + "px"; //$NON-NLS-1$
+				labelWidth = val + PX;
 			}
 		} else {
 			labelWidth = HUNDRED_PERCENTS;
@@ -241,32 +236,28 @@
 		mainTd = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
 		tr.appendChild(mainTd);
 
-		styleClass = "dr-tbpnl-tb dr-tbpnl-tb-dsbl" //$NON-NLS-1$
-			+ SPACE + CSS_HEADER
+		styleClass = CSS_HEADER
 			+ SPACE + CSS_LABEL
 			+ SPACE + CSS_DISABLED
 			+ SPACE + disabledTabClass;
 		String bgImgPath = ComponentUtil.getAbsoluteResourcePath(INACTIVE_BKG_FILE_PATH);
 
-		if(!"true".equalsIgnoreCase(sourceElement.getAttribute(DISABLED))) { //$NON-NLS-1$
+		if(!TRUE.equalsIgnoreCase(sourceElement.getAttribute(DISABLED))) {
 			if(active) {
-				styleClass = "dr-tbpnl-tb dr-tbpnl-tb-act" //$NON-NLS-1$
-					+ SPACE + CSS_HEADER
+				styleClass = CSS_HEADER
 					+ SPACE + CSS_LABEL
 					+ SPACE + CSS_ACTIVE
 					+ SPACE + activeTabClass;
 				bgImgPath = ComponentUtil.getAbsoluteResourcePath(ACTIVE_BKG_FILE_PATH);
 			} else {
-				styleClass = "dr-tbpnl-tb dr-tbpnl-tb-inact" //$NON-NLS-1$
-					+ SPACE + CSS_HEADER
+				styleClass = CSS_HEADER
 					+ SPACE + CSS_LABEL
 					+ SPACE + CSS_INACTIVE
 					+ SPACE + inactiveTabClass;
 			}
 		}
 
-		styleClass += SPACE + "dr-tbpnl-tbtopbrdr" + SPACE //$NON-NLS-1$
-				+ RichFacesTabPanelTemplate.CSS_SIDE_CELL;
+		styleClass += SPACE + headerClass;
 		mainTd.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
 		String style = "background-image: url(file:///" //$NON-NLS-1$
 				+ bgImgPath.replace('\\', '/') + ");"; //$NON-NLS-1$
@@ -297,8 +288,10 @@
 	private static void encodeSpacer(nsIDOMElement parentTr, nsIDOMDocument visualDocument) {
 	    	nsIDOMElement td = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
 		parentTr.appendChild(td);
-		td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "dr-tbpnl-tbbrdr" //$NON-NLS-1$
-				+ SPACE + RichFacesTabPanelTemplate.CSS_SIDE_BORDER);
+		td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, 
+				 RichFacesTabPanelTemplate.CSS_SIDE_CELL
+				 + SPACE + 
+				 RichFacesTabPanelTemplate.CSS_SIDE_BORDER);
 		String borderImgPath = ComponentUtil.getAbsoluteResourcePath(BORDER_FILE_PATH);
 		String style = "background-image: url(file:///" + borderImgPath.replace('\\', '/') + ");"; //$NON-NLS-1$ //$NON-NLS-2$
 		td.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);




More information about the jbosstools-commits mailing list