Author: dmaliarevich
Date: 2009-02-10 11:40:37 -0500 (Tue, 10 Feb 2009)
New Revision: 13564
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/style.css
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/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:
https://jira.jboss.org/jira/browse/JBIDE-3740, styles and css classes were updated.
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/style.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/style.css
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/style.css 2009-02-10
16:40:37 UTC (rev 13564)
@@ -0,0 +1,4 @@
+.rich-pmenu {
+ overflow:hidden;
+ padding-right:4px;
+}
\ No newline at end of file
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/style.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
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 2009-02-10
15:34:26 UTC (rev 13563)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/style.css 2009-02-10
16:40:37 UTC (rev 13564)
@@ -1,3 +1,8 @@
+.rich-pmenu-group{
+ /*padding: 0px;
+ height: 20px;
+ width: 100%;*/
+}
.rich-pmenu-group-icon {
width: 16;
height: 16;
@@ -7,15 +12,13 @@
}
.dr-pmenu-top-group-div, .dr-pmenu-group-div {
- margin-bottom: 3px;
- padding: 1px;
+ border:1px solid #C4C0B9;
+ margin-bottom:3px;
+ overflow:hidden;
+ padding:1px;
+ width:100%;
cursor: pointer;
}
-.rich-pmenu-group{
- padding: 0px;
- height: 20px;
- width: 100%;
-}
.dr-pmenu-top-group, .dr-pmenu-group {
background-color: #D4CFC7;
@@ -24,11 +27,15 @@
font-weight: bold;
background-position: left top;
background-repeat: repeat-x;
- padding: 0px;
+ cursor: pointer;
height: 20px;
- width: 100%;
+ adding:2px 1px 2px 2px;
}
+.dr-pmenu-top-group {
+ background-image: url(topGroupBkgImg.png);
+}
+
.rich-pmenu-top-group-self-label, .rich-pmenu-group-self-label {
padding-left: 5px;
width: 100%;
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 2009-02-10
15:34:26 UTC (rev 13563)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2009-02-10
16:40:37 UTC (rev 13564)
@@ -18,6 +18,7 @@
import java.util.Map;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
@@ -25,6 +26,7 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.ResourceUtil;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
@@ -68,6 +70,8 @@
private static final String CSS_TOP_GROUP_LABEL =
"rich-pmenu-top-group-self-label"; //$NON-NLS-1$
private static final String CSS_DR_GROUP_DIV = "dr-pmenu-group-div";
//$NON-NLS-1$
private static final String CSS_GROUP = "rich-pmenu-group"; //$NON-NLS-1$
+ private static final String CSS_TOP_GROUP = "rich-pmenu-top-group";
//$NON-NLS-1$
+ private static final String CSS_TOP_GROUP_DIV = "rich-pmenu-top-group-div";
//$NON-NLS-1$
private static final String CSS_GROUP_ICON = "rich-pmenu-group-self-icon";
//$NON-NLS-1$
private static final String CSS_GROUP_LABEL = "rich-pmenu-group-self-label";
//$NON-NLS-1$
private static final String CSS_HOVERED_ELEMENT =
"rich-pmenu-hovered-element"; //$NON-NLS-1$
@@ -87,12 +91,8 @@
private static final String TRUE = "true"; //$NON-NLS-1$
private static final String RIGHT = "right"; //$NON-NLS-1$
private static final String LEFT = "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$
- private static final String NO_SIZE_VALUE = "0"; //$NON-NLS-1$
private static final String DEFAULT_SIZE_VALUE = "16"; //$NON-NLS-1$
/*
@@ -160,9 +160,9 @@
// &&
(groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) instanceof Element)) {
// srcNode = (Element)
groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE);
// }
- nsIDOMElement creationDataDiv = visualDocument
- .createElement(HTML.TAG_DIV);
- VpeCreationData creationData = new VpeCreationData(creationDataDiv);
+// nsIDOMElement creationDataDiv = visualDocument
+// .createElement(HTML.TAG_DIV);
+// VpeCreationData creationData = new VpeCreationData(creationDataDiv);
//added by estherbin fixed
https://jira.jboss.org/jira/browse/JBIDE-1605 issue.
final Element elementToPass = (srcNode != null ? srcNode : groupSourceElement);
@@ -175,8 +175,8 @@
int childGroupCount = 1;
- Element anySuitableParent = getGroupParent(elementToPass, false);
- Element panelMenuParent = getGroupParent(elementToPass, true);
+ Element anySuitableParent = getGroupParent(elementToPass, false);
+ Element panelMenuParent = getGroupParent(elementToPass, true);
readPanelMenuGroupAttributes(groupSourceElement);
readPanelMenuAttributes(panelMenuParent);
@@ -188,7 +188,8 @@
}
nsIDOMElement div = visualDocument
.createElement(HTML.TAG_DIV);
- creationDataDiv.appendChild(div);
+ VpeCreationData creationData = new VpeCreationData(div);
+// creationDataDiv.appendChild(div);
div.setAttribute(COMPONENT_ATTR_VPE_SUPPORT, NAME_COMPONENT);
div.setAttribute(VpeVisualDomBuilder.VPE_USER_TOGGLE_ID, childId);
@@ -240,21 +241,21 @@
Element anySuitableParent, Element groupSourceElement,
nsIDOMDocument visualDocument, nsIDOMElement div,
boolean expanded, String activeChildId) {
- String tableStyle = MARGIN_TOP;
- String tableClass = EMPTY;
- String iconCellClass = EMPTY;
- String iconCellStyle = EMPTY;
- String labelCellClass = EMPTY;
- String emptyCellClass = EMPTY;
- String divClass = EMPTY;
+ String tableStyle = Constants.EMPTY;
+ String tableClass = Constants.EMPTY;
+ String iconCellClass = Constants.EMPTY;
+ String iconCellStyle = Constants.EMPTY;
+ String labelCellClass = Constants.EMPTY;
+ String emptyCellClass = Constants.EMPTY;
+ String divClass = Constants.EMPTY;
nsIDOMElement table = visualDocument
.createElement(HTML.TAG_TABLE);
div.appendChild(table);
- table.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
- table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
- table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_CELLSPACING, Constants.ZERO_STRING);
+ table.setAttribute(HTML.ATTR_CELLPADDING, Constants.ZERO_STRING);
+ table.setAttribute(HTML.ATTR_BORDER, Constants.ZERO_STRING);
nsIDOMElement tableBodyRow = visualDocument
.createElement(HTML.TAG_TR);
@@ -304,9 +305,9 @@
* Group Label Routine.
*/
Attr labelAttr = null;
- String labelValue = EMPTY;
- String bundleValue = EMPTY;
- String resultValue = EMPTY;
+ String labelValue = Constants.EMPTY;
+ String bundleValue = Constants.EMPTY;
+ String resultValue = Constants.EMPTY;
if (groupSourceElement.hasAttribute(LABEL)) {
labelAttr = groupSourceElement.getAttributeNode(LABEL);
}
@@ -330,7 +331,7 @@
if (ComponentUtil.isNotBlank(bundleValue)) {
resultValue = bundleValue;
} else {
- resultValue = EMPTY;
+ resultValue = Constants.EMPTY;
}
}
nsIDOMText text = visualDocument.createTextNode(resultValue);
@@ -386,91 +387,95 @@
/*
* Group Style Classes Routine
*/
- tableClass += SPACE + CSS_GROUP + SPACE + CSS_DR_GROUP;
+ if (childOfPanelMenu) {
+ tableClass += Constants.WHITE_SPACE + CSS_DR_TOP_GROUP
+ + Constants.WHITE_SPACE + CSS_TOP_GROUP
+ + Constants.WHITE_SPACE + CSS_GROUP;
+ divClass += Constants.WHITE_SPACE + CSS_DR_TOP_GROUP_DIV
+ + Constants.WHITE_SPACE + CSS_TOP_GROUP_DIV;
+ } else {
+ tableClass += Constants.WHITE_SPACE + CSS_GROUP
+ + Constants.WHITE_SPACE + CSS_DR_GROUP;
+ divClass += Constants.WHITE_SPACE + CSS_DR_GROUP_DIV;
+ }
+
if (TRUE.equalsIgnoreCase(pm_disabled)) {
if (childOfPanelMenu) {
- tableClass = SPACE + CSS_DR_TOP_GROUP + SPACE + CSS_GROUP;
- tableClass += SPACE + CSS_DISABLED_ELEMENT;
- divClass += SPACE + CSS_DR_TOP_GROUP_DIV;
+ tableClass += Constants.WHITE_SPACE + CSS_DISABLED_ELEMENT;
if (ComponentUtil.isNotBlank(pm_disabledGroupClass)) {
- tableClass += SPACE + pm_disabledGroupClass;
+ tableClass += Constants.WHITE_SPACE + pm_disabledGroupClass;
}
if (ComponentUtil.isNotBlank(pm_topGroupStyle)) {
- tableStyle += SPACE + pm_topGroupStyle;
+ tableStyle += Constants.WHITE_SPACE + pm_topGroupStyle;
}
}
}
if ((TRUE.equalsIgnoreCase(pmg_disabled))) {
- tableClass += SPACE + CSS_GROUP + SPACE + CSS_DR_GROUP;
-
if (!(TRUE.equalsIgnoreCase(pm_disabled))) {
- tableClass += SPACE + CSS_DISABLED_ELEMENT;
+ tableClass += Constants.WHITE_SPACE + CSS_DISABLED_ELEMENT;
if (ComponentUtil.isNotBlank(pm_disabledGroupClass)){
- tableClass += SPACE + pm_disabledGroupClass;
+ tableClass += Constants.WHITE_SPACE + pm_disabledGroupClass;
}
}
if (ComponentUtil.isNotBlank(pmg_disabledClass)) {
- tableClass += SPACE + pmg_disabledClass;
+ tableClass += Constants.WHITE_SPACE + pmg_disabledClass;
}
if (ComponentUtil.isNotBlank(pm_disabledGroupStyle)) {
- tableStyle += SPACE + pm_disabledGroupStyle;
+ tableStyle += Constants.WHITE_SPACE + pm_disabledGroupStyle;
}
if (ComponentUtil.isNotBlank(pmg_disabledStyle)) {
- tableStyle += SPACE + pmg_disabledStyle;
+ tableStyle += Constants.WHITE_SPACE + pmg_disabledStyle;
}
}
if (!(TRUE.equalsIgnoreCase(pm_disabled))
&& (!(TRUE.equalsIgnoreCase(pmg_disabled)))) {
- tableClass = SPACE + CSS_DR_GROUP + SPACE + CSS_GROUP;
- iconCellClass = SPACE + CSS_GROUP_ICON;
- labelCellClass += SPACE + CSS_GROUP_LABEL;
- emptyCellClass += SPACE + CSS_GROUP_ICON;
- divClass += SPACE + CSS_DR_GROUP_DIV;
- if (ComponentUtil.isNotBlank(pm_groupClass)) {
- tableClass += SPACE + pm_groupClass;
- }
- if (ComponentUtil.isNotBlank(pm_groupStyle)) {
- tableStyle += SPACE + pm_groupStyle;
- }
+ tableClass = Constants.WHITE_SPACE + CSS_DR_GROUP + Constants.WHITE_SPACE +
CSS_GROUP;
+ iconCellClass = Constants.WHITE_SPACE + CSS_GROUP_ICON;
+ labelCellClass += Constants.WHITE_SPACE + CSS_GROUP_LABEL;
+ emptyCellClass += Constants.WHITE_SPACE + CSS_GROUP_ICON;
+
if (ComponentUtil.isNotBlank(pmg_iconClass)) {
- iconCellClass += SPACE + pmg_iconClass;
+ iconCellClass += Constants.WHITE_SPACE + pmg_iconClass;
}
if (ComponentUtil.isNotBlank(pmg_iconStyle)) {
- iconCellStyle += SPACE + pmg_iconStyle;
+ iconCellStyle += Constants.WHITE_SPACE + pmg_iconStyle;
}
if (childOfPanelMenu) {
- tableClass = SPACE + CSS_DR_TOP_GROUP + SPACE + CSS_GROUP;
- iconCellClass = SPACE + CSS_GROUP_ICON + SPACE + CSS_TOP_GROUP_ICON;
- labelCellClass = SPACE + CSS_TOP_GROUP_LABEL;
- emptyCellClass = SPACE + CSS_TOP_GROUP_ICON;
- divClass += SPACE + CSS_DR_TOP_GROUP_DIV;
+ tableClass = Constants.WHITE_SPACE + CSS_DR_TOP_GROUP + Constants.WHITE_SPACE +
CSS_GROUP;
+ iconCellClass = Constants.WHITE_SPACE + CSS_GROUP_ICON + Constants.WHITE_SPACE +
CSS_TOP_GROUP_ICON;
+ labelCellClass = Constants.WHITE_SPACE + CSS_TOP_GROUP_LABEL;
+ emptyCellClass = Constants.WHITE_SPACE + CSS_TOP_GROUP_ICON;
if (ComponentUtil.isNotBlank(pm_topGroupClass)) {
- tableClass += SPACE + pm_topGroupClass;
+ tableClass += Constants.WHITE_SPACE + pm_topGroupClass;
}
if (ComponentUtil.isNotBlank(pm_topGroupStyle)) {
tableStyle += pm_topGroupStyle;
}
if (ComponentUtil.isNotBlank(pmg_iconClass)) {
- iconCellClass += SPACE + pmg_iconClass;
+ iconCellClass += Constants.WHITE_SPACE + pmg_iconClass;
}
if (ComponentUtil.isNotBlank(pmg_iconStyle)) {
- iconCellStyle += SPACE + pmg_iconStyle;
+ iconCellStyle += Constants.WHITE_SPACE + pmg_iconStyle;
}
- }
+ } else {
+ if (ComponentUtil.isNotBlank(pm_groupClass)) {
+ tableClass += Constants.WHITE_SPACE + pm_groupClass;
+ }
+ if (ComponentUtil.isNotBlank(pm_groupStyle)) {
+ tableStyle += Constants.WHITE_SPACE + pm_groupStyle;
+ }
+ }
}
-
- if (ComponentUtil.isNotBlank(pm_styleClass)) {
- tableClass += SPACE + pm_styleClass;
- }
+
if (ComponentUtil.isNotBlank(pmg_styleClass)) {
- tableClass += SPACE + pmg_styleClass;
+ tableClass += Constants.WHITE_SPACE + pmg_styleClass;
}
if (ComponentUtil.isNotBlank(pmg_style)) {
- tableStyle += SPACE + pmg_style;
+ tableStyle += Constants.WHITE_SPACE + pmg_style;
}
iconCell.setAttribute(HTML.ATTR_CLASS, iconCellClass);
@@ -490,8 +495,8 @@
private static void setDefaultImgAttributes(nsIDOMElement element) {
element.setAttribute(HTML.ATTR_WIDTH,
DEFAULT_SIZE_VALUE);
- element.setAttribute(VSPACE, NO_SIZE_VALUE);
- element.setAttribute(HSPACE, NO_SIZE_VALUE);
+ element.setAttribute(VSPACE, Constants.ZERO_STRING);
+ element.setAttribute(HSPACE, Constants.ZERO_STRING);
element.setAttribute(HTML.ATTR_HEIGHT,
DEFAULT_SIZE_VALUE);
}
@@ -626,15 +631,15 @@
/*
* rich:panelMenu style classes for groups
*/
- pm_disabled = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.DISABLED);
+ pm_disabled = sourceParentElement.getAttribute(HTML.ATTR_DISABLED);
pm_disabledGroupClass =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.DISABLED_GROUP_CLASS);
pm_disabledGroupStyle =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.DISABLED_GROUP_STYLE);
pm_topGroupClass =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.TOP_GROUP_CLASS);
pm_topGroupStyle =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.TOP_GROUP_STYLE);
pm_groupClass =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.GROUP_CLASS);
pm_groupStyle =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.GROUP_STYLE);
- pm_style = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.STYLE);
- pm_styleClass =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.STYLE_CLASS);
+ pm_style = sourceParentElement.getAttribute(RichFaces.ATTR_STYLE);
+ pm_styleClass = sourceParentElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
}
/**
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 2009-02-10
15:34:26 UTC (rev 13563)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2009-02-10
16:40:37 UTC (rev 13564)
@@ -585,7 +585,7 @@
/*
* rich:panelMenu attributes for items
*/
- pm_disabled = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.DISABLED);
+ pm_disabled = sourceParentElement.getAttribute(HTML.ATTR_DISABLED);
pm_iconItem = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_ITEM);
pm_iconDisabledItem =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_DISABLED_ITEM);
pm_iconItemPosition =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_ITEM_POSITION);
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 2009-02-10
15:34:26 UTC (rev 13563)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java 2009-02-10
16:40:37 UTC (rev 13564)
@@ -14,12 +14,13 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -33,12 +34,20 @@
*/
public class RichFacesPanelMenuTemplate extends VpeAbstractTemplate {
+ /*
+ * Path to default css style sheet.
+ */
+ private static final String CSS_STYLE_PATH = "/panelMenu/style.css";
//$NON-NLS-1$
+
+ /*
+ * Component name
+ */
+ private static final String COMPONENT_NAME = "panelMenu"; //$NON-NLS-1$
+
/*
* rich:panelMenu attributes
*/
- public static final String DISABLED = "disabled"; //$NON-NLS-1$
public static final String EXPAND_SINGLE = "expandSingle"; //$NON-NLS-1$
- public static final String WIDTH = "width"; //$NON-NLS-1$
/*
* rich:panelMenu attributes for groups
@@ -63,12 +72,6 @@
public static final String ICON_ITEM_TOP_POSITION = "iconItemTopPosition";
//$NON-NLS-1$
/*
- * rich:panelMenu style classes
- */
- public static final String STYLE = "style"; //$NON-NLS-1$
- public static final String STYLE_CLASS = "styleClass"; //$NON-NLS-1$
-
- /*
* rich:panelMenu style classes for groups
*/
public static final String DISABLED_GROUP_CLASS = "disabledGroupClass";
//$NON-NLS-1$
@@ -91,7 +94,7 @@
/*
* rich:panelMenu css styles
*/
- public static final String CSS_PANEL_MENU = "rich-panel-menu"; //$NON-NLS-1$
+ public static final String CSS_PMENU = "rich-pmenu"; //$NON-NLS-1$
private static final String PANEL_MENU_GROUP_END = ":panelMenuGroup";
//$NON-NLS-1$
private static final String PANEL_MENU_ITEM_END = ":panelMenuItem";
//$NON-NLS-1$
@@ -102,26 +105,31 @@
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+ ComponentUtil.setCSSLink(pageContext, CSS_STYLE_PATH, COMPONENT_NAME);
+
Element sourceElement = (Element) sourceNode;
- String width = sourceElement.getAttribute(WIDTH);
- String style = sourceElement.getAttribute(STYLE);
- String styleClass = sourceElement.getAttribute(STYLE_CLASS);
-
- if (width != null) {
- style = "width:" + width + ";" + style; //$NON-NLS-1$
//$NON-NLS-2$
- }
-
+ String widthAttr = sourceElement.getAttribute(HTML.ATTR_WIDTH);
+ String styleAttr = sourceElement.getAttribute(RichFaces.ATTR_STYLE);
+ String styleClassAttr = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+ String style = Constants.EMPTY;
+ String styleClass = CSS_PMENU;
+
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, MARGIN_TOP + style);
+ div.setAttribute(HTML.ATTR_BORDER, Constants.ZERO_STRING);
+
+ if (widthAttr != null) {
+ style += "width:" + widthAttr + "; "; //$NON-NLS-1$
//$NON-NLS-2$
}
+ if (styleAttr != null) {
+ style += styleAttr;
+ }
+ div.setAttribute(HTML.ATTR_STYLE, style);
- if (styleClass != null) {
- div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
+ if (styleClassAttr != null) {
+ styleClass += Constants.WHITE_SPACE + styleClassAttr;
}
+ div.setAttribute(HTML.ATTR_CLASS, styleClass);
List<Node> children = ComponentUtil.getChildren(sourceElement);
int i = 1;