Author: dmaliarevich
Date: 2008-04-04 09:10:21 -0400 (Fri, 04 Apr 2008)
New Revision: 7331
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/style.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuItem/style.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1588, css styles updated to look "like in
browser"
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/style.css
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/style.css 2008-04-04
12:47:57 UTC (rev 7330)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/style.css 2008-04-04
13:10:21 UTC (rev 7331)
@@ -6,18 +6,16 @@
vertical-align: middle;
}
-.rich-pmenu-disabled-element {
- color: #B1ADA7;
-}
-
.rich-pmenu-top-group-div, .rich-pmenu-group-div {
- border-color: #C4C0B9;
- border: 1px solid;
margin-bottom: 3px;
padding: 1px;
cursor: pointer;
}
-
+.rich-pmenu-group{
+ padding: 0px;
+ height: 20px;
+ width: 100%;
+}
.rich-pmenu-top-group {
background-color: #D4CFC7;
font-family: Arial, Verdana, sans-serif;
@@ -25,8 +23,8 @@
font-weight: bold;
background-position: left top;
background-repeat: repeat-x;
+ padding: 0px;
height: 20px;
- padding: 2px 1px 2px 2px;
width: 100%;
}
@@ -37,4 +35,8 @@
font-family: Arial, Verdana, sans-serif;
font-size: 11px;
font-weight: bold;
+}
+
+.rich-pmenu-disabled-element {
+ color: #B1ADA7;
}
\ No newline at end of file
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuItem/style.css
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuItem/style.css 2008-04-04
12:47:57 UTC (rev 7330)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuItem/style.css 2008-04-04
13:10:21 UTC (rev 7331)
@@ -1,68 +1,29 @@
-
-.dr-pmenu-top-group-div {
- border-color:#C4C0B9;
+.rich-pmenu-item-label, .rich-pmenu-top-item-label {
+ font-size: 11px;
+ padding-left: 5px;
+ width: 100%;
}
-.dr-pmenu-top-group-div {
- border:1px solid;
- margin-bottom:3px;
- padding:1px;
- border-color:#C4C0B9;
-
-}
-
-.dr-pmenu-top-group {
- background-color:#D4CFC7;
+.rich-pmenu-item, .rich-pmenu-top-item {
+ cursor:pointer;
+ padding: 0px;
color:#000000;
font-family:Arial,Verdana,sans-serif;
font-size:11px;
- font-weight:bold;
}
-.dr-pmenu-top-group {
- background-position:left top;
- background-repeat:repeat-x;
- cursor:pointer;
- height:20px;
- padding:2px 1px 2px 2px;
- width:100%;
-}
-
.dr-pmenu-nowrap {
- white-space:nowrap;
+ white-space: nowrap;
}
-element.style {
- width:100%;
+.dr-pmenu-top-self-div {
+ border-top: 1px solid;
+ border-color: #C4C0B9;
}
-
-.rich-pmenu-item-label {
- padding-left:5px;
-}
-
.rich-pmenu-disabled-element {
color:#B1ADA7;
font-family:Arial,Verdana,sans-serif;
font-size:11px;
- margin-top:1px;
- padding:2px 1px 1px;
+ width: 100%;
}
-
-.rich-pmenu-item {
- cursor:pointer;
- margin-top:1px;
- padding:2px 1px 1px;
- color:#000000;
- font-family:Arial,Verdana,sans-serif;
- font-size:11px;
-}
-
-.dr-pmenu-nowrap {
- white-space: nowrap;
-}
-
-.dr-pmenu-top-self-div {
- border-top: 1px solid;
- border-color: #C4C0B9;
-}
\ No newline at end of file
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2008-04-04
12:47:57 UTC (rev 7330)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2008-04-04
13:10:21 UTC (rev 7331)
@@ -75,7 +75,9 @@
private static final String RIGHT = "right"; //$NON-NLS-1$
private static final String SPACE = " "; //$NON-NLS-1$
private static final String EMPTY = ""; //$NON-NLS-1$
-
+
+ private static final String WIDTH_100_PERSENTS = "width: 100%; ";
//$NON-NLS-1$
+ private static final String MARGIN_TOP = "margin-top: 3px; "; //$NON-NLS-1$
/*
* rich:panelMenu attributes for groups
*/
@@ -233,12 +235,17 @@
boolean disabled, String activeChildId) {
String disabledStyle = EMPTY;
String disableClass = EMPTY;
- String style = EMPTY;
- String styleClass = EMPTY;
+ String tableStyle = MARGIN_TOP;
+ String tableClass = EMPTY;
+ String col1ImgClass = EMPTY;
+ String col2Class = EMPTY;
+ String col3ImgClass = EMPTY;
+ String divClass = EMPTY;
nsIDOMElement table = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
div.appendChild(table);
+
table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
//$NON-NLS-1$
table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
//$NON-NLS-1$
table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0"); //$NON-NLS-1$
@@ -260,7 +267,7 @@
nsIDOMElement column2 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
tableBodyRow.appendChild(column2);
- column2.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, "width: 100%;");
//$NON-NLS-1$
+ column2.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, WIDTH_100_PERSENTS);
nsIDOMText name = visualDocument.createTextNode(pmg_label);
column2.appendChild(name);
@@ -282,46 +289,8 @@
boolean childOfPanelMenu = parent.getNodeName().endsWith(
PANEL_MENU_END_TAG);
- if (childOfPanelMenu) {
-
- tableBodyRow.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_TOP_GROUP + SPACE +
CSS_GROUP);
- columnn1_img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_TOP_GROUP_ICON +
SPACE + CSS_GROUP_ICON);
- column2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_GROUP_LABEL + SPACE +
CSS_TOP_GROUP_LABEL);
- column3_img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_TOP_GROUP_ICON + SPACE
+ CSS_GROUP_ICON);
-
- if (attrPresents(pm_topGroupClass)) {
- styleClass = SPACE + pm_topGroupClass;
- }
- if (attrPresents(pm_topGroupStyle)) {
- style += pm_topGroupStyle;
- }
- div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_TOP_GROUP_DIV + SPACE +
CSS_GROUP_DIV);
- } else {
-
- tableBodyRow.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_GROUP);
- columnn1_img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_GROUP_ICON);
- column2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_GROUP_LABEL);
- column3_img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_GROUP_ICON);
-
- if (attrPresents(pm_groupClass)) {
- styleClass = SPACE + pm_groupClass;
- }
- if (attrPresents(pm_groupStyle)) {
- style += pm_groupStyle;
- }
- div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_GROUP_DIV);
- }
-
- if (attrPresents(pmg_style)) {
- style += SPACE + pmg_style;
- }
- if (attrPresents(pm_styleClass)) {
- styleClass += SPACE + pm_styleClass;
- }
- if (attrPresents(pmg_styleClass)) {
- styleClass += SPACE + pmg_styleClass;
- }
-
+ tableClass += SPACE + CSS_GROUP;
+
if (disabled) {
if (attrPresents(pm_disabledGroupClass)) {
disableClass += pm_disabledGroupClass;
@@ -330,7 +299,7 @@
disableClass += SPACE + pmg_disabledClass;
}
disableClass += SPACE + CSS_DISABLED_ELEMENT;
- styleClass += SPACE + disableClass;
+ tableClass += SPACE + disableClass;
if (attrPresents(pm_disabledGroupStyle)) {
disabledStyle += pm_disabledGroupStyle;
@@ -338,13 +307,52 @@
if (attrPresents(pmg_disabledStyle)) {
disabledStyle += SPACE + pmg_disabledStyle;
}
- style += SPACE + disabledStyle;
+ tableStyle += SPACE + disabledStyle;
+ } else {
+
+ if (attrPresents(pm_groupClass)) {
+ tableClass += SPACE + pm_groupClass;
+ }
+ if (attrPresents(pm_groupStyle)) {
+ tableStyle += pm_groupStyle;
+ }
+ col1ImgClass += SPACE + CSS_GROUP_ICON;
+ col2Class += SPACE + CSS_GROUP_LABEL;
+ col3ImgClass += SPACE + CSS_GROUP_ICON;
+ divClass += SPACE + CSS_GROUP_DIV;
+
+ if (childOfPanelMenu) {
+ if (attrPresents(pm_topGroupClass)) {
+ tableClass += SPACE + pm_topGroupClass;
+ }
+ if (attrPresents(pm_topGroupStyle)) {
+ tableStyle += pm_topGroupStyle;
+ }
+ tableClass += SPACE + CSS_TOP_GROUP + SPACE + CSS_GROUP;
+ col1ImgClass += SPACE + CSS_TOP_GROUP_ICON;
+ col2Class += SPACE + CSS_TOP_GROUP_LABEL;
+ col3ImgClass += SPACE + CSS_TOP_GROUP_ICON;
+ divClass += SPACE + CSS_TOP_GROUP_DIV;
+ }
}
- if (!EMPTY.equals(style.trim())) {
- table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+
+ if (attrPresents(pm_styleClass)) {
+ tableClass += SPACE + pm_styleClass;
}
- table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
+ if (attrPresents(pmg_styleClass)) {
+ tableClass += SPACE + pmg_styleClass;
+ }
+ if (attrPresents(pmg_style)) {
+ tableStyle += SPACE + pmg_style;
+ }
+
+ columnn1_img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, col1ImgClass);
+ column2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, col2Class);
+ column3_img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, col3ImgClass);
+ div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, divClass);
+ table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, tableClass);
+ table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, tableStyle);
}
private static final Element getRichPanelParent(Element sourceElement) {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2008-04-04
12:47:57 UTC (rev 7330)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2008-04-04
13:10:21 UTC (rev 7331)
@@ -69,13 +69,12 @@
private static final String LEFT = "left"; //$NON-NLS-1$
private static final String NO_SIZE_VALUE = "0"; //$NON-NLS-1$
private static final String DEFAULT_SIZE_VALUE = "16"; //$NON-NLS-1$
- private static final String SRC = "16"; //$NON-NLS-1$
- private static final String FILE = "16"; //$NON-NLS-1$
private static final String COMPONENT_NAME = "panelMenuItem"; //$NON-NLS-1$
private static final String PANEL_MENU_END_TAG = ":panelMenu"; //$NON-NLS-1$
private static final String PANEL_MENU_GROUP_END_TAG = ":panelMenuGroup";
//$NON-NLS-1$
private static final String EMPTY_DIV_STYLE = "display: none;"; //$NON-NLS-1$
+ private static final String MARGIN_TOP = "margin-top: 3px; "; //$NON-NLS-1$
/*
* rich:panelMenu attributes for items
@@ -130,11 +129,14 @@
nsIDOMElement parentDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
parentDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, DR_TOP_DIV);
+ parentDiv.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
//$NON-NLS-1$
+ parentDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, MARGIN_TOP);
parentVisualElement.appendChild(parentDiv);
nsIDOMElement div = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_DIV);
parentDiv.appendChild(div);
-
+
+
boolean childOfPanelMenu = sourceElement.getParentNode().getNodeName().endsWith(
PANEL_MENU_END_TAG);
boolean childOfPanelMenuGroup = sourceElement.getParentNode().getNodeName().endsWith(
@@ -250,7 +252,7 @@
}
/**
- * Gets the specified icon from panelMenu or .panelMenuGroupItem
+ * Gets the specified icon from panelMenu or panelMenuGroupItem
*
* @param pm_icon the panelMenu icon attribute
* @param pmi_icon the panelMenuGroupItem icon attribute
@@ -343,60 +345,64 @@
nsIDOMElement td2,
nsIDOMElement img3) {
- String tableStyle = EMPTY;
+ String tableStyle = MARGIN_TOP;
String tableClass = EMPTY;
- String trClass = CSS_ITEM;
- String img1Class = DR_NOWARP_CLASS + SPACE + CSS_ITEM_ICON;
- String td2Class = CSS_ITEM_LABEL;
- String img3Class = CSS_ITEM_ICON;
+ String trClass = EMPTY;
+ String img1Class = EMPTY;
+ String td2Class = EMPTY;
+ String img3Class = EMPTY;
- if (attrPresents(pm_itemClass)) {
- tableClass += pm_itemClass;
- }
if (attrPresents(pmi_styleClass)) {
- tableClass += pmi_styleClass;
+ tableClass += SPACE + pmi_styleClass;
}
- if (attrPresents(pm_itemStyle)) {
- tableStyle += pm_itemStyle;
- }
if (attrPresents(pmi_style)) {
- tableStyle += pmi_style;
+ tableStyle += SPACE + pmi_style;
}
- if (childOfPanelMenu) {
- trClass += SPACE + CSS_TOP_ITEM;
- img1Class += SPACE + CSS_TOP_ITEM_ICON;
- td2Class += SPACE + CSS_TOP_ITEM_LABEL;
- img3Class += SPACE + CSS_TOP_ITEM_ICON;
- if (attrPresents(pm_topItemClass)) {
- tableClass += pm_topItemClass;
- }
- if (attrPresents(pm_topItemStyle)) {
- tableStyle += pm_topItemStyle;
- }
- }
+ tableClass = CSS_ITEM;
if ((TRUE.equalsIgnoreCase(pmi_disabled))
|| (TRUE.equalsIgnoreCase(pm_disabled))) {
- trClass += SPACE + CSS_DISABLED_ELEMENT;
- img1Class += SPACE + CSS_DISABLED_ELEMENT;
- td2Class += SPACE + CSS_DISABLED_ELEMENT;
- img3Class += SPACE + CSS_DISABLED_ELEMENT;
+ tableClass += SPACE + CSS_DISABLED_ELEMENT;
if (attrPresents(pm_disabledItemClass)) {
- tableClass += pm_disabledItemClass;
+ tableClass += SPACE + pm_disabledItemClass;
}
+ if (attrPresents(pm_disabledItemStyle)) {
+ tableStyle += SPACE + pm_disabledItemStyle;
+ }
if (attrPresents(pmi_disabledClass)) {
- tableClass += pmi_disabledClass;
+ tableClass += SPACE + pmi_disabledClass;
}
- if (attrPresents(pm_disabledItemStyle)) {
- tableStyle += pm_disabledItemStyle;
- }
if (attrPresents(pmi_disabledStyle)) {
- tableStyle += pmi_disabledStyle;
+ tableStyle += SPACE + pmi_disabledStyle;
}
+
+ } else {
+ img1Class = DR_NOWARP_CLASS + SPACE + CSS_ITEM_ICON;
+ td2Class = CSS_ITEM_LABEL;
+ img3Class = CSS_ITEM_ICON;
+ if (attrPresents(pm_itemClass)) {
+ tableClass += SPACE + pm_itemClass;
+ }
+ if (attrPresents(pm_itemStyle)) {
+ tableStyle += SPACE + pm_itemStyle;
+ }
+ if (childOfPanelMenu) {
+ tableClass += SPACE + CSS_TOP_ITEM;
+ img1Class += SPACE + CSS_TOP_ITEM_ICON;
+ td2Class += SPACE + CSS_TOP_ITEM_LABEL;
+ img3Class += SPACE + CSS_TOP_ITEM_ICON;
+ if (attrPresents(pm_topItemClass)) {
+ tableClass += SPACE + pm_topItemClass;
+ }
+ if (attrPresents(pm_topItemStyle)) {
+ tableStyle += SPACE + pm_topItemStyle;
+ }
+ }
}
table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, tableStyle);
+
table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, tableClass);
tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, trClass);
img3.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, img1Class);
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java 2008-04-04
12:47:57 UTC (rev 7330)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java 2008-04-04
13:10:21 UTC (rev 7331)
@@ -102,6 +102,7 @@
private static final String PANEL_MENU_GROUP_END = ":panelMenuGroup";
//$NON-NLS-1$
private static final String PANEL_MENU_ITEM_END = ":panelMenuItem";
//$NON-NLS-1$
private static final String TRUE = "true"; //$NON-NLS-1$
+ private static final String MARGIN_TOP = "margin-top: 3px; "; //$NON-NLS-1$
private List<String> activeIds = new ArrayList<String>();
@@ -125,9 +126,10 @@
nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
VpeCreationData vpeCreationData = new VpeCreationData(div);
-
+ div.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0"); //$NON-NLS-1$
+
if (style != null) {
- div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+ div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, MARGIN_TOP + style);
}
if (styleClass != null) {