mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user