Added ImagePickerRadioPanel renderer and changed pages to use it.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2621 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-04-04 15:31:17 +00:00
parent 02f7da6dec
commit 1bc8818f37
7 changed files with 226 additions and 13 deletions

View File

@@ -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"));
}
}