From: Roland Häder Date: Sat, 22 Dec 2018 00:15:33 +0000 (+0100) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4db105abc10b723371147f7c658e92c31e8db356;p=jfinancials-war.git Please cherry-pick: - introduced 2nd parameter for beanHelper.renderBasicData() to include short or long name in view components - also use that method instead of invoking getter in same helper backing-bean - re-aligned some JSF tags to have their attributes in distinct lines (easy to add another) Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperBean.java b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperBean.java index a2709ec3..811af1a7 100644 --- a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperBean.java +++ b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperBean.java @@ -443,18 +443,25 @@ public class FinancialsWebViewHelperBean extends BaseFinancialsBean implements F /** * Renders data of basic company data *

- * @param basicData Basic company data instance + * @param basicData Basic company data instance + * @param useShortName Whether to use short name or long name of company *

* @return Basic company data as string */ - public String renderBasicData (final BasicData basicData) { + public String renderBasicData (final BasicData basicData, final boolean useShortName) { // Default is empty string, so let's get started final StringBuilder sb = new StringBuilder(30); // Is basic company data set? if (basicData instanceof BasicData) { - // Add company name - sb.append(basicData.getCompanyName()); //NOI18N + // Short or long name? + if (useShortName) { + // Add company's long name + sb.append(basicData.getCompanyShortName()); //NOI18N + } else { + // Add company's long name + sb.append(basicData.getCompanyName()); //NOI18N + } // Is email address set? if (basicData.getCompanyEmailAddress() != null) { @@ -491,7 +498,7 @@ public class FinancialsWebViewHelperBean extends BaseFinancialsBean implements F assert (branchOffice.getBranchCompany() instanceof BasicData) : "branchOffice.branchCompany is null"; //NOI18N // Yes, then append all data - sb.append(branchOffice.getBranchCompany().getCompanyName()); + sb.append(this.renderBasicData(branchOffice.getBranchCompany(), true)); sb.append(", "); //NOI18N sb.append(branchOffice.getBranchStreet()); sb.append(" "); //NOI18N @@ -576,7 +583,7 @@ public class FinancialsWebViewHelperBean extends BaseFinancialsBean implements F // Then create name sb.append(this.getMessageFromBundle(department.getDepartmentI18nKey())); sb.append(" ("); //NOI18N - sb.append(department.getDepartmentCompany().getCompanyName()); + sb.append(this.renderBasicData(department.getDepartmentCompany(), true)); sb.append(")"); //NOI18N } diff --git a/web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl b/web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl index 90a88a8d..6b4e9f96 100644 --- a/web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl +++ b/web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl @@ -36,7 +36,7 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true)}" /> diff --git a/web/WEB-INF/templates/admin/department/admin_form_department_data.tpl b/web/WEB-INF/templates/admin/department/admin_form_department_data.tpl index 42747902..6d45042d 100644 --- a/web/WEB-INF/templates/admin/department/admin_form_department_data.tpl +++ b/web/WEB-INF/templates/admin/department/admin_form_department_data.tpl @@ -43,7 +43,7 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true)}" /> diff --git a/web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl b/web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl index be6680b6..2aef9d52 100644 --- a/web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl +++ b/web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl @@ -30,13 +30,18 @@ - + diff --git a/web/admin/branch_office/admin_branch_office_list.xhtml b/web/admin/branch_office/admin_branch_office_list.xhtml index f4feb5f8..7edd8391 100644 --- a/web/admin/branch_office/admin_branch_office_list.xhtml +++ b/web/admin/branch_office/admin_branch_office_list.xhtml @@ -107,12 +107,16 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true)}" /> - + @@ -226,7 +230,12 @@ - + diff --git a/web/admin/department/admin_department_list.xhtml b/web/admin/department/admin_department_list.xhtml index a5329f06..f9df8cc0 100644 --- a/web/admin/department/admin_department_list.xhtml +++ b/web/admin/department/admin_department_list.xhtml @@ -79,12 +79,16 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true)}" /> - + diff --git a/web/admin/employee/admin_employee_list.xhtml b/web/admin/employee/admin_employee_list.xhtml index 12e7bd84..bcff7fd2 100644 --- a/web/admin/employee/admin_employee_list.xhtml +++ b/web/admin/employee/admin_employee_list.xhtml @@ -139,12 +139,16 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true)}" /> - +