Author: dmaliarevich
Date: 2008-03-31 07:15:56 -0400 (Mon, 31 Mar 2008)
New Revision: 7202
Modified:
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/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, style classes and attributes updated
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-31
11:00:47 UTC (rev 7201)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tabPanel/tabPanel.css 2008-03-31
11:15:56 UTC (rev 7202)
@@ -20,14 +20,10 @@
}
.rich-tabhdr-side-border {
- border-top-width: 1px;
- border-top-style: solid;
}
.rich-tabhdr-side-cell {
- border-top-color: #C4C0B9;
- background-repeat: no-repeat;
- background-position: top;
+
}
.rich-tabhdr-cell-active {
@@ -45,6 +41,13 @@
}
.rich-tab-header {
+ border-style: solid;
+ border-width: 1px 1px 0pt;
+ /*border-top-width: 1px;
+ border-top-style: solid;
+ border-top-color: #C4C0B9;*/
+ background-repeat: no-repeat;
+ background-position: top;
padding: 2px 10px 2px 10px;
text-align: center;
color: #000000;
@@ -57,10 +60,6 @@
}
.rich-tab-active {
- border-width: 1px;
- border-style: solid;
- padding: 3px 10px 4px 10px;
- border-bottom: 0px;
background-repeat: repeat-x;
background-position: top;
cursor: default;
@@ -70,9 +69,6 @@
}
.rich-tab-inactive {
- border-width: 1px;
- border-style: solid;
- border-bottom: 0px;
background-repeat: repeat-x;
background-position: top;
cursor: default;
@@ -80,9 +76,6 @@
}
.rich-tab-disabled {
- border-width: 1px;
- border-style: solid;
- border-bottom: 0px;
background-repeat: repeat-x;
background-position: top;
cursor: default;
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-03-31
11:00:47 UTC (rev 7201)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2008-03-31
11:15:56 UTC (rev 7202)
@@ -31,84 +31,83 @@
public class RichFacesPanelMenuGroupTemplate extends VpeAbstractTemplate {
- private static final String NAME_COMPONENT = "panelMenuGroup";
+ /*
+ * pich:panelMenuGroup attributes
+ */
+ private static final String DISABLED = "disabled"; //$NON-NLS-1$
+ private static final String DISABLED_CLASS = "disabledClass"; //$NON-NLS-1$
+ private static final String DISABLED_STYLE = "disabledStyle"; //$NON-NLS-1$
+ private static final String ICON_EXPANDED = "iconExpanded"; //$NON-NLS-1$
+ private static final String ICON_COLLAPSED = "iconCollapsed"; //$NON-NLS-1$
+ private static final String ICON_DISABLED = "iconDisabled"; //$NON-NLS-1$
+ private static final String ICON_LABEL = "label"; //$NON-NLS-1$
+ private static final String STYLE = "style"; //$NON-NLS-1$
+ private static final String STYLE_CLASS = "styleClass"; //$NON-NLS-1$
+
+ private static final String NAME_COMPONENT = "panelMenuGroup"; //$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 PANEL_MENU_ITEM_END_TAG = ":panelMenuItem";
//$NON-NLS-1$
- private static final String PANEL_MENU_END_TAG = ":panelMenu";
-
- private static final String PANEL_MENU_GROUP_END_TAG = ":panelMenuGroup";
-
- private static final String PANEL_MENU_ITEM_END_TAG = ":panelMenuItem";
-
- // *******************************************************************************
- // * Panel menu attribytes.
- // ******************************************************************************/
- private static final String PANEL_MENU_ATTR_ICON_GROUP_POSITION =
"iconGroupPosition";
-
- private static final String PANEL_MENU_ATTR_ICON_TOP_GROUP_POSITION =
"iconGroupTopPosition";
-
- private static final String PANEL_MENU_ATTR_ICON_COLLAPSED_GROUP =
"iconCollapsedGroup";
-
- private static final String PANEL_MENU_ATTR_ICON_COLLAPSED_TOP_GROUP =
"iconCollapsedTopGroup";
-
- private static final String PANEL_MENU_ATTR_ICON_EXPANDED_GROUP =
"iconExpandedGroup";
-
- private static final String PANEL_MENU_ATTR_ICON_EXPANDED_TOP_GROUP =
"iconExpandedTopGroup";
-
- private static final String PANEL_MENU_ATTR_ICON_DISABLE_GROUP =
"iconDisableGroup";
-
- private static final String PANEL_MENU_ATTR_ICON_TOP_DISABLE_GROUP =
"iconTopDisableGroup";
-
- private static final String PANEL_MENU_ATTR_DISABLED_GROUP_CLASS =
"disabledGroupClass";
-
- private static final String PANEL_MENU_ATTR_DISABLED_GROUP_STYLE =
"disabledGroupStyle";
-
- private static final String PANEL_MENU_ATTR_TOP_GROUP_CLASS =
"topGroupClass";
-
- private static final String PANEL_MENU_ATTR_GROUP_CLASS = "groupClass";
-
- private static final String PANEL_MENU_ATTR_TOP_GROUP_STYLE =
"topGroupStyle";
-
- private static final String PANEL_MENU_ATTR_GROUP_STYLE = "groupStyle";
-
- // *******************************************************************************
- // * Panel menu group attribytes.
- // ******************************************************************************/
- private static final String PANEL_MENU_GROUP_ATTR_DISABLED_STYLE =
"disabledStyle";
-
- private static final String PANEL_MENU_GROUP_ATTR_DISABLED_CLASS =
"disabledClass";
-
- private static final String PANEL_MENU_GROUP_ATTR_DISABLED = "disabled";
-
- private static final String PANEL_MENU_GROUP_ATTR_ICON_EXPANDED =
"iconExpanded";
-
- private static final String PANEL_MENU_GROUP_ATTR_ICON_COLLAPSED =
"iconCollapsed";
-
- private static final String PANEL_MENU_GROUP_ATTR_ICON_DISABLED =
"iconDisabled";
-
- private static final String PANEL_MENU_GROUP_ATTR_ICON_LABEL = "label";
-
- private static final String COMPONENT_ATTR_VPE_SUPPORT = "vpeSupport";
-
- private static final String COMPONENT_ATTR_VPE_USER_TOGGLE_ID =
"vpe-user-toggle-id";
-
- private static final String PANEL_MENU_GROUP_ICON_SPACER_PATH =
"/panelMenuGroup/spacer.gif";
-
- private static final String STYLE_PATH = "/panelMenuGroup/style.css";
-
- private static final String EMPTY_DIV_STYLE = "display: none;";
-
+ private static final String COMPONENT_ATTR_VPE_SUPPORT = "vpeSupport";
//$NON-NLS-1$
+ private static final String COMPONENT_ATTR_VPE_USER_TOGGLE_ID =
"vpe-user-toggle-id"; //$NON-NLS-1$
+ private static final String PANEL_MENU_GROUP_ICON_SPACER_PATH =
"/panelMenuGroup/spacer.gif"; //$NON-NLS-1$
+ private static final String STYLE_PATH = "/panelMenuGroup/style.css";
//$NON-NLS-1$
+ private static final String EMPTY_DIV_STYLE = "display: none;"; //$NON-NLS-1$
+
private static final Map<String, String> DEFAULT_ICON_MAP = new HashMap<String,
String>();
+
+ private static final String TRUE = "true"; //$NON-NLS-1$
+ private static final String RIGHT = "right"; //$NON-NLS-1$
+
+ /*
+ * rich:panelMenu attributes for groups
+ */
+ private static String pm_iconGroupPosition;
+ private static String pm_iconGroupTopPosition;
+ private static String pm_iconCollapsedGroup;
+ private static String pm_iconCollapsedTopGroup;
+ private static String pm_iconExpandedGroup;
+ private static String pm_iconExpandedTopGroup;
+ private static String pm_iconDisableGroup;
+ private static String pm_iconTopDisableGroup;
+
+ /*
+ * rich:panelMenu style classes for groups
+ */
+ private static String pm_disabled;
+ private static String pm_disabledGroupClass;
+ private static String pm_disabledGroupStyle;
+ private static String pm_topGroupClass;
+ private static String pm_topGroupStyle;
+ private static String pm_groupClass;
+ private static String pm_groupStyle;
+ private static String pm_style;
+ private static String pm_styleClass;
+
+ /*
+ * pich:panelMenuGroup attributes
+ */
+ private static String pmg_disabledStyle;
+ private static String pmg_disabledClass;
+ private static String pmg_disabled;
+ private static String pmg_iconExpanded;
+ private static String pmg_iconCollapsed;
+ private static String pmg_iconDisabled;
+ private static String pmg_label;
+ private static String pmg_style;
+ private static String pmg_styleClass;
static {
- DEFAULT_ICON_MAP.put("chevron", "/panelMenuGroup/chevron.gif");
- DEFAULT_ICON_MAP.put("chevronUp",
"/panelMenuGroup/chevronUp.gif");
- DEFAULT_ICON_MAP.put("chevronDown",
"/panelMenuGroup/chevronDown.gif");
- DEFAULT_ICON_MAP.put("triangle", "/panelMenuGroup/triangle.gif");
- DEFAULT_ICON_MAP.put("triangleUp",
"/panelMenuGroup/triangleUp.gif");
+ DEFAULT_ICON_MAP.put("chevron", "/panelMenuGroup/chevron.gif");
//$NON-NLS-1$ //$NON-NLS-2$
+ DEFAULT_ICON_MAP.put("chevronUp", "/panelMenuGroup/chevronUp.gif");
//$NON-NLS-1$ //$NON-NLS-2$
+ DEFAULT_ICON_MAP.put("chevronDown",
"/panelMenuGroup/chevronDown.gif"); //$NON-NLS-1$ //$NON-NLS-2$
+ DEFAULT_ICON_MAP.put("triangle", "/panelMenuGroup/triangle.gif");
//$NON-NLS-1$ //$NON-NLS-2$
+ DEFAULT_ICON_MAP.put("triangleUp",
"/panelMenuGroup/triangleUp.gif"); //$NON-NLS-1$ //$NON-NLS-2$
DEFAULT_ICON_MAP
- .put("triangleDown", "/panelMenuGroup/triangleDown.gif");
- DEFAULT_ICON_MAP.put("disc", "/panelMenuGroup/disc.gif");
- DEFAULT_ICON_MAP.put("grid", "/panelMenuGroup/grid.gif");
+ .put("triangleDown", "/panelMenuGroup/triangleDown.gif");
//$NON-NLS-1$ //$NON-NLS-2$
+ DEFAULT_ICON_MAP.put("disc", "/panelMenuGroup/disc.gif");
//$NON-NLS-1$ //$NON-NLS-2$
+ DEFAULT_ICON_MAP.put("grid", "/panelMenuGroup/grid.gif");
//$NON-NLS-1$ //$NON-NLS-2$
}
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
@@ -137,7 +136,10 @@
int childGroupCount = 1;
boolean disabled = false;
Element parent = getRichPanelParent(sourceElement);
-
+
+ readPanelMenuGroupAttributes(sourceElement);
+ readPanelMenuAttributes(sourceParentElement);
+
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, NAME_COMPONENT);
boolean expanded = activeIds.contains(childId);
nsIDOMElement div = visualDocument
@@ -146,14 +148,12 @@
div.setAttribute(COMPONENT_ATTR_VPE_SUPPORT, NAME_COMPONENT);
div.setAttribute(COMPONENT_ATTR_VPE_USER_TOGGLE_ID, childId);
- if ("true".equalsIgnoreCase(sourceParentElement
- .getAttribute(PANEL_MENU_GROUP_ATTR_DISABLED))) {
+ if (TRUE.equalsIgnoreCase(pm_disabled)) {
disabled = true;
- } else if ("true".equalsIgnoreCase(parent
- .getAttribute(PANEL_MENU_GROUP_ATTR_DISABLED))) {
+ } else if (TRUE.equalsIgnoreCase(parent
+ .getAttribute(DISABLED))) {
disabled = true;
- } else if ("true".equalsIgnoreCase(sourceElement
- .getAttribute(PANEL_MENU_GROUP_ATTR_DISABLED))) {
+ } else if (TRUE.equalsIgnoreCase(pmg_disabled)) {
disabled = true;
}
@@ -182,7 +182,7 @@
RichFacesPanelMenuGroupTemplate.encode(pageContext,
creationData, sourceParentElement,
(Element) child, visualDocument, div, activeIds,
- childId + "-" + childGroupCount);
+ childId + "-" + childGroupCount); //$NON-NLS-1$
childGroupCount++;
} else {
RichFacesPanelMenuItemTemplate
@@ -215,36 +215,31 @@
Element sourceParentElement, Element parent, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMElement div, boolean expanded,
boolean disabled, String activeChildId) {
- String disabledStyle = sourceElement
- .getAttribute(PANEL_MENU_GROUP_ATTR_DISABLED_STYLE);
+ String disabledStyle = pmg_disabledStyle;
String disableClass = null;
String style = sourceElement
.getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
String styleClass = sourceElement
.getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
- if (disabledStyle == null) {
- disabledStyle = sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_DISABLED_GROUP_STYLE);
+ if (disabledStyle == null){
+ disabledStyle = pm_disabledGroupStyle;
}
- if (sourceElement.getAttribute(PANEL_MENU_GROUP_ATTR_DISABLED_CLASS) != null) {
- disableClass = sourceElement
- .getAttribute(PANEL_MENU_GROUP_ATTR_DISABLED_CLASS);
- } else if (sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_DISABLED_GROUP_CLASS) != null) {
- disableClass = sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_DISABLED_GROUP_CLASS);
+ if (attrPresents(pmg_disabledClass)) {
+ disableClass = pmg_disabledClass;
+ } else if (attrPresents(pm_disabledGroupClass)) {
+ disableClass = pm_disabledGroupClass;
} else {
- disableClass = "rich-pmenu-group-disabled";
+ disableClass = "rich-pmenu-group-disabled"; //$NON-NLS-1$
}
nsIDOMElement table = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
div.appendChild(table);
- table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
- table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
- table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
+ 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$
nsIDOMElement tableBody = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TR);
@@ -261,15 +256,14 @@
column1.appendChild(img1);
ComponentUtil.setImg(img1, PANEL_MENU_GROUP_ICON_SPACER_PATH);
img1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- "rich-pmenu-group-icon");
+ "rich-pmenu-group-icon"); //$NON-NLS-1$
nsIDOMElement column2 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
tableBody.appendChild(column2);
- column2.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, "width: 100%;");
+ column2.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, "width: 100%;");
//$NON-NLS-1$
- nsIDOMText name = visualDocument.createTextNode(sourceElement
- .getAttribute(PANEL_MENU_GROUP_ATTR_ICON_LABEL));
+ nsIDOMText name = visualDocument.createTextNode(pmg_label);
column2.appendChild(name);
column2.setAttribute(COMPONENT_ATTR_VPE_USER_TOGGLE_ID, String
.valueOf(activeChildId));
@@ -284,7 +278,7 @@
.createElement(HtmlComponentUtil.HTML_TAG_IMG);
column3.appendChild(img2);
img2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- "rich-pmenu-group-icon");
+ "rich-pmenu-group-icon"); //$NON-NLS-1$
ComponentUtil.setImg(img2, PANEL_MENU_GROUP_ICON_SPACER_PATH);
setIcon(pageContext, parent, sourceParentElement, sourceElement, img1,
@@ -294,57 +288,50 @@
|| ((parent.getNodeName().endsWith(PANEL_MENU_GROUP_END_TAG))
&& (sourceElement.getNodeName().endsWith(PANEL_MENU_GROUP_END_TAG)))) {
if (styleClass != null
- && sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_TOP_GROUP_CLASS) != null) {
- styleClass = "dr-pmenu-group-self-label dr-pmenu-top-group"
- + " "
- + sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_TOP_GROUP_CLASS);
+ && attrPresents(pm_topGroupClass)) {
+ styleClass = "dr-pmenu-group-self-label dr-pmenu-top-group" //$NON-NLS-1$
+ + " " //$NON-NLS-1$
+ + pm_topGroupClass;
} else {
- styleClass = "dr-pmenu-group-self-label dr-pmenu-top-group";
+ styleClass = "dr-pmenu-group-self-label dr-pmenu-top-group"; //$NON-NLS-1$
}
+
if (style != null
- && sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_TOP_GROUP_STYLE) != null) {
- style = sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_TOP_GROUP_STYLE);
+ && attrPresents(pm_topGroupStyle)) {
+ style = pm_topGroupStyle;
} else {
- style = "";
+ style = ""; //$NON-NLS-1$
}
div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- "dr-pmenu-top-group-div");
+ "dr-pmenu-top-group-div"); //$NON-NLS-1$
} else {
if (styleClass != null
- && sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_GROUP_CLASS) != null) {
- styleClass = "dr-pmenu-group-self-label rich-pmenu-group-self-label"
- + " "
- + sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_GROUP_CLASS);
+ && attrPresents(pm_groupClass)) {
+ styleClass = "dr-pmenu-group-self-label rich-pmenu-group-self-label"
//$NON-NLS-1$
+ + " " //$NON-NLS-1$
+ + pm_groupClass;
} else {
- styleClass = "dr-pmenu-group-self-label rich-pmenu-group-self-label";
+ styleClass = "dr-pmenu-group-self-label rich-pmenu-group-self-label";
//$NON-NLS-1$
}
if (style != null
- && sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_GROUP_STYLE) != null) {
- style = sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_GROUP_STYLE);
+ && attrPresents(pm_groupStyle)) {
+ style = pm_groupStyle;
} else {
- style = "";
+ style = ""; //$NON-NLS-1$
}
div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- "dr-pmenu-top-self-div");
+ "dr-pmenu-top-self-div"); //$NON-NLS-1$
}
if (disabled) {
- styleClass = styleClass + " " + disableClass;
+ styleClass = styleClass + " " + disableClass; //$NON-NLS-1$
if (disabledStyle != null) {
- style = style + " " + disabledStyle;
+ style = style + " " + disabledStyle; //$NON-NLS-1$
}
}
- if (!"".equals(style.trim())) {
+ if (!"".equals(style.trim())) { //$NON-NLS-1$
table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
}
table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
@@ -370,47 +357,36 @@
nsIDOMElement img1, nsIDOMElement img2, boolean expanded,
boolean disabled) {
boolean needChangePosition = false;
- String pathIconExpanded = sourceElement
- .getAttribute(PANEL_MENU_GROUP_ATTR_ICON_EXPANDED);
- String pathIconCollapsed = sourceElement
- .getAttribute(PANEL_MENU_GROUP_ATTR_ICON_COLLAPSED);
- String pathIconDisabled = sourceElement
- .getAttribute(PANEL_MENU_GROUP_ATTR_ICON_DISABLED);
+ String pathIconExpanded = pmg_iconExpanded;
+ String pathIconCollapsed = pmg_iconCollapsed;
+ String pathIconDisabled = pmg_iconDisabled;
if (parent.getNodeName().endsWith(PANEL_MENU_END_TAG)) {
if (pathIconExpanded == null) {
- pathIconExpanded = sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_ICON_EXPANDED_TOP_GROUP);
+ pathIconExpanded = pm_iconExpandedTopGroup;
}
if (pathIconCollapsed == null) {
- pathIconCollapsed = sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_ICON_COLLAPSED_TOP_GROUP);
+ pathIconCollapsed = pm_iconCollapsedTopGroup;
}
if (pathIconDisabled == null) {
- pathIconDisabled = sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_ICON_TOP_DISABLE_GROUP);
+ pathIconDisabled = pm_iconTopDisableGroup;
}
- if ("right".equals(sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_ICON_TOP_GROUP_POSITION))) {
+ if (RIGHT.equals(pm_iconGroupTopPosition)) {
needChangePosition = true;
}
} else {
if (pathIconExpanded == null) {
- pathIconExpanded = sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_ICON_EXPANDED_GROUP);
+ pathIconExpanded = pm_iconExpandedGroup;
}
if (pathIconCollapsed == null) {
- pathIconCollapsed = sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_ICON_COLLAPSED_GROUP);
+ pathIconCollapsed = pm_iconCollapsedGroup;
}
if (pathIconDisabled == null) {
- pathIconDisabled = sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_ICON_DISABLE_GROUP);
+ pathIconDisabled = pm_iconDisableGroup;
}
- if ("right".equals(sourceParentElement
- .getAttribute(PANEL_MENU_ATTR_ICON_GROUP_POSITION))) {
+ if (RIGHT.equals(pm_iconGroupPosition)) {
needChangePosition = true;
}
}
@@ -455,4 +431,78 @@
}
}
}
+
+ /**
+ * Read attributes from the source element.
+ *
+ * @param sourceNode the source node
+ */
+ private static void readPanelMenuAttributes(Element sourceParentElement) {
+
+ if (null == sourceParentElement) {
+ return;
+ }
+
+ /*
+ * rich:panelMenu attributes for groups
+ */
+ pm_iconGroupPosition =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_GROUP_POSITION);
+ pm_iconGroupTopPosition =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_GROUP_TOP_POSITION);
+ pm_iconCollapsedGroup =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_COLLAPSED_GROUP);
+ pm_iconCollapsedTopGroup =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_COLLAPSED_TOP_GROUP);
+ pm_iconExpandedGroup =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_EXPANDED_GROUP);
+ pm_iconExpandedTopGroup =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_EXPANDED_TOP_GROUP);
+ pm_iconDisableGroup =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_DISABLE_GROUP);
+ pm_iconTopDisableGroup =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_TOP_DISABLE_GROUP);
+
+ /*
+ * rich:panelMenu style classes for groups
+ */
+ pm_disabled = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.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);
+ }
+
+ /**
+ * Read attributes from the source element.
+ *
+ * @param sourceNode the source node
+ */
+ private static void readPanelMenuGroupAttributes(Element sourceElement) {
+
+ if (null == sourceElement) {
+ return;
+ }
+
+ /*
+ * pich:panelMenuGroup attributes
+ */
+ pmg_disabledStyle = sourceElement.getAttribute(DISABLED_STYLE);
+ pmg_disabledClass = sourceElement.getAttribute(DISABLED_CLASS);
+ pmg_disabled = sourceElement.getAttribute(DISABLED);
+ pmg_iconExpanded = sourceElement.getAttribute(ICON_EXPANDED);
+ pmg_iconCollapsed = sourceElement.getAttribute(ICON_COLLAPSED);
+ pmg_iconDisabled = sourceElement.getAttribute(ICON_DISABLED);
+ pmg_label = sourceElement.getAttribute(ICON_LABEL);
+ pmg_style = sourceElement.getAttribute(STYLE);
+ pmg_styleClass = sourceElement.getAttribute(STYLE_CLASS);
+ }
+
+
+ /**
+ * Checks is attribute presents.
+ *
+ * @param attr the attribute
+ *
+ * @return true, if successful
+ */
+ private static boolean attrPresents(String attr) {
+ return ((null != attr) && (!"".equals(attr))); //$NON-NLS-1$
+ }
}
\ No newline at end of file
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-03-31
11:00:47 UTC (rev 7201)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2008-03-31
11:15:56 UTC (rev 7202)
@@ -27,66 +27,69 @@
public class RichFacesPanelMenuItemTemplate extends VpeAbstractTemplate {
- private static final String STYLE_PATH = "/panelMenuItem/style.css";
+ /*
+ * rich:panelMenuItem attributes
+ */
+ private static final String DISABLED = "disabled"; //$NON-NLS-1$
+ private static final String ICON = "icon"; //$NON-NLS-1$
+ private static final String ICON_DISABLED = "iconDisabled"; //$NON-NLS-1$
+ private static final String ITEM_CLASS = "itemClass"; //$NON-NLS-1$
+ private static final String ITEM_STYLE = "itemStyle"; //$NON-NLS-1$
+ private static final String DISABLED_CLASS = "disabledClass"; //$NON-NLS-1$
+ private static final String DISABLED_STYLE = "disabledStyle"; //$NON-NLS-1$
+ private static final String STYLE = "style"; //$NON-NLS-1$
+ private static final String STYLE_CLASS = "styleClass"; //$NON-NLS-1$
- private static final String PANEL_MENU_ITEM_CLASS = "dr-pmenu-item";
+
+ private static final String PANEL_MENU_ITEM_CLASS = "dr-pmenu-item";
//$NON-NLS-1$
+ private static final String PANEL_MENU_NOWARP_CLASS = "dr-pmenu-nowrap";
//$NON-NLS-1$
+ private static final String PANEL_MENU_LABLE_CLASS =
"dr-pmenu-group-self-label"; //$NON-NLS-1$
+ private static final String PANEL_MENU_DIV = "dr-pmenu-top-self-div";
//$NON-NLS-1$
+ private static final String DISABLED_CLASS_NAME = "dr-pmenu-item-disabled";
//$NON-NLS-1$
+
+ private static final String IMG_POINTS_SRC = "/panelMenuItem/points.gif";
//$NON-NLS-1$
+ private static final String IMG_SPACER_SRC = "/panelMenuItem/spacer.gif";
//$NON-NLS-1$
+ private static final String STYLE_PATH = "/panelMenuItem/style.css";
//$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 PANEL_MENU_ITEM = "panelMenuItem"; //$NON-NLS-1$
+ private static final String EMPTY_DIV_STYLE = "display: none;"; //$NON-NLS-1$
+
+ /*
+ * rich:panelMenu attributes for items
+ */
+ private static String pm_iconItem;
+ private static String pm_iconDisabledItem;
+ private static String pm_iconItemPosition;
+ private static String pm_iconTopItem;
+ private static String pm_iconTopDisabledItem;
+ private static String pm_iconItemTopPosition;
+
+ /*
+ * rich:panelMenu style classes for items
+ */
+ private static String pm_disabledItemClass;
+ private static String pm_disabledItemStyle;
+ private static String pm_topItemClass;
+ private static String pm_topItemStyle;
+ private static String pm_itemClass;
+ private static String pm_itemStyle;
+
+ /*
+ * rich:panelMenuItem attributes
+ */
+ private static String pmi_disabled;
+ private static String pmi_icon;
+ private static String pmi_iconDisabled;
+ private static String pmi_itemClass;
+ private static String pmi_itemStyle;
+ private static String pmi_disabledClass;
+ private static String pmi_disabledStyle;
+ private static String pmi_style;
+ private static String pmi_styleClass;
- private static final String NO_SIZE_VALUE = "0";
-
- private static final String DEFAULT_SIZE_VALUE = "16";
-
- private static final String PANEL_MENU_NOWARP_CLASS = "dr-pmenu-nowrap";
-
- private static final String PANEL_MENU_LABLE_CLASS =
"dr-pmenu-group-self-label";
-
- private static final String PANEL_MENU_DIV = "dr-pmenu-top-self-div";
-
- private static final String PANEL_MENU_ITEM = "panelMenuItem";
-
- private static final String IMG_POINTS_SRC = "/panelMenuItem/points.gif";
-
- private static final String IMG_SPACER_SRC = "/panelMenuItem/spacer.gif";
-
- private static final String EMPTY_DIV_STYLE = "display: none;";
-
- private static final String DISABLED_CLASS = "dr-pmenu-item-disabled";
-
- private static final String DISABLED_ITEM_STYLE = "disabledItemStyle";
-
- private static final String ITEM_CLASS = "itemClass";
-
- private static final String ICON_ITEM_TOP_POSITION = "iconItemTopPosition";
-
- private static final String TOP_ITEM_STYLE = "topItemStyle";
-
- private static final String ICON_TOP_DISABLED_ITEM = "iconTopDisabledItem";
-
- private static final String DISABLE_ITEM_CLASS = "disableItemClass";
-
- private static final String ICON_DISABLED_ITEM = "iconDisabledItem";
-
- private static final String ICON_ITEM_POSITION = "iconItemPosition";
-
- private static final String ICON_ITEM = "iconItem";
-
- private static final String ICON_TOP_ITEM = "iconTopItem";
-
- private static final String TOP_ITEM_CLASS = "topItemClass";
-
- private static final String ITEM_STYLE = "itemStyle";
-
- private static final String ICON_DISABLED = "iconDisabled";
-
- private static final String ICON = "icon";
-
- private static final String STYLE_CLASS = "styleClass";
-
- private static final String STYLE = "style";
-
- private static final String DISABLED = "disabledClass";
-
- private static final String DISABLED_STYLE = "disabledStyle";
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
nsIDOMElement div = visualDocument
@@ -103,8 +106,11 @@
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, PANEL_MENU_ITEM);
- nsIDOMElement parentDiv = visualDocument.createElement("div");
- parentDiv.setAttribute("CLASS", PANEL_MENU_DIV);
+ readPanelMenuAttributes(sourceParentElement);
+ readPanelMenuItemAttributes(sourceElement);
+
+ nsIDOMElement parentDiv = visualDocument.createElement("div"); //$NON-NLS-1$
+ parentDiv.setAttribute("CLASS", PANEL_MENU_DIV); //$NON-NLS-1$
parentVisualElement.appendChild(parentDiv);
nsIDOMElement div = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_DIV);
@@ -112,10 +118,10 @@
parentDiv.appendChild(div);
if (sourceElement.getParentNode().getNodeName().endsWith(
- ":panelMenuGroup")
+ ":panelMenuGroup") //$NON-NLS-1$
|| (sourceElement.getParentNode().getNodeName()
- .endsWith(":panelMenu"))) {
- div.setAttribute("vpeSupport", PANEL_MENU_ITEM);
+ .endsWith(":panelMenu"))) { //$NON-NLS-1$
+ div.setAttribute("vpeSupport", PANEL_MENU_ITEM); //$NON-NLS-1$
nsIDOMElement table = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
div.appendChild(table);
@@ -145,10 +151,10 @@
tdLable.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
PANEL_MENU_LABLE_CLASS);
tdLable.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- "element.style");
+ "element.style"); //$NON-NLS-1$
- String value = sourceElement.getAttribute("label");
- nsIDOMText text = visualDocument.createTextNode(value == null ? ""
+ String value = sourceElement.getAttribute("label"); //$NON-NLS-1$
+ nsIDOMText text = visualDocument.createTextNode(value == null ? ""
//$NON-NLS-1$
: value);
tdLable.appendChild(text);
@@ -171,54 +177,41 @@
.createElement(HtmlComponentUtil.HTML_TAG_IMG);
if (sourceElement.getParentNode().getNodeName().endsWith(
- ":panelMenu")) {
+ ":panelMenu")) { //$NON-NLS-1$
- if (isDisabledItem(sourceElement.getAttribute("disabled"))) {
+ if ("true".equalsIgnoreCase(pmi_disabled)) { //$NON-NLS-1$
setIcon(pageContext, imgPoints, sourceElement,
- sourceParentElement, ICON_TOP_DISABLED_ITEM,
- ICON_DISABLED);
- setItemClassAndStyle(table, sourceParentElement
- .getAttribute(DISABLE_ITEM_CLASS), sourceElement
- .getAttribute(DISABLED), DISABLED_CLASS,
- sourceParentElement
- .getAttribute(DISABLED_ITEM_STYLE),
- sourceElement.getAttribute(DISABLED_STYLE));
+ sourceParentElement, pm_iconTopDisabledItem,
+ pmi_iconDisabled);
+ setItemClassAndStyle(table, pm_disabledItemClass,
+ pmi_disabledClass, DISABLED_CLASS_NAME,
+ pm_disabledItemStyle, pmi_disabledStyle);
} else {
setIcon(pageContext, imgPoints, sourceElement,
- sourceParentElement, ICON_TOP_ITEM, ICON);
- setItemClassAndStyle(table, sourceParentElement
- .getAttribute(TOP_ITEM_CLASS), sourceElement
- .getAttribute(STYLE_CLASS), PANEL_MENU_ITEM_CLASS,
- sourceParentElement.getAttribute(TOP_ITEM_STYLE),
- sourceElement.getAttribute(STYLE));
+ sourceParentElement, pm_iconTopItem, pmi_icon);
+ setItemClassAndStyle(table, pm_topItemClass,
+ pmi_styleClass, PANEL_MENU_ITEM_CLASS,
+ pm_topItemStyle, pmi_style);
}
- setIconPosition(sourceParentElement
- .getAttribute(ICON_ITEM_TOP_POSITION), td, tdNowrap,
+ setIconPosition(pm_iconItemTopPosition, td, tdNowrap,
imgPoints, imgSpacer2);
} else {
- if (isDisabledItem(sourceElement.getAttribute("disabled"))) {
+ if ("true".equalsIgnoreCase(pmi_disabled)) { //$NON-NLS-1$
setIcon(pageContext, imgPoints, sourceElement,
- sourceParentElement, ICON_DISABLED_ITEM,
- ICON_DISABLED);
- setItemClassAndStyle(table, sourceParentElement
- .getAttribute(DISABLE_ITEM_CLASS), sourceElement
- .getAttribute(DISABLED), DISABLED_CLASS,
- sourceParentElement
- .getAttribute(DISABLED_ITEM_STYLE),
- sourceElement.getAttribute(DISABLED_STYLE));
+ sourceParentElement, pm_iconDisabledItem,
+ pmi_iconDisabled);
+ setItemClassAndStyle(table, pm_disabledItemClass,
+ pmi_disabledClass, DISABLED_CLASS_NAME,
+ pm_disabledItemStyle, pmi_disabledStyle);
} else {
setIcon(pageContext, imgPoints, sourceElement,
- sourceParentElement, ICON_ITEM, ICON);
- setItemClassAndStyle(table, sourceParentElement
- .getAttribute(ITEM_CLASS), sourceElement
- .getAttribute(STYLE_CLASS), PANEL_MENU_ITEM_CLASS,
- sourceParentElement.getAttribute(ITEM_STYLE),
- sourceElement.getAttribute(STYLE));
+ sourceParentElement, pm_iconItem, pmi_icon);
+ setItemClassAndStyle(table, pm_itemClass, pmi_styleClass,
+ PANEL_MENU_ITEM_CLASS, pm_itemStyle, pmi_style);
}
- setIconPosition(sourceParentElement
- .getAttribute(ICON_ITEM_POSITION), td, tdNowrap,
- imgPoints, imgSpacer2);
+ setIconPosition(pm_iconItemPosition, td, tdNowrap, imgPoints,
+ imgSpacer2);
}
List<Node> children = ComponentUtil.getChildren(sourceElement);
@@ -227,8 +220,8 @@
VpeChildrenInfo childInfo = new VpeChildrenInfo(tdLable);
creationData.addChildrenInfo(childInfo);
for (Node child : children) {
- if (!(child.getNodeName().endsWith(":panelMenuGroup") || child
- .getNodeName().endsWith(":panelMenu"))) {
+ if (!(child.getNodeName().endsWith(":panelMenuGroup") || child
//$NON-NLS-1$
+ .getNodeName().endsWith(":panelMenu"))) { //$NON-NLS-1$
childInfo.addSourceChild(child);
}
}
@@ -246,8 +239,8 @@
private static void setDefaultImgAttributes(nsIDOMElement element) {
element.setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH,
DEFAULT_SIZE_VALUE);
- element.setAttribute("vspace", NO_SIZE_VALUE);
- element.setAttribute("hspace", NO_SIZE_VALUE);
+ element.setAttribute("vspace", NO_SIZE_VALUE); //$NON-NLS-1$
+ element.setAttribute("hspace", NO_SIZE_VALUE); //$NON-NLS-1$
element.setAttribute(HtmlComponentUtil.HTML_ATR_HEIGHT,
DEFAULT_SIZE_VALUE);
}
@@ -257,28 +250,19 @@
setDefaultImgAttributes(image);
}
- private static boolean isDisabledItem(String disabled) {
- if ("true".equals(disabled)) {
- return true;
- }
- return false;
- }
-
private static void setIcon(VpePageContext pageContext,
nsIDOMElement imgPoints, Element sourceElement,
- Element parentElement, String parentIconAttribute,
- String iconAttribute) {
- String icon = sourceElement.getAttribute(iconAttribute);
- String parentIcon = parentElement.getAttribute(parentIconAttribute);
- if (icon == null || icon.length() == 0) {
- if (!(parentIcon == null || parentIcon.length() == 0)) {
+ Element parentElement, String parentIconPath,
+ String iconPath) {
+ if (iconPath == null || iconPath.length() == 0) {
+ if (!(parentIconPath == null || parentIconPath.length() == 0)) {
ComponentUtil.setImgFromResources(pageContext, imgPoints,
- parentIcon, IMG_SPACER_SRC);
+ parentIconPath, IMG_SPACER_SRC);
} else {
ComponentUtil.setImg(imgPoints, IMG_POINTS_SRC);
}
} else {
- ComponentUtil.setImgFromResources(pageContext, imgPoints, icon,
+ ComponentUtil.setImgFromResources(pageContext, imgPoints, iconPath,
IMG_SPACER_SRC);
}
}
@@ -287,12 +271,12 @@
nsIDOMElement right, nsIDOMElement left, nsIDOMElement imgPoints,
nsIDOMElement imgSpacer2) {
if (!(iconPosition == null)) {
- if (iconPosition.equals("right")) {
+ if (iconPosition.equals("right")) { //$NON-NLS-1$
setItemImage(right, imgPoints);
} else {
setItemImage(right, imgSpacer2);
ComponentUtil.setImg(imgSpacer2, IMG_SPACER_SRC);
- if (iconPosition.equals("left")) {
+ if (iconPosition.equals("left")) { //$NON-NLS-1$
setItemImage(left, imgPoints);
}
}
@@ -306,7 +290,7 @@
private static void setItemClassAndStyle(nsIDOMElement table,
String parentClass, String itemClass, String defaultClass,
String parentStyle, String itemStyle) {
- String resultClass = "";
+ String resultClass = ""; //$NON-NLS-1$
if (!(parentClass == null || parentClass.length() == 0)) {
resultClass += parentClass;
}
@@ -314,9 +298,9 @@
resultClass += itemClass;
}
table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, defaultClass
- + " " + resultClass);
+ + " " + resultClass); //$NON-NLS-1$
- String resultStyle = "";
+ String resultStyle = ""; //$NON-NLS-1$
if (!(parentStyle == null || parentStyle.length() == 0)) {
resultStyle += parentStyle;
}
@@ -325,4 +309,63 @@
}
table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, resultStyle);
}
+
+ /**
+ * Read attributes from the source element.
+ *
+ * @param sourceNode the source node
+ */
+ private static void readPanelMenuAttributes(Element sourceParentElement) {
+
+ if (null == sourceParentElement) {
+ return;
+ }
+
+ /*
+ * rich:panelMenu attributes for items
+ */
+ pm_iconItem = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_ITEM);
+ pm_iconDisabledItem =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_DISABLED_ITEM);
+ pm_iconItemPosition =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_ITEM_POSITION);
+ pm_iconTopItem =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_TOP_ITEM);
+ pm_iconTopDisabledItem =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_TOP_DISABLED_ITEM);
+ pm_iconItemTopPosition =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_ITEM_TOP_POSITION);
+
+ /*
+ * rich:panelMenu style classes for items
+ */
+ pm_disabledItemClass =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.DISABLED_ITEM_CLASS);
+ pm_disabledItemStyle =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.DISABLED_ITEM_STYLE);
+ pm_topItemClass =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.TOP_ITEM_CLASS);
+ pm_topItemStyle =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.TOP_ITEM_STYLE);
+ pm_itemClass =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ITEM_CLASS);
+ pm_itemStyle =
sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ITEM_STYLE);
+
+ }
+
+ /**
+ * Read attributes from the source element.
+ *
+ * @param sourceNode the source node
+ */
+ private static void readPanelMenuItemAttributes(Element sourceElement) {
+
+ if (null == sourceElement) {
+ return;
+ }
+
+ /*
+ * pich:panelMenuItem attributes
+ */
+ pmi_disabled = sourceElement.getAttribute(DISABLED);
+ pmi_icon = sourceElement.getAttribute(ICON);
+ pmi_iconDisabled = sourceElement.getAttribute(ICON_DISABLED);
+ pmi_itemClass = sourceElement.getAttribute(ITEM_CLASS);
+ pmi_itemStyle = sourceElement.getAttribute(ITEM_STYLE);
+ pmi_disabledClass = sourceElement.getAttribute(DISABLED_CLASS);
+ pmi_disabledStyle = sourceElement.getAttribute(DISABLED_STYLE);
+ pmi_style = sourceElement.getAttribute(STYLE);
+ pmi_styleClass = sourceElement.getAttribute(STYLE_CLASS);
+
+ }
}
\ No newline at end of file
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-03-31
11:00:47 UTC (rev 7201)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java 2008-03-31
11:15:56 UTC (rev 7202)
@@ -39,13 +39,61 @@
public class RichFacesPanelMenuTemplate extends VpeAbstractTemplate implements
VpeToggableTemplate {
- private static final String WIDTH_ATTR_PANELMENU = "width";
- private static final String STYLE_ATTR_PANELMENU = "style";
- private static final String STYLECLASS_ATTR_PANELMENU = "styleClass";
+ /*
+ * rich:panelMenu attributes for groups
+ */
+ public static final String ICON_GROUP_POSITION = "iconGroupPosition";
//$NON-NLS-1$
+ public static final String ICON_GROUP_TOP_POSITION = "iconGroupTopPosition";
//$NON-NLS-1$
+ public static final String ICON_COLLAPSED_GROUP = "iconCollapsedGroup";
//$NON-NLS-1$
+ public static final String ICON_COLLAPSED_TOP_GROUP = "iconCollapsedTopGroup";
//$NON-NLS-1$
+ public static final String ICON_EXPANDED_GROUP = "iconExpandedGroup";
//$NON-NLS-1$
+ public static final String ICON_EXPANDED_TOP_GROUP = "iconExpandedTopGroup";
//$NON-NLS-1$
+ public static final String ICON_DISABLE_GROUP = "iconDisableGroup";
//$NON-NLS-1$
+ public static final String ICON_TOP_DISABLE_GROUP = "iconTopDisableGroup";
//$NON-NLS-1$
+
+ /*
+ * rich:panelMenu attributes for items
+ */
+ public static final String ICON_ITEM = "iconItem"; //$NON-NLS-1$
+ public static final String ICON_DISABLED_ITEM = "iconDisabledItem";
//$NON-NLS-1$
+ public static final String ICON_ITEM_POSITION = "iconItemPosition";
//$NON-NLS-1$
+ public static final String ICON_TOP_ITEM = "iconTopItem"; //$NON-NLS-1$
+ public static final String ICON_TOP_DISABLED_ITEM = "iconTopDisabledItem";
//$NON-NLS-1$
+ public static final String ICON_ITEM_TOP_POSITION = "iconItemTopPosition";
//$NON-NLS-1$
+
+ /*
+ * rich:panelMenu style classes
+ */
+ public static final String DISABLED = "disabled"; //$NON-NLS-1$
+ 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$
+ public static final String DISABLED_GROUP_STYLE = "disabledGroupStyle";
//$NON-NLS-1$
+ public static final String TOP_GROUP_CLASS = "topGroupClass"; //$NON-NLS-1$
+ public static final String TOP_GROUP_STYLE = "topGroupStyle"; //$NON-NLS-1$
+ public static final String GROUP_CLASS = "groupClass"; //$NON-NLS-1$
+ public static final String GROUP_STYLE = "groupStyle"; //$NON-NLS-1$
+
+ /*
+ * rich:panelMenu style classes for items
+ */
+ public static final String DISABLED_ITEM_CLASS = "disabledItemClass";
//$NON-NLS-1$
+ public static final String DISABLED_ITEM_STYLE = "disabledItemStyle";
//$NON-NLS-1$
+ public static final String TOP_ITEM_CLASS = "topItemClass"; //$NON-NLS-1$
+ public static final String TOP_ITEM_STYLE = "topItemStyle"; //$NON-NLS-1$
+ public static final String ITEM_CLASS = "itemClass"; //$NON-NLS-1$
+ public static final String ITEM_STYLE = "itemStyle"; //$NON-NLS-1$
- private static final String PANEL_MENU_GROUP_END = ":panelMenuGroup";
- private static final String PANEL_MENU_ITEM_END = ":panelMenuItem";
+
+ private static final String WIDTH_ATTR_PANELMENU = "width"; //$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$
+
private List<String> activeIds = new ArrayList<String>();
// private static final String DISABLED_STYLE_FOR_TABLE = "color:#B1ADA7";
@@ -56,12 +104,12 @@
Element sourceElement = (Element) sourceNode;
String width = sourceElement.getAttribute(WIDTH_ATTR_PANELMENU);
- String style = sourceElement.getAttribute(STYLE_ATTR_PANELMENU);
+ String style = sourceElement.getAttribute(STYLE);
String styleClass = sourceElement
- .getAttribute(STYLECLASS_ATTR_PANELMENU);
+ .getAttribute(STYLE_CLASS);
if (width != null) {
- style += "" + "; width:" + width;
+ style += "" + "; width:" + width; //$NON-NLS-1$ //$NON-NLS-2$
}
nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);