diff --git a/source/java/org/alfresco/web/ui/common/PanelGenerator.java b/source/java/org/alfresco/web/ui/common/PanelGenerator.java index 761596c1e0..e253842c78 100644 --- a/source/java/org/alfresco/web/ui/common/PanelGenerator.java +++ b/source/java/org/alfresco/web/ui/common/PanelGenerator.java @@ -184,5 +184,62 @@ public final class PanelGenerator out.write("' style='padding-top:6px;'>"); } + public static void generateExpandedTitledPanelMiddle(Writer out, String contextPath, String titlePanel, + String expandedTitlePanel, String contentPanel, String contentBgColor) throws IOException + { + // generate the expanded part, just under the title + out.write(""); + + out.write(""); + + out.write(""); + + out.write(""); + + out.write(""); + } + public final static String BGCOLOR_WHITE = "#FFFFFF"; } diff --git a/source/java/org/alfresco/web/ui/common/component/UIPanel.java b/source/java/org/alfresco/web/ui/common/component/UIPanel.java index 7a5842fc68..31af10f067 100644 --- a/source/java/org/alfresco/web/ui/common/component/UIPanel.java +++ b/source/java/org/alfresco/web/ui/common/component/UIPanel.java @@ -119,8 +119,8 @@ public class UIPanel extends UICommand // determine if we have a bordered title area, note, we also need to have // the content area border defined as well - if ((getTitleBgcolor() != null) && (getTitleBorder() != null) && - (getBorder() != null) && this.hasAdornments) + if (getTitleBgcolor() != null && getTitleBorder() != null && + getBorder() != null && this.hasAdornments) { this.hasBorderedTitleArea = true; } @@ -155,7 +155,7 @@ public class UIPanel extends UICommand { out.write(""); if (isExpanded() == true) @@ -204,12 +204,25 @@ public class UIPanel extends UICommand // if we have the titled border area, output the middle section if (this.hasBorderedTitleArea && isExpanded()) { - PanelGenerator.generateTitledPanelMiddle( - out, - context.getExternalContext().getRequestContextPath(), - getTitleBorder(), - getBorder(), - getBgcolor()); + if (getExpandedTitleBorder() != null) + { + PanelGenerator.generateExpandedTitledPanelMiddle( + out, + context.getExternalContext().getRequestContextPath(), + getTitleBorder(), + getExpandedTitleBorder(), + getBorder(), + getBgcolor()); + } + else + { + PanelGenerator.generateTitledPanelMiddle( + out, + context.getExternalContext().getRequestContextPath(), + getTitleBorder(), + getBorder(), + getBgcolor()); + } } } @@ -248,7 +261,7 @@ public class UIPanel extends UICommand public void decode(FacesContext context) { Map requestMap = context.getExternalContext().getRequestParameterMap(); - String fieldId = getHiddenFieldName(); + String fieldId = getHiddenFieldName(context); String value = (String)requestMap.get(fieldId); // we encoded the value to start with our Id @@ -312,8 +325,9 @@ public class UIPanel extends UICommand this.label = (String)values[5]; this.titleBgcolor = (String)values[6]; this.titleBorder = (String)values[7]; - this.expandedActionListener = (MethodBinding)values[8]; - this.facetsId = (String)values[9]; + this.expandedTitleBorder = (String)values[8]; + this.expandedActionListener = (MethodBinding)values[9]; + this.facetsId = (String)values[10]; } /** @@ -321,18 +335,18 @@ public class UIPanel extends UICommand */ public Object saveState(FacesContext context) { - Object values[] = new Object[10]; - // standard component attributes are saved by the super class - values[0] = super.saveState(context); - values[1] = (isExpanded() ? Boolean.TRUE : Boolean.FALSE); - values[2] = this.progressive; - values[3] = this.border; - values[4] = this.bgcolor; - values[5] = this.label; - values[6] = this.titleBgcolor; - values[7] = this.titleBorder; - values[8] = this.expandedActionListener; - values[9] = this.facetsId; + Object values[] = new Object[] { + super.saveState(context), + (isExpanded() ? Boolean.TRUE : Boolean.FALSE), + this.progressive, + this.border, + this.bgcolor, + this.label, + this.titleBgcolor, + this.titleBorder, + this.expandedTitleBorder, + this.expandedActionListener, + this.facetsId}; return values; } @@ -443,6 +457,28 @@ public class UIPanel extends UICommand { this.titleBorder = titleBorder; } + + /** + * @return Returns the border style of the expanded title area + */ + public String getExpandedTitleBorder() + { + ValueBinding vb = getValueBinding("expandedTitleBorder"); + if (vb != null) + { + this.expandedTitleBorder = (String)vb.getValue(getFacesContext()); + } + + return this.expandedTitleBorder; + } + + /** + * @param expandedTitleBorder Sets the border style of the expanded title area + */ + public void setExpandedTitleBorder(String expandedTitleBorder) + { + this.expandedTitleBorder = expandedTitleBorder; + } /** * @return Returns the label. @@ -565,10 +601,10 @@ public class UIPanel extends UICommand * * @return hidden field name */ - private String getHiddenFieldName() + private String getHiddenFieldName(FacesContext fc) { - UIForm form = Utils.getParentForm(getFacesContext(), this); - return form.getClientId(getFacesContext()) + NamingContainer.SEPARATOR_CHAR + "panel"; + UIForm form = Utils.getParentForm(fc, this); + return form.getClientId(fc) + NamingContainer.SEPARATOR_CHAR + "panel"; } @@ -580,6 +616,7 @@ public class UIPanel extends UICommand private String bgcolor = null; private String titleBorder = null; private String titleBgcolor = null; + private String expandedTitleBorder = null; private Boolean progressive = null; private String label = null; private String facetsId = null; diff --git a/source/java/org/alfresco/web/ui/common/tag/PanelTag.java b/source/java/org/alfresco/web/ui/common/tag/PanelTag.java index a7504dd8a2..dc742447e8 100644 --- a/source/java/org/alfresco/web/ui/common/tag/PanelTag.java +++ b/source/java/org/alfresco/web/ui/common/tag/PanelTag.java @@ -59,6 +59,7 @@ public class PanelTag extends HtmlComponentTag setStringProperty(component, "bgcolor", this.bgcolor); setStringProperty(component, "titleBorder", this.titleBorder); setStringProperty(component, "titleBgcolor", this.titleBgcolor); + setStringProperty(component, "expandedTitleBorder", this.expandedTitleBorder); setBooleanProperty(component, "expanded", this.expanded); setStringProperty(component, "facetsId", this.facetsId); if (expandedActionListener != null) @@ -85,6 +86,9 @@ public class PanelTag extends HtmlComponentTag this.border = null; this.progressive = null; this.bgcolor = null; + this.titleBorder = null; + this.titleBgcolor = null; + this.expandedTitleBorder = null; this.expanded = null; this.expandedActionListener = null; this.facetsId = null; @@ -173,6 +177,14 @@ public class PanelTag extends HtmlComponentTag { this.titleBorder = titleBorder; } + + /** + * @param expandedTitleBorder The expanded title area border style + */ + public void setExpandedTitleBorder(String expandedTitleBorder) + { + this.expandedTitleBorder = expandedTitleBorder; + } /** * Set whether the panel is expanded, default is true. @@ -229,6 +241,9 @@ public class PanelTag extends HtmlComponentTag /** the title border style */ private String titleBorder; + /** the expanded title border style */ + private String expandedTitleBorder; + /** the title bgcolor */ private String titleBgcolor; } diff --git a/source/java/org/alfresco/web/ui/repo/component/UINavigator.java b/source/java/org/alfresco/web/ui/repo/component/UINavigator.java index afbb920ef1..2439c2ae67 100644 --- a/source/java/org/alfresco/web/ui/repo/component/UINavigator.java +++ b/source/java/org/alfresco/web/ui/repo/component/UINavigator.java @@ -222,11 +222,15 @@ public class UINavigator extends SelfRenderingComponent areaTitle = Application.getMessage(context, "my_alfresco"); } + // main container div + out.write("
"); + // generate the active panel title - out.write("
"); - out.write("
"); + String cxPath = context.getExternalContext().getRequestContextPath(); + out.write("
"); + out.write(""); out.write(areaTitle); - out.write("
"); + out.write("
"); // generate the javascript method to capture the tree node click events if (treePanel) @@ -253,11 +257,13 @@ public class UINavigator extends SelfRenderingComponent } // generate the closed panel title areas + String sideBarStyle = "style=\"background-image: url(" + cxPath + "/images/parts/navigator_grey_gradient_bg.gif)\""; if (NavigationBean.LOCATION_COMPANY.equals(area) == false && navBean.getCompanyHomeVisible()) { - out.write("
"); - out.write(""); @@ -267,8 +273,9 @@ public class UINavigator extends SelfRenderingComponent if (NavigationBean.LOCATION_HOME.equals(area) == false) { - out.write("
"); - out.write(""); @@ -279,8 +286,9 @@ public class UINavigator extends SelfRenderingComponent if (NavigationBean.LOCATION_GUEST.equals(area) == false && navBean.getIsGuest() == false && navBean.getGuestHomeVisible()) { - out.write("
"); - out.write(""); @@ -290,8 +298,9 @@ public class UINavigator extends SelfRenderingComponent if (NavigationBean.LOCATION_MYALFRESCO.equals(area) == false) { - out.write("
"); - out.write(""); diff --git a/source/java/org/alfresco/web/ui/repo/component/UISidebar.java b/source/java/org/alfresco/web/ui/repo/component/UISidebar.java index 6fceef94cc..161825223b 100644 --- a/source/java/org/alfresco/web/ui/repo/component/UISidebar.java +++ b/source/java/org/alfresco/web/ui/repo/component/UISidebar.java @@ -73,10 +73,18 @@ public class UISidebar extends SelfRenderingComponent out.write("
"); // render the start of the header panel - PanelGenerator.generatePanelStart(out, - context.getExternalContext().getRequestContextPath(), - "blue", "#D3E6FE"); - + String cxPath = context.getExternalContext().getRequestContextPath(); + out.write("" + + "" + + "
" + + ""); + // generate the required child components if not present if (this.getChildCount() == 1) { @@ -138,7 +146,7 @@ public class UISidebar extends SelfRenderingComponent { ResponseWriter out = context.getResponseWriter(); - out.write("" + + "" + + "" + + "" + + "" + + "
"); + out.write("
"); // render the list UIModeList modeList = (UIModeList)getChildren().get(0); @@ -153,13 +161,20 @@ public class UISidebar extends SelfRenderingComponent out.write("
"); // render the end of the header panel - PanelGenerator.generateTitledPanelMiddle(out, - context.getExternalContext().getRequestContextPath(), - "blue", "white", "white"); - + String cxPath = context.getExternalContext().getRequestContextPath(); + out.write("
" + + "
"); + // render the plugin + out.write("
"); UIComponent plugin = (UIComponent)getChildren().get(2); Utils.encodeRecursive(context, plugin); + out.write("
"); } } @@ -170,10 +185,22 @@ public class UISidebar extends SelfRenderingComponent // render the end of the panel ResponseWriter out = context.getResponseWriter(); - PanelGenerator.generatePanelEnd(out, - context.getExternalContext().getRequestContextPath(), - "white"); - out.write(""); + String cxPath = context.getExternalContext().getRequestContextPath(); + out.write("
" + + "
" + + ""); } @Override