fix doesn't work for top level menu items.
suggested fix diffed to 1.5.3:
— C:\work\frameworks\ICEfaces-1.5.3-src\icefaces\component\src\com\icesoft\faces\component\menubar\MenuItemRenderer.java 2006-11-07 14:38:10.000000000 -0700
+++ C:\work\frameworks\ICEfaces-1.5.3-src-Inovis\icefaces\component\src\com\icesoft\faces\component\menubar\MenuItemRenderer.java 2007-02-21 13:54:29.000000000 -0700
@@ -145,21 +145,23 @@
Element topLevelDiv = domContext.createRootElement(HTML.DIV_ELEM);
topLevelDiv.setAttribute(HTML.ID_ATTR, clientId);
}
Element topLevelDiv = (Element) domContext.getRootNode();
topLevelDiv.setAttribute(HTML.NAME_ATTR, "TOP_LEVEL");
+ boolean isDisabled = ((MenuItem)uiComponent).isDisabled();
if (vertical)
{
- topLevelDiv.setAttribute(HTML.CLASS_ATTR,
- CSS_DEFAULT.MENU_VERTICAL_ITEM_STYLE);
+ topLevelDiv.setAttribute(HTML.CLASS_ATTR,
+ CSS_DEFAULT.MENU_VERTICAL_ITEM_STYLE + ( isDisabled ? "-dis" : "" ) );
}
else
{
- topLevelDiv.setAttribute(HTML.CLASS_ATTR,
- CSS_DEFAULT.MENU_HORIZONTAL_STYLE);
+ topLevelDiv.setAttribute(HTML.CLASS_ATTR,
+ CSS_DEFAULT.MENU_HORIZONTAL_STYLE + (isDisabled ? "-dis" : "") );
}
+
- if (uiComponent.getChildCount() > 0) {
+ if (uiComponent.getChildCount() > 0 && !isDisabled )
Unknown macro: { String displayEvent = HTML.ONMOUSEOVER_ATTR; if (vertical) {
topLevelDiv.setAttribute(displayEvent,
"Ice.Menu.hideOrphanedMenusNotRelatedTo(this);" +
expand("this", clientId + "_sub",
KEYWORD_THIS));
@@ -254,13 +256,19 @@
div.appendChild(iconImg);
} }
// create a span for text
Element span = domContext.createElement(HTML.SPAN_ELEM);
return anchor;
@@ -303,13 +311,19 @@
iconImg.setAttribute(HTML.CLASS_ATTR, "iceSubMenuRowImage ");
div.appendChild(iconImg);
}
// create a span for text
Element span = domContext.createElement(HTML.SPAN_ELEM);
return anchor;
@@ -486,13 +506,13 @@
link.setValue(nextSubMenuItem.getValue());
link.setParent(nextSubMenuItem);
link.setId(LINK_SUFFIX);
if (nextSubMenuItem.isDisabled())
{
link.setDisabled(nextSubMenuItem.isDisabled());
}
- link.setStyleClass("");
+ //link.setStyleClass("");
Node lastCursorParent = domContext.getCursorParent();
domContext.setCursorParent(subMenuItemDiv);
if (vertical)
{
addChildren(link, nextSubMenuItem, menuComponent);
}
else
{
addTopLevelChildren(link, nextSubMenuItem, menuComponent);
@@ -575,13 +595,17 @@
image.setStyleClass("iceSubMenuRowImage");
div.getChildren().add(image);
}
HtmlOutputText outputText = new HtmlOutputText();
outputText.setValue(link.getValue());
link.getChildren().add(div);
}
— C:\work\frameworks\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\resources\css\royale\royale.css 2006-11-03 14:30:58.000000000 -0700
+++ C:\work\frameworks\ICEfaces-1.5.3-src-Inovis\icefaces\core\src\com\icesoft\faces\resources\css\royale\royale.css 2007-02-21 14:51:22.000000000 -0700
@@ -1431,12 +1431,127 @@
.iceSubMenuDividerVert
{
height: auto;
float: left;
width: 100%;
}
+/* submenu disabled style classes */
+.iceSubMenuRowLabel-dis
{
+ color: #ABABAB;
+ text-decoration: none;
+ cursor: default;
+}
+
+.iceSubMenuRow-dis
{
+ color: #ABABAB;
+ text-decoration: none;
+ cursor: default;
+ padding: 0px;
+ display: block;
+ height: auto;
+}
+
+.iceSubMenuRow-dis a
{
+ color: #333333;
+ text-decoration: none;
+ cursor: default;
+ display: block;
+ padding-left: 3px;
+ padding-right: 3px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+
+}
+
+.iceSubMenuRow-dis a:hover
{
+ color: #ABABAB;
+ text-decoration: none;
+ border-bottom: 1px dotted #CCCCCC;
+ cursor: default;
+}
+.iceMenu-dis
{
+ float: left;
+ padding: 0px;
+ color: #ABABAB;
+ text-decoration: none;
+ display: block;
+ white-space: nowrap;
+}
+
+.iceMenu-dis a
{
+ background-color: #DDDDDD;
+ height: auto;
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ color: #333333; /* Must be >1.01em to avoid layout artifacts on Macs */
+ font-size: 1.1em;
+ margin: 0px;
+ border-right: 1px solid #FFFFFF;
+ width: auto;
+ float: left;
+ display: block;
+ text-decoration: none;
+ cursor: default;
+
+}
+
+.iceMenu-dis a:hover
{
+ background-color: #2A6CC2;
+ border-right: 1px solid #FFFFFF;
+ text-decoration: none;
+ color: #ABABAB;
+ cursor: default;
+}
+
+.iceMenu-dis hr, .subiceMenu-dis hr
{
+ border: none 0;
+ border-top: 1px solid #999999;
+ width: 100%;
+ height: 1px;
+ margin-top: 3px;
+ padding: 0px;
+ color: #ABABAB;
+ cursor: default;
+ text-align: left;
+}
+
+.iceMenu_verticalItem-dis
{
+ width: 160px;
+ color: #ABABAB;
+ text-decoration: none;
+ display: block;
+}
+
+.iceMenu_verticalItem-dis a
{
+ background-color: #DDDDDD;
+ height: auto;
+ padding-left: 3px;
+ padding-right: 3px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ color: #333333;
+ font-size: 1.1em;
+ margin-bottom: 1px;
+ float: none;
+ display: block;
+ text-decoration: none;
+ border: 0px solid #FFFFFF;
+ cursor: default;
+ width: 100%;
+}
+
+.iceMenu_verticalItem a:hover
{
+ background-color: #2A6CC2;
+ text-decoration: none;
+ color: #ABABAB;
+ cursor: default;
+}
+
+
/*
----------- PanelPopup ----------
*/
.icePanelPopup
{
color: #666666;
--- C:\work\frameworks\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\resources\css\xp\xp.css 2006-11-09 15:35:40.000000000 -0700
+++ C:\work\frameworks\ICEfaces-1.5.3-src-Inovis\icefaces\core\src\com\icesoft\faces\resources\css\xp\xp.css 2007-02-21 14:02:03.000000000 -0700
@@ -1357,12 +1357,60 @@
width: 100%;
height: 1px;
margin-top: 3px;
padding: 0px;
text-align: left;
}
+.iceMenu-dis
{
+ float: left;
+ padding: 0px;
+ color: #ABABAB;
+ text-decoration: none;
+ display: block;
+ white-space: nowrap;
+}
+
+.iceMenu-dis a
{
+ background-color: #DDDDDD;
+ height: auto;
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ color: #333333; /* Must be >1.01em to avoid layout artifacts on Macs */
+ font-size: 1.1em;
+ margin: 0px;
+ border-right: 1px solid #FFFFFF;
+ width: auto;
+ float: left;
+ display: block;
+ text-decoration: none;
+ cursor: default;
+
+}
+
+.iceMenu-dis a:hover
{
+ background-color: #2A6CC2;
+ border-right: 1px solid #FFFFFF;
+ text-decoration: none;
+ color: #ABABAB;
+ cursor: default;
+}
+
+.iceMenu-dis hr, .subiceMenu-dis hr
{
+ border: none 0;
+ border-top: 1px solid #999999;
+ width: 100%;
+ height: 1px;
+ margin-top: 3px;
+ padding: 0px;
+ color: #ABABAB;
+ cursor: default;
+ text-align: left;
+}
+
/* classes for the vertical version of the iceMenu*/
.iceMenu_vertical {
float: left;
padding: 0px;
white-space: nowrap;
@@ -1392,12 +1440,44 @@
.iceMenu_verticalItem a:hover
{
background-color: #2A6CC2;
color: #FFFFFF;
text-decoration: none;
}
+.iceMenu_verticalItem-dis
{
+ width: 160px;
+ color: #ABABAB;
+ text-decoration: none;
+ display: block;
+}
+
+.iceMenu_verticalItem-dis a
{
+ background-color: #DDDDDD;
+ height: auto;
+ padding-left: 3px;
+ padding-right: 3px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ color: #333333;
+ font-size: 1.1em;
+ margin-bottom: 1px;
+ float: none;
+ display: block;
+ text-decoration: none;
+ border: 0px solid #FFFFFF;
+ cursor: default;
+ width: 100%;
+}
+
+.iceMenu_verticalItem a:hover
{
+ background-color: #2A6CC2;
+ text-decoration: none;
+ color: #ABABAB;
+ cursor: default;
+}
+
.iceSubMenu {
position: absolute;
background-color: #EFEFEF;
width: 160px;
@@ -1486,12 +1566,47 @@
.iceSubMenuDividerVert
{
height: auto;
float: left;
width: 100%;
}
+/* submenu disabled style classes */
+.iceSubMenuRowLabel-dis
{
+ color: #ABABAB;
+ text-decoration: none;
+ cursor: default;
+}
+
+.iceSubMenuRow-dis
{
+ color: #ABABAB;
+ text-decoration: none;
+ cursor: default;
+ padding: 0px;
+ display: block;
+ height: auto;
+}
+
+.iceSubMenuRow-dis a
{
+ color: #333333;
+ text-decoration: none;
+ cursor: default;
+ display: block;
+ padding-left: 3px;
+ padding-right: 3px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+
+}
+
+.iceSubMenuRow-dis a:hover
{
+ color: #ABABAB;
+ text-decoration: none;
+ border-bottom: 1px dotted #CCCCCC;
+ cursor: default;
+}
+
/*
----------- PanelPopup ----------
*/
.icePanelPopup {
color: #666666;
The disabled menuItem functionality has never been fully implemented.
The disabled functionality of MenuItems will work as follows;
1) Disabling a Top Level vertical or horizontal menu item will disable all of
it's child submenu items.
2) Hover behavior will still expand submenus but they will be disabled and the
hover will not hilite like a regular active menu item.
The disabled styleclasses for the MenuBar need to be created and added to our
xp.css and royale.css.
// disabled classes for top level horizontal
iceMenu-dis
iceMenu-dis a
// disabled classes for top level vertical
iceMenu_verticalItem-dis
iceMenu_verticalItem-dis a
// disabled classes for submenus in a vertical menubar
iceSubMenu_vertical-dis
iceSubMenu_vertical-dis a
// disabled classes for submenus in a horizontal menubar
iceSubMenu-dis
iceSubMenu-dis a