Merged V2.1 to HEAD: 6706 Wizard pages more standards compliant

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6790 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2007-09-14 20:32:00 +00:00
parent 003eb483d6
commit 77190cd418
15 changed files with 403 additions and 389 deletions

View File

@@ -133,7 +133,7 @@ public class ActionLinkRenderer extends BaseRenderer
if (padding != 0)
{
// TODO: make this width value a property!
out.write("<table cellspacing=0 cellpadding=0><tr><td width=16>");
out.write("<table cellspacing='0' cellpadding='0'><tr><td style='width:16px;'>");
}
// if we are not show the text link, then the image is the clickable element
@@ -142,7 +142,7 @@ public class ActionLinkRenderer extends BaseRenderer
renderActionLinkAnchor(context, out, link);
}
out.write(Utils.buildImageTag(context, image, (String)link.getValue(), "absmiddle"));
out.write(Utils.buildImageTag(context, image, (String)link.getValue(), "middle"));
if (link.getShowLink() == false)
{
@@ -152,9 +152,9 @@ public class ActionLinkRenderer extends BaseRenderer
{
if (padding != 0)
{
out.write("</td><td style=\"padding:");
out.write("</td><td style='padding:");
out.write(Integer.toString(padding));
out.write("px\">");
out.write("px;'>");
}
// else the text is the clickable element
@@ -183,10 +183,12 @@ public class ActionLinkRenderer extends BaseRenderer
* @param context
* @param link
*/
private void renderActionLinkAnchor(FacesContext context, Writer out, UIActionLink link)
private void renderActionLinkAnchor(final FacesContext context,
final Writer out,
final UIActionLink link)
throws IOException
{
Map attrs = link.getAttributes();
final Map attrs = link.getAttributes();
// generate the href link - output later in the process depending on various rendering options
if (link.getHref() == null)
@@ -202,7 +204,11 @@ public class ActionLinkRenderer extends BaseRenderer
{
// generate JavaScript to set a hidden form field and submit
// a form which request attributes that we can decode
out.write(Utils.generateFormSubmit(context, link, Utils.getActionHiddenFieldName(context, link), link.getClientId(context), getParameterComponents(link)));
out.write(Utils.generateFormSubmit(context,
link,
Utils.getActionHiddenFieldName(context, link),
link.getClientId(context),
getParameterComponents(link)));
}
out.write('"');
@@ -227,31 +233,32 @@ public class ActionLinkRenderer extends BaseRenderer
// output href 'target' attribute if supplied
if (link.getTarget() != null)
{
out.write(" target=\"");
out.write(" target='");
out.write(link.getTarget());
out.write("\"");
out.write("'");
}
}
// common link attributes
if (attrs.get("id") != null)
{
out.write(" id=\"");
out.write(" id='");
out.write((String)attrs.get("id"));
out.write("\"");
out.write("'");
}
boolean appliedStyle = false;
if (attrs.get("style") != null)
{
out.write(" style=\"");
out.write(" style='");
out.write((String)attrs.get("style"));
out.write('"');
out.write("'");
appliedStyle = true;
}
if (attrs.get("styleClass") != null)
{
out.write(" class=");
out.write(" class='");
out.write((String)attrs.get("styleClass"));
out.write("'");
appliedStyle = true;
}
if (appliedStyle == false && link.getShowLink() == true && link.getImage() != null && link.getPadding() == 0)
@@ -261,9 +268,9 @@ public class ActionLinkRenderer extends BaseRenderer
}
if (link.getTooltip() != null)
{
out.write(" title=\"");
out.write(" title='");
out.write(Utils.encode(link.getTooltip()));
out.write('"');
out.write("'");
}
out.write('>');
}
@@ -376,8 +383,9 @@ public class ActionLinkRenderer extends BaseRenderer
}
if (attrs.get("styleClass") != null)
{
out.write(" class=");
out.write(" class=\"");
out.write((String)attrs.get("styleClass"));
out.write('"');
}
out.write('>');
out.write(Utils.encode(link.getValue().toString()));

View File

@@ -134,8 +134,9 @@ public class BreadcrumbRenderer extends BaseRenderer
}
if (bc.getAttributes().get("styleClass") != null)
{
buf.append(" class=")
.append(bc.getAttributes().get("styleClass"));
buf.append(" class=\"")
.append(bc.getAttributes().get("styleClass"))
.append('"');
}
if (bc.getAttributes().get("tooltip") != null)
{

View File

@@ -87,17 +87,17 @@ public class ModeListRenderer extends BaseRenderer
Map attrs = list.getAttributes();
if (list.isMenu() == false)
if (!list.isMenu())
{
// start outer table container the list items
out.write("<table cellspacing=1 cellpadding=0");
out.write("<table cellspacing='1' cellpadding='0'");
outputAttribute(out, attrs.get("styleClass"), "class");
outputAttribute(out, attrs.get("style"), "style");
outputAttribute(out, attrs.get("width"), "width");
out.write('>');
// horizontal rendering outputs a single row with each item as a column cell
if (list.isHorizontal() == true)
if (list.isHorizontal())
{
out.write("<tr>");
}
@@ -107,21 +107,21 @@ public class ModeListRenderer extends BaseRenderer
{
// each row is an inner table with a single row and 2 columns
// first column contains an icon if present, second column contains text
if (list.isHorizontal() == false)
if (!list.isHorizontal())
{
out.write("<tr>");
}
out.write("<td><table cellpadding=0 width=100%");
out.write("<td><table cellpadding='0' style='width:100%;'");
outputAttribute(out, attrs.get("itemSpacing"), "cellspacing");
out.write("><tr>");
// output icon column
if (list.getIconColumnWidth() != 0)
{
out.write("<td");
outputAttribute(out, list.getIconColumnWidth(), "width");
out.write("></td>");
out.write("<td style='width:");
out.write(String.valueOf(list.getIconColumnWidth()));
out.write(";'></td>");
}
// output title label
@@ -132,7 +132,7 @@ public class ModeListRenderer extends BaseRenderer
out.write(Utils.encode(list.getLabel()));
out.write("</span></td></tr></table></td>");
if (list.isHorizontal() == false)
if (!list.isHorizontal())
{
out.write("</tr>");
}
@@ -142,12 +142,12 @@ public class ModeListRenderer extends BaseRenderer
{
// render as a pop-up menu
// TODO: show the image set for the individual item if available?
out.write("<table cellspacing=0 cellpadding=0 style='white-space:nowrap'><tr>");
out.write("<table cellspacing='0' cellpadding='0' style='white-space:nowrap'><tr>");
String selectedImage = (String)attrs.get("selectedImage");
if (selectedImage != null)
{
out.write("<td style='padding-right:4px'>");
out.write(Utils.buildImageTag(context, selectedImage, null, "absmiddle"));
out.write(Utils.buildImageTag(context, selectedImage, null, "middle"));
out.write("</td>");
}
@@ -177,7 +177,7 @@ public class ModeListRenderer extends BaseRenderer
UIListItem item = (UIListItem)iter.next();
// if selected render as the label
if (item.getValue().equals(list.getValue()) == true)
if (item.getValue().equals(list.getValue()))
{
label = item.getLabel();
break;
@@ -185,13 +185,13 @@ public class ModeListRenderer extends BaseRenderer
}
}
}
else if (child instanceof UIListItem && child.isRendered() == true)
else if (child instanceof UIListItem && child.isRendered())
{
// found a valid UIListItem child to render
UIListItem item = (UIListItem)child;
// if selected render as the label
if (item.getValue().equals(list.getValue()) == true)
if (item.getValue().equals(list.getValue()))
{
label = item.getLabel();
break;
@@ -214,7 +214,7 @@ public class ModeListRenderer extends BaseRenderer
// output image
if (list.getMenuImage() != null)
{
out.write(Utils.buildImageTag(context, list.getMenuImage(), null, "absmiddle"));
out.write(Utils.buildImageTag(context, list.getMenuImage(), null, "middle"));
}
out.write("</a></td></tr></table>");
@@ -222,10 +222,10 @@ public class ModeListRenderer extends BaseRenderer
// output the hidden DIV section to contain the menu item table
out.write("<div id='");
out.write(menuId);
out.write("' style=\"position:absolute;display:none;padding-left:2px;\">");
out.write("' style='position:absolute;display:none;padding-left:2px;'>");
// start outer table container the list items
out.write("<table cellspacing=1 cellpadding=0");
out.write("<table cellspacing='1' cellpadding='0'");
outputAttribute(out, attrs.get("styleClass"), "class");
outputAttribute(out, attrs.get("style"), "style");
outputAttribute(out, attrs.get("width"), "width");
@@ -238,7 +238,7 @@ public class ModeListRenderer extends BaseRenderer
*/
public void encodeChildren(FacesContext context, UIComponent component) throws IOException
{
if (component.isRendered() == false)
if (!component.isRendered())
{
return;
}
@@ -268,11 +268,10 @@ public class ModeListRenderer extends BaseRenderer
}
}
}
else if (child instanceof UIListItem && child.isRendered() == true)
else if (child instanceof UIListItem && child.isRendered())
{
// found a valid UIListItem child to render
UIListItem item = (UIListItem)child;
renderItem(context, out, list, item);
renderItem(context, out, list, (UIListItem)child);
}
}
}
@@ -282,7 +281,7 @@ public class ModeListRenderer extends BaseRenderer
*/
public void encodeEnd(FacesContext context, UIComponent component) throws IOException
{
if (component.isRendered() == false)
if (!component.isRendered())
{
return;
}
@@ -291,12 +290,12 @@ public class ModeListRenderer extends BaseRenderer
// end outer table
UIModeList list = (UIModeList)component;
if (list.isHorizontal() == true)
if (list.isHorizontal())
{
out.write("</tr>");
}
out.write("</table>");
if (list.isMenu() == true)
if (list.isMenu())
{
// close menu hidden div section
out.write("</div>");
@@ -333,7 +332,7 @@ public class ModeListRenderer extends BaseRenderer
out.write("<tr>");
}
out.write("<td><table cellpadding=0 width=100%");
out.write("<td><table cellpadding='0' style='width:100%;'");
outputAttribute(out, attrs.get("itemSpacing"), "cellspacing");
// if selected value render different style for the item
@@ -353,9 +352,9 @@ public class ModeListRenderer extends BaseRenderer
// output icon column
if (list.getIconColumnWidth() != 0)
{
out.write("<td");
outputAttribute(out, list.getIconColumnWidth(), "width");
out.write(">");
out.write("<td style='width:");
out.write(String.valueOf(list.getIconColumnWidth()));
out.write(";'>");
// if the "selectedImage" property is set and this item is selected then show it
if (selected == true && selectedImage != null)