2d part and end of an effort to remove trailing spaces
[ \t]+$ => "" (empty) Should be easier to review when committing changes with trailing spaces removed automatically by anyedit or such tool (please refer to http://docs.ofbiz.org/x/mg) Of course this effort to remove trailing spaces has no functional implications. Actually, I was doing a 1st commit and as it's long to upload, I got conflicts with r763135 In the meantime I did some refactoring also in *.java and *.groovy files : ){ => ) { if( => if ( while( => while ( }else => } else else{ => else { switch( => switch ( try{ => try { }catch => } catch catch( => catch ( }finally{ => } finally { So these changes are also in this commit, should not be a problem anyway. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@763175 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -180,7 +180,7 @@ public class WidgetWorker {
|
||||
|
||||
writer.append('>');
|
||||
|
||||
if (UtilValidate.isNotEmpty(request.getAttribute("image"))){
|
||||
if (UtilValidate.isNotEmpty(request.getAttribute("image"))) {
|
||||
writer.append("<img src=\"");
|
||||
writer.append(request.getAttribute("image").toString());
|
||||
writer.append("\"/>");
|
||||
@@ -215,7 +215,7 @@ public class WidgetWorker {
|
||||
|
||||
writer.append('>');
|
||||
|
||||
if (UtilValidate.isNotEmpty(request.getAttribute("image"))){
|
||||
if (UtilValidate.isNotEmpty(request.getAttribute("image"))) {
|
||||
writer.append("<img src=\"");
|
||||
writer.append(request.getAttribute("image").toString());
|
||||
writer.append("\"/>");
|
||||
|
||||
@@ -184,7 +184,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
this.request.setAttribute("image", hyperlinkField.getImage());
|
||||
ModelFormField modelFormField = hyperlinkField.getModelFormField();
|
||||
|
||||
makeHyperlinkByType(writer, hyperlinkField.getLinkType(), modelFormField.getWidgetStyle(), hyperlinkField.getTargetType(), hyperlinkField.getTarget(context),
|
||||
makeHyperlinkByType(writer, hyperlinkField.getLinkType(), modelFormField.getWidgetStyle(), hyperlinkField.getTargetType(), hyperlinkField.getTarget(context),
|
||||
hyperlinkField.getParameterList(), hyperlinkField.getDescription(context), hyperlinkField.getTargetWindow(context), modelFormField,
|
||||
this.request, this.response, context);
|
||||
|
||||
@@ -336,7 +336,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
String name = "";
|
||||
if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) {
|
||||
className = modelFormField.getWidgetStyle();
|
||||
if(modelFormField.shouldBeRed(context)){
|
||||
if (modelFormField.shouldBeRed(context)) {
|
||||
alert = "true";
|
||||
}
|
||||
}
|
||||
@@ -382,7 +382,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
}
|
||||
}
|
||||
String id = modelFormField.getIdName();
|
||||
String formName = modelFormField.getModelForm().getCurrentFormName(context);
|
||||
String formName = modelFormField.getModelForm().getCurrentFormName(context);
|
||||
String timeDropdown = dateTimeField.getInputMethod();
|
||||
String timeDropdownParamName = "";
|
||||
String classString = "";
|
||||
@@ -541,7 +541,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
StringBuilder ajaxOptions = new StringBuilder();
|
||||
if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) {
|
||||
className = modelFormField.getWidgetStyle();
|
||||
if(modelFormField.shouldBeRed(context)){
|
||||
if (modelFormField.shouldBeRed(context)) {
|
||||
alert = "true";
|
||||
}
|
||||
}
|
||||
@@ -813,7 +813,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
sr.append(" currentValue=\"");
|
||||
sr.append(currentValue);
|
||||
sr.append("\" noCurrentSelectedKey=");
|
||||
sr.append(noCurrentSelectedKey);
|
||||
sr.append(noCurrentSelectedKey);
|
||||
sr.append("\" name=\"");
|
||||
sr.append(name);
|
||||
sr.append("\" event=\"");
|
||||
@@ -844,7 +844,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
String alert = "false";
|
||||
if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) {
|
||||
className = modelFormField.getWidgetStyle();
|
||||
if(modelFormField.shouldBeRed(context)){
|
||||
if (modelFormField.shouldBeRed(context)) {
|
||||
alert = "true";
|
||||
}
|
||||
}
|
||||
@@ -1295,7 +1295,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
public void renderTextFindField(Appendable writer, Map<String, Object> context, TextFindField textFindField) throws IOException {
|
||||
ModelFormField modelFormField = textFindField.getModelFormField();
|
||||
|
||||
String defaultOption = textFindField.getDefaultOption();
|
||||
String defaultOption = textFindField.getDefaultOption();
|
||||
String className = "";
|
||||
String alert = "false";
|
||||
String opEquals = "";
|
||||
@@ -1309,7 +1309,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
String autocomplete = "";
|
||||
if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) {
|
||||
className = modelFormField.getWidgetStyle();
|
||||
if(modelFormField.shouldBeRed(context)){
|
||||
if (modelFormField.shouldBeRed(context)) {
|
||||
alert = "true";
|
||||
}
|
||||
}
|
||||
@@ -1399,7 +1399,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
String alert = "false";
|
||||
if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) {
|
||||
className = modelFormField.getWidgetStyle();
|
||||
if(modelFormField.shouldBeRed(context)){
|
||||
if (modelFormField.shouldBeRed(context)) {
|
||||
alert = "true";
|
||||
}
|
||||
}
|
||||
@@ -1642,7 +1642,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
List<String> targetParameterList = lookupField.getTargetParameterList();
|
||||
targetParameterIter.append("[");
|
||||
for (String targetParameter: targetParameterList) {
|
||||
if(targetParameterIter.length()>1) {
|
||||
if (targetParameterIter.length()>1) {
|
||||
targetParameterIter.append(",");
|
||||
}
|
||||
targetParameterIter.append("'");
|
||||
@@ -1935,7 +1935,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
String autocomplete = "";
|
||||
if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) {
|
||||
className = modelFormField.getWidgetStyle();
|
||||
if(modelFormField.shouldBeRed(context)){
|
||||
if (modelFormField.shouldBeRed(context)) {
|
||||
alert = "true";
|
||||
}
|
||||
}
|
||||
@@ -1987,7 +1987,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
String autocomplete = "";
|
||||
if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) {
|
||||
className = modelFormField.getWidgetStyle();
|
||||
if(modelFormField.shouldBeRed(context)){
|
||||
if (modelFormField.shouldBeRed(context)) {
|
||||
alert = "true";
|
||||
}
|
||||
}
|
||||
@@ -2168,7 +2168,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
if (text == null) {
|
||||
text = "";
|
||||
}
|
||||
|
||||
|
||||
String rightText = banner.getRightText(context);
|
||||
if (rightText == null) {
|
||||
rightText = "";
|
||||
@@ -2191,7 +2191,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
sr.append("\" />");
|
||||
executeMacro(writer, sr.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Renders the beginning boundary comment string.
|
||||
@@ -2283,7 +2283,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
String str = (String) context.get("_QBESTRING_");
|
||||
String oldSortField = modelForm.getSortField(context);
|
||||
String sortFieldStyle = modelFormField.getSortFieldStyle();
|
||||
|
||||
|
||||
// if the entry-name is defined use this instead of field name
|
||||
String columnField = modelFormField.getEntryName();
|
||||
if (UtilValidate.isEmpty(columnField)) {
|
||||
@@ -2409,15 +2409,15 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
}
|
||||
if (subHyperlink.shouldUse(context)) {
|
||||
writer.append(' ');
|
||||
WidgetWorker.makeHyperlinkByType(writer, subHyperlink.getLinkType(), subHyperlink.getLinkStyle(), subHyperlink.getTargetType(), subHyperlink.getTarget(context),
|
||||
subHyperlink.getParameterList(), subHyperlink.getDescription(context), subHyperlink.getTargetWindow(context), subHyperlink.getModelFormField(),
|
||||
WidgetWorker.makeHyperlinkByType(writer, subHyperlink.getLinkType(), subHyperlink.getLinkStyle(), subHyperlink.getTargetType(), subHyperlink.getTarget(context),
|
||||
subHyperlink.getParameterList(), subHyperlink.getDescription(context), subHyperlink.getTargetWindow(context), subHyperlink.getModelFormField(),
|
||||
this.request, this.response, context);
|
||||
}
|
||||
}
|
||||
public void addAsterisks(Appendable writer, Map<String, Object> context, ModelFormField modelFormField) throws IOException {
|
||||
String requiredField = "false";
|
||||
String requiredStyle = "";
|
||||
if (modelFormField.getRequiredField()){
|
||||
if (modelFormField.getRequiredField()) {
|
||||
requiredField = "true";
|
||||
requiredStyle = modelFormField.getRequiredFieldStyle();
|
||||
}
|
||||
@@ -2460,9 +2460,9 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
} else {
|
||||
WidgetWorker.makeHyperlinkString(writer, linkStyle, targetType, target, parameterList, description, modelFormField, request, response, context, targetWindow);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void makeHyperlinkString(Appendable writer, String linkStyle, String targetType, String target, List<WidgetWorker.Parameter> parameterList,
|
||||
String description, ModelFormField modelFormField, HttpServletRequest request, HttpServletResponse response, Map<String, Object> context, String targetWindow)
|
||||
throws IOException {
|
||||
@@ -2481,7 +2481,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
action = modelFormField.getAction(context);
|
||||
}
|
||||
|
||||
if (UtilValidate.isNotEmpty(request.getAttribute("image"))){
|
||||
if (UtilValidate.isNotEmpty(request.getAttribute("image"))) {
|
||||
imgSrc = request.getAttribute("image").toString();
|
||||
}
|
||||
|
||||
@@ -2507,20 +2507,20 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
executeMacro(writer, sr.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void makeHiddenFormLinkAnchor(Appendable writer, String linkStyle, String description, ModelFormField modelFormField, HttpServletRequest request, HttpServletResponse response, Map<String, Object> context) throws IOException {
|
||||
if (UtilValidate.isNotEmpty(description) || UtilValidate.isNotEmpty(request.getAttribute("image"))) {
|
||||
String hiddenFormName = WidgetWorker.makeLinkHiddenFormName(context, modelFormField);
|
||||
String event = "";
|
||||
String action = "";
|
||||
String imgSrc = "";
|
||||
|
||||
|
||||
if (UtilValidate.isNotEmpty(modelFormField.getEvent()) && UtilValidate.isNotEmpty(modelFormField.getAction(context))) {
|
||||
event = modelFormField.getEvent();
|
||||
action = modelFormField.getAction(context);
|
||||
}
|
||||
|
||||
if (UtilValidate.isNotEmpty(request.getAttribute("image"))){
|
||||
if (UtilValidate.isNotEmpty(request.getAttribute("image"))) {
|
||||
imgSrc = request.getAttribute("image").toString();
|
||||
}
|
||||
|
||||
@@ -2542,7 +2542,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
executeMacro(writer, sr.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void makeHiddenFormLinkForm(Appendable writer, String target, String targetType, String targetWindow, List<WidgetWorker.Parameter> parameterList, ModelFormField modelFormField, HttpServletRequest request, HttpServletResponse response, Map<String, Object> context) throws IOException {
|
||||
StringBuilder actionUrl = new StringBuilder();
|
||||
WidgetWorker.buildHyperlinkUrl(actionUrl, target, targetType, null, null, false, false, true, request, response, context);
|
||||
@@ -2550,7 +2550,7 @@ public class MacroFormRenderer implements FormStringRenderer {
|
||||
StringBuilder parameters = new StringBuilder();
|
||||
parameters.append("[");
|
||||
for (WidgetWorker.Parameter parameter: parameterList) {
|
||||
if(parameters.length() > 1){
|
||||
if (parameters.length() > 1) {
|
||||
parameters.append(",");
|
||||
}
|
||||
parameters.append("{'name':'");
|
||||
|
||||
@@ -240,7 +240,7 @@ public abstract class ModelFormAction {
|
||||
}
|
||||
|
||||
// note that expanding the value string here will handle defaultValue and the string from
|
||||
// the properties file; if we decide later that we don't want the string from the properties
|
||||
// the properties file; if we decide later that we don't want the string from the properties
|
||||
// file to be expanded we should just expand the defaultValue at the beginning of this method.
|
||||
value = FlexibleStringExpander.expandString(value, context);
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ public abstract class ModelMenuAction {
|
||||
}
|
||||
|
||||
// note that expanding the value string here will handle defaultValue and the string from
|
||||
// the properties file; if we decide later that we don't want the string from the properties
|
||||
// the properties file; if we decide later that we don't want the string from the properties
|
||||
// file to be expanded we should just expand the defaultValue at the beginning of this method.
|
||||
value = FlexibleStringExpander.expandString(value, context);
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ public class HtmlWidget extends ModelScreenWidget {
|
||||
contextMs.put(mapEntry.getKey(), newList);
|
||||
}
|
||||
}
|
||||
// TODO and NOTE: should get most stuff, but we could support Maps
|
||||
// TODO and NOTE: should get most stuff, but we could support Maps
|
||||
// and Lists in Maps and such; that's tricky because we have to go
|
||||
// through the entire Map and not just one entry, and we would
|
||||
// have to shallow copy the whole Map too
|
||||
|
||||
@@ -181,12 +181,12 @@ public class MacroScreenRenderer implements ScreenStringRenderer {
|
||||
StringBuilder parameters=new StringBuilder();
|
||||
if ("hidden-form".equals(linkType)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
WidgetWorker.buildHyperlinkUrl(sb, target, link.getUrlMode(), null, link.getPrefix(context),
|
||||
WidgetWorker.buildHyperlinkUrl(sb, target, link.getUrlMode(), null, link.getPrefix(context),
|
||||
link.getFullPath(), link.getSecure(), link.getEncode(), request, response, context);
|
||||
actionUrl = sb.toString();
|
||||
parameters.append("[");
|
||||
for (WidgetWorker.Parameter parameter: link.getParameterList()) {
|
||||
if(parameters.length() >1){
|
||||
if (parameters.length() >1) {
|
||||
parameters.append(",");
|
||||
}
|
||||
parameters.append("{'name':'");
|
||||
@@ -206,9 +206,9 @@ public class MacroScreenRenderer implements ScreenStringRenderer {
|
||||
if (UtilValidate.isNotEmpty(target)) {
|
||||
if (!"hidden-form".equals(linkType)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
WidgetWorker.buildHyperlinkUrl(sb, target, link.getUrlMode(), link.getParameterList(), link.getPrefix(context),
|
||||
WidgetWorker.buildHyperlinkUrl(sb, target, link.getUrlMode(), link.getParameterList(), link.getPrefix(context),
|
||||
link.getFullPath(), link.getSecure(), link.getEncode(), request, response, context);
|
||||
linkUrl = sb.toString();
|
||||
linkUrl = sb.toString();
|
||||
}
|
||||
}
|
||||
String imgStr = "";
|
||||
@@ -249,7 +249,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer {
|
||||
}
|
||||
|
||||
public void renderImage(Appendable writer, Map<String, Object> context, ModelScreenWidget.Image image) throws IOException {
|
||||
if( image == null)
|
||||
if ( image == null)
|
||||
return ;
|
||||
String src = image.getSrc(context);
|
||||
String id = image.getId(context);
|
||||
@@ -548,7 +548,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer {
|
||||
editRequest += "contentId=" + expandedContentId;
|
||||
if (UtilValidate.isNotEmpty(expandedMapKey)) {
|
||||
editRequest += "&mapKey=" + expandedMapKey;
|
||||
}
|
||||
}
|
||||
ServletContext ctx = (ServletContext) request.getAttribute("servletContext");
|
||||
RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
|
||||
urlString = rh.makeLink(request, response, editRequest, false, false, false);
|
||||
@@ -592,7 +592,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer {
|
||||
boolean padded = screenlet.padded();
|
||||
String menuString = "";
|
||||
boolean showMore = false;
|
||||
if (UtilValidate.isNotEmpty(title) || navMenu != null || navForm != null || collapsible) {
|
||||
if (UtilValidate.isNotEmpty(title) || navMenu != null || navForm != null || collapsible) {
|
||||
showMore = true;
|
||||
if (collapsible) {
|
||||
collapsibleAreaId = this.getNextElementId();
|
||||
@@ -603,11 +603,11 @@ public class MacroScreenRenderer implements ScreenStringRenderer {
|
||||
expandToolTip = (String) uiLabelMap.get("CommonExpand");
|
||||
collapseToolTip = (String) uiLabelMap.get("CommonCollapse");
|
||||
}
|
||||
if (!javaScriptEnabled){
|
||||
if (!javaScriptEnabled) {
|
||||
requestParameters.put(screenlet.getPreferenceKey(context) + "_collapsed", "false");
|
||||
String queryString = UtilHttp.urlEncodeArgs(requestParameters);
|
||||
fullUrlString = request.getRequestURI() + "?" + queryString;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!collapsed) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -643,7 +643,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer {
|
||||
sr.append("\" padded=");
|
||||
sr.append(Boolean.toString(padded));
|
||||
sr.append(" menuString=\"");
|
||||
sr.append(menuString.replaceAll("\"", "'"));//FIXME change the " to ' for fix the macro invoke
|
||||
sr.append(menuString.replaceAll("\"", "'"));//FIXME change the " to ' for fix the macro invoke
|
||||
sr.append("\" showMore=");
|
||||
sr.append(Boolean.toString(showMore));
|
||||
sr.append(" collapsed=");
|
||||
@@ -766,7 +766,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer {
|
||||
int page = (listSize / viewSize) - 1;
|
||||
linkText = prepLinkText + page + anchor;
|
||||
lastLinkUrl = rh.makeLink(request, response, linkText);
|
||||
}
|
||||
}
|
||||
String paginateNextStyle = modelForm.getPaginateNextStyle();
|
||||
String paginateNextLabel = modelForm.getPaginateNextLabel(context);
|
||||
String nextLinkUrl = "";
|
||||
@@ -774,14 +774,14 @@ public class MacroScreenRenderer implements ScreenStringRenderer {
|
||||
linkText = prepLinkText + (viewIndex + 1) + anchor;
|
||||
// - make the link
|
||||
nextLinkUrl = rh.makeLink(request, response, linkText);
|
||||
}
|
||||
}
|
||||
String paginatePreviousStyle = modelForm.getPaginatePreviousStyle();
|
||||
String paginatePreviousLabel = modelForm.getPaginatePreviousLabel(context);
|
||||
String previousLinkUrl = "";
|
||||
if (viewIndex > 0) {
|
||||
linkText = prepLinkText + (viewIndex - 1) + anchor;
|
||||
previousLinkUrl = rh.makeLink(request, response, linkText);
|
||||
}
|
||||
}
|
||||
String paginateFirstStyle = modelForm.getPaginateFirstStyle();
|
||||
String paginateFirstLabel = modelForm.getPaginateFirstLabel(context);
|
||||
String firstLinkUrl = "";
|
||||
|
||||
@@ -367,7 +367,7 @@ public abstract class ModelScreenAction implements Serializable {
|
||||
}
|
||||
|
||||
// note that expanding the value string here will handle defaultValue and the string from
|
||||
// the properties file; if we decide later that we don't want the string from the properties
|
||||
// the properties file; if we decide later that we don't want the string from the properties
|
||||
// file to be expanded we should just expand the defaultValue at the beginning of this method.
|
||||
value = FlexibleStringExpander.expandString(value, context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user