diff --git a/source/java/org/alfresco/web/ui/common/renderer/ImagePickerRadioPanelRenderer.java b/source/java/org/alfresco/web/ui/common/renderer/ImagePickerRadioPanelRenderer.java new file mode 100644 index 0000000000..b5905afffc --- /dev/null +++ b/source/java/org/alfresco/web/ui/common/renderer/ImagePickerRadioPanelRenderer.java @@ -0,0 +1,55 @@ +package org.alfresco.web.ui.common.renderer; + +import java.io.IOException; + +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; + +import org.alfresco.web.ui.common.PanelGenerator; + +/** + * Renderer for the image picker component that outputs the list of images + * as radio buttons within a rounded corner panel + * + * @author gavinc + */ +public class ImagePickerRadioPanelRenderer extends ImagePickerRadioRenderer +{ + /** + * @see javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext, javax.faces.component.UIComponent) + */ + public void encodeBegin(FacesContext context, UIComponent component) throws IOException + { + if (component.isRendered() == false) + { + return; + } + + // output the start of the surrounding rounded corner panel + PanelGenerator.generatePanelStart(context.getResponseWriter(), + context.getExternalContext().getRequestContextPath(), + (String)component.getAttributes().get("panelBorder"), + (String)component.getAttributes().get("panelBgcolor")); + + super.encodeBegin(context, component); + } + + /** + * @see javax.faces.render.Renderer#encodeEnd(javax.faces.context.FacesContext, javax.faces.component.UIComponent) + */ + public void encodeEnd(FacesContext context, UIComponent component) throws IOException + { + if (component.isRendered() == false) + { + return; + } + + super.encodeEnd(context, component); + + // output the end of the surrounding rounded corner panel + PanelGenerator.generatePanelEnd(context.getResponseWriter(), + context.getExternalContext().getRequestContextPath(), + (String)component.getAttributes().get("panelBorder")); + } +} + \ No newline at end of file diff --git a/source/java/org/alfresco/web/ui/common/tag/ImagePickerRadioPanelTag.java b/source/java/org/alfresco/web/ui/common/tag/ImagePickerRadioPanelTag.java new file mode 100644 index 0000000000..f2ada93e7a --- /dev/null +++ b/source/java/org/alfresco/web/ui/common/tag/ImagePickerRadioPanelTag.java @@ -0,0 +1,71 @@ +package org.alfresco.web.ui.common.tag; + +import javax.faces.component.UIComponent; + +/** + * Tag to place the image picker component and radio renderer inside + * a rounded corner panel + * + * @author gavinc + */ +public class ImagePickerRadioPanelTag extends ImagePickerRadioTag +{ + private String panelBorder; + private String panelBgcolor; + + /** + * @see javax.faces.webapp.UIComponentTag#getComponentType() + */ + public String getComponentType() + { + return "org.alfresco.faces.ImagePicker"; + } + + /** + * @see javax.faces.webapp.UIComponentTag#getRendererType() + */ + public String getRendererType() + { + return "org.alfresco.faces.RadioPanel"; + } + + /** + * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent) + */ + protected void setProperties(UIComponent component) + { + super.setProperties(component); + setStringProperty(component, "panelBorder", this.panelBorder); + setStringProperty(component, "panelBgcolor", this.panelBgcolor); + } + + /** + * @see javax.servlet.jsp.tagext.Tag#release() + */ + public void release() + { + super.release(); + this.panelBorder = null; + this.panelBgcolor = null; + } + + public String getPanelBgcolor() + { + return panelBgcolor; + } + + public void setPanelBgcolor(String panelBgcolor) + { + this.panelBgcolor = panelBgcolor; + } + + public String getPanelBorder() + { + return panelBorder; + } + + public void setPanelBorder(String panelBorder) + { + this.panelBorder = panelBorder; + } +} diff --git a/source/web/WEB-INF/alfresco.tld b/source/web/WEB-INF/alfresco.tld index 5ad13c67bd..6d3d9e2a23 100644 --- a/source/web/WEB-INF/alfresco.tld +++ b/source/web/WEB-INF/alfresco.tld @@ -1180,6 +1180,89 @@ + + imagePickerRadioPanel + org.alfresco.web.ui.common.tag.ImagePickerRadioPanelTag + JSP + + + This component simply renders the image picker component inside a rounded + corner panel. + + + + panelBorder + true + true + + + + panelBgcolor + true + true + + + + id + false + true + + + + value + false + true + + + + binding + false + true + + + + rendered + false + true + + + + spacing + false + true + + + + columns + false + true + + + + style + false + true + + + + styleClass + false + true + + + + onclick + false + true + + + + configSection + false + true + + + convertXMLDate org.alfresco.web.ui.common.tag.XMLDateConverterTag diff --git a/source/web/WEB-INF/faces-config-common.xml b/source/web/WEB-INF/faces-config-common.xml index a624e22c86..6fd4aedf61 100644 --- a/source/web/WEB-INF/faces-config-common.xml +++ b/source/web/WEB-INF/faces-config-common.xml @@ -204,6 +204,12 @@ org.alfresco.web.ui.common.renderer.ImagePickerRadioRenderer + + org.alfresco.faces.ImagePicker + org.alfresco.faces.RadioPanel + org.alfresco.web.ui.common.renderer.ImagePickerRadioPanelRenderer + + javax.faces.Messages org.alfresco.faces.Errors diff --git a/source/web/jsp/spaces/create-space-dialog.jsp b/source/web/jsp/spaces/create-space-dialog.jsp index 89161359e7..20710d699e 100644 --- a/source/web/jsp/spaces/create-space-dialog.jsp +++ b/source/web/jsp/spaces/create-space-dialog.jsp @@ -101,13 +101,12 @@
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - + - + - <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
diff --git a/source/web/jsp/spaces/create-space-wizard/details.jsp b/source/web/jsp/spaces/create-space-wizard/details.jsp index ff0f352ea7..73b5b2fd86 100644 --- a/source/web/jsp/spaces/create-space-wizard/details.jsp +++ b/source/web/jsp/spaces/create-space-wizard/details.jsp @@ -113,13 +113,14 @@ - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> +
- + - + - <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> +
<%-- diff --git a/source/web/jsp/spaces/create-space-wizard/from-scratch.jsp b/source/web/jsp/spaces/create-space-wizard/from-scratch.jsp index 9ef61fab28..58c6b4dbff 100644 --- a/source/web/jsp/spaces/create-space-wizard/from-scratch.jsp +++ b/source/web/jsp/spaces/create-space-wizard/from-scratch.jsp @@ -33,14 +33,12 @@ - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
- + - + - <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>