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

@@ -599,15 +599,7 @@ public class UIActions extends SelfRenderingComponent
this.showLink = (Boolean)vb.getValue(getFacesContext());
}
if (this.showLink != null)
{
return this.showLink.booleanValue();
}
else
{
// return default
return true;
}
return this.showLink != null ? this.showLink.booleanValue() : true;
}
/**
@@ -631,14 +623,7 @@ public class UIActions extends SelfRenderingComponent
this.verticalSpacing = (Integer)vb.getValue(getFacesContext());
}
if (this.verticalSpacing != null)
{
return this.verticalSpacing;
}
else
{
return 0;
}
return this.verticalSpacing != null ? this.verticalSpacing : 0;
}
/**
@@ -667,7 +652,7 @@ public class UIActions extends SelfRenderingComponent
*/
private static String createUniqueId()
{
return "_id_" + Short.toString(++id);
return "id_" + Short.toString(++id);
}
// ------------------------------------------------------------------------------

View File

@@ -78,11 +78,8 @@ public class UISidebar extends SelfRenderingComponent
@Override
public Object saveState(FacesContext context)
{
Object values[] = new Object[8];
// standard component attributes are saved by the super class
values[0] = super.saveState(context);
values[1] = this.activePlugin;
return values;
return new Object[] { super.saveState(context), this.activePlugin };
}
@SuppressWarnings("unchecked")
@@ -93,20 +90,20 @@ public class UISidebar extends SelfRenderingComponent
ResponseWriter out = context.getResponseWriter();
out.write("<div id=\"sidebar\" class=\"sidebar\">");
out.write("<div id='sidebar' class='sidebar'>");
// render the start of the header panel
String cxPath = context.getExternalContext().getRequestContextPath();
out.write("<table cellspacing=0 cellpadding=0 bgcolor='#ffffff'>" +
"<tr><td style=\"background-image: url(");
out.write("<table cellspacing='0' cellpadding='0' style='background-color: #ffffff;'>" +
"<tr><td style='width: 5px; background-image: url(");
out.write(cxPath);
out.write("/images/parts/sidebar_top_grey_begin.gif)\" valign=\"top\" width=5>" +
out.write("/images/parts/sidebar_top_grey_begin.gif)' valign='top'>" +
"<img src=\"");
out.write(cxPath);
out.write("/images/parts/sidebar_grey_01.gif\" width=5 height=5></td>" +
"<td style=\"background-image: url(");
out.write("/images/parts/sidebar_grey_01.gif\" width='5' height='5' alt=''/></td>" +
"<td style='height: 24px; background-image: url(");
out.write(cxPath);
out.write("/images/parts/sidebar_top_grey_bg.gif)\" height=24>");
out.write("/images/parts/sidebar_top_grey_bg.gif)'>");
// generate the required child components if not present
if (this.getChildCount() == 1)
@@ -169,7 +166,7 @@ public class UISidebar extends SelfRenderingComponent
{
ResponseWriter out = context.getResponseWriter();
out.write("<table border='0' cellpadding='6' cellspacing='0' width='100%'><tr><td>");
out.write("<table border='0' cellpadding='6' cellspacing='0' style='width: 100%;'><tr><td>");
// render the list
UIModeList modeList = (UIModeList)getChildren().get(0);
@@ -185,12 +182,12 @@ public class UISidebar extends SelfRenderingComponent
// render the end of the header panel
String cxPath = context.getExternalContext().getRequestContextPath();
out.write("</td><td style=\"background-image: url(");
out.write("</td><td style='width: 5px; background-image: url(");
out.write(cxPath);
out.write("/images/parts/sidebar_top_grey_end.gif)\" width=5 align=right valign=top>" +
"<img src=\"");
out.write("/images/parts/sidebar_top_grey_end.gif)' align='right' valign='top'>" +
"<img src='");
out.write(cxPath);
out.write("/images/parts/sidebar_grey_03.gif\" width=5 height=5></td></tr>" +
out.write("/images/parts/sidebar_grey_03.gif' width='5' height='5' alt=''/></td></tr>" +
"<tr><td colspan='3'>");
// render the plugin
@@ -210,18 +207,18 @@ public class UISidebar extends SelfRenderingComponent
ResponseWriter out = context.getResponseWriter();
String cxPath = context.getExternalContext().getRequestContextPath();
out.write("</td></tr>" +
"<tr><td height=12 width=5><img src=\"");
"<tr><td style='height: 12px; width: 5px;'><img src='");
out.write(cxPath);
out.write("/images/parts/sidebar_bottom_grey_begin.gif\" width=5 height=12></td>" +
"<td width=100% style=\"background-image: url(");
out.write("/images/parts/sidebar_bottom_grey_begin.gif' width='5' height='12' alt=''/></td>" +
"<td style='width: 100%; background-image: url(");
out.write(cxPath);
out.write("/images/parts/sidebar_bottom_grey_bg.gif)\">" +
"<img src=\"");
out.write("/images/parts/sidebar_bottom_grey_bg.gif)'>" +
"<img src='");
out.write(cxPath);
out.write("/images/parts/sidebar_bottom_grey_bg.gif\" width=48 height=12></td>" +
"<td align=right width=5><img src=\"");
out.write("/images/parts/sidebar_bottom_grey_bg.gif' width='48' height='12' alt=''/></td>" +
"<td align='right' style='width: 5px;'><img src='");
out.write(cxPath);
out.write("/images/parts/sidebar_bottom_grey_end.gif\" width=5 height=12></td></tr>" +
out.write("/images/parts/sidebar_bottom_grey_end.gif' width='5' height='12' alt=''/></td></tr>" +
"</table>" +
"</div>");
}

View File

@@ -182,7 +182,7 @@ public class UISimpleSearch extends UICommand
ResourceBundle bundle = (ResourceBundle)Application.getBundle(context);
// script for dynamic simple search menu drop-down options
out.write("<script>");
out.write("<script type='text/javascript'>");
out.write("function _noenter(event) {" +
"if (event && event.keyCode == 13) {" +
" _searchSubmit();return false; }" +
@@ -194,49 +194,49 @@ public class UISimpleSearch extends UICommand
out.write("</script>");
// outer table containing search drop-down icon, text box and search Go image button
out.write("<table cellspacing=4 cellpadding=0>");
out.write("<table cellspacing='4' cellpadding='0'>");
out.write("<tr><td style='padding-top:2px'>");
String searchImage = Utils.buildImageTag(context, "/images/icons/search_icon.gif", 15, 15,
bundle.getString(MSG_GO), "_searchSubmit();");
out.write(Utils.buildImageTag(context, "/images/icons/search_controls.gif", 27, 13,
bundle.getString(MSG_OPTIONS), "javascript:_toggleMenu(event, '_alfsearch');"));
bundle.getString(MSG_OPTIONS), "javascript:_toggleMenu(event, 'alfsearch_menu');"));
// dynamic DIV area containing search options
out.write("<br><div id='_alfsearch' style='position:absolute;display:none'>");
out.write("<table border=0 class='moreActionsMenu' cellspacing=4 cellpadding=0>");
out.write("<br><div id='alfsearch_menu' style='position:absolute;display:none'>");
out.write("<table border='0' class='moreActionsMenu' cellspacing='4' cellpadding='0'>");
// output each option - setting the current one to CHECKED
String optionFieldName = getClientId(context) + NamingContainer.SEPARATOR_CHAR + OPTION_PARAM;
String radioOption = "<tr><td class='userInputForm'><input type='radio' name='" + optionFieldName + "'";
String radioOption = "<tr><td class='userInputForm' style='white-space:nowrap;'><input type='radio' name='" + optionFieldName + "'";
out.write(radioOption);
out.write(" VALUE='0'");
out.write(" value='0'");
int searchMode = getSearchMode();
if (searchMode == 0) out.write(" CHECKED");
out.write("><nobr>" + bundle.getString(MSG_ALL_ITEMS) + "</nobr></td></tr>");
if (searchMode == 0) out.write(" checked='checked'");
out.write("/>" + bundle.getString(MSG_ALL_ITEMS) + "</td></tr>");
out.write(radioOption);
out.write(" VALUE='1'");
if (searchMode == 1) out.write(" CHECKED");
out.write("><nobr>" + bundle.getString(MSG_FILE_NAMES_CONTENTS) + "</nobr></td></tr>");
out.write(" value='1'");
if (searchMode == 1) out.write(" checked='checked'");
out.write("/>" + bundle.getString(MSG_FILE_NAMES_CONTENTS) + "</td></tr>");
out.write(radioOption);
out.write(" VALUE='2'");
if (searchMode == 2) out.write(" CHECKED");
out.write("><nobr>" + bundle.getString(MSG_FILE_NAMES_ONLY) + "</nobr></td></tr>");
out.write(" value='2'");
if (searchMode == 2) out.write(" checked='checked'");
out.write("/>" + bundle.getString(MSG_FILE_NAMES_ONLY) + "</td></tr>");
out.write(radioOption);
out.write(" VALUE='3'");
if (searchMode == 3) out.write(" CHECKED");
out.write("><nobr>" + bundle.getString(MSG_SPACE_NAMES_ONLY) + "</nobr></td></tr>");
out.write(" value='3'");
if (searchMode == 3) out.write(" checked='checked'");
out.write("/>" + bundle.getString(MSG_SPACE_NAMES_ONLY) + "</td></tr>");
// row with table containing advanced search link and Search Go button
out.write("<tr><td><table width=100%><tr><td>");
out.write("<tr><td><table width='100%'><tr><td>");
// generate a link that will cause an action event to navigate to the advanced search screen
out.write("<a class='small' href='#' onclick=\"");
out.write(Utils.generateFormSubmit(context, this, Utils.getActionHiddenFieldName(context, this), ADVSEARCH_PARAM));
out.write("\">");
out.write(bundle.getString(MSG_ADVANCED_SEARCH));
out.write("</a>");
out.write("</td><td align=right>");
out.write("</td><td align='right'>");
out.write(searchImage);
out.write("</td></tr></table></td></tr>");
out.write("</table></div>");
@@ -273,14 +273,7 @@ public class UISimpleSearch extends UICommand
*/
public String getLastSearch()
{
if (search != null)
{
return this.search.getText();
}
else
{
return "";
}
return this.search != null ? this.search.getText() : "";
}
/**
@@ -288,21 +281,14 @@ public class UISimpleSearch extends UICommand
*/
public int getSearchMode()
{
if (search != null)
{
return this.search.getMode();
}
else
{
return SearchContext.SEARCH_ALL;
}
return this.search != null ? this.search.getMode() : SearchContext.SEARCH_ALL;
}
// ------------------------------------------------------------------------------
// Private data
private static Log logger = LogFactory.getLog(UISimpleSearch.class);
private static final Log logger = LogFactory.getLog(UISimpleSearch.class);
/** I18N message Ids */
private static final String MSG_ADVANCED_SEARCH = "advanced_search";