Author: nbelaevski
Date: 2010-05-28 11:30:17 -0400 (Fri, 28 May 2010)
New Revision: 17370
Modified:
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/DataBean.java
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/model/Company.java
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/model/Employee.java
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/utils/EmployeeUtils.java
Log:
Fixed CheckStyle violations in iteration-demo
Modified:
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/DataBean.java
===================================================================
---
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/DataBean.java 2010-05-28
15:23:13 UTC (rev 17369)
+++
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/DataBean.java 2010-05-28
15:30:17 UTC (rev 17370)
@@ -16,21 +16,26 @@
@ManagedBean(name="dataBean")
@SessionScoped
public class DataBean {
-
+
DataComponentState dataTableState;
-
+
Map<Object,Integer> stateMap = new HashMap<Object, Integer>();
-
+
+ int page = 1;
+
private String test1 = "test1";
-
+
private String test2 = "test2";
-
+
private String target = "targetId";
-
+
private String operation = "operation";
-
+
private boolean rendered = true;
-
+
+ private List<Employee> employeeList;
+ private boolean state = true;
+
public String getTarget() {
return target;
}
@@ -63,9 +68,7 @@
this.test2 = test2;
}
- int page = 1;
-
- public int getPage() {
+ public int getPage() {
return page;
}
@@ -89,36 +92,33 @@
this.dataTableState = dataTableState;
}
- private List<Employee> employeeList;
- private boolean state = true;
-
public void setEmployeeList(List<Employee> employeeList) {
- this.employeeList = employeeList;
- }
+ this.employeeList = employeeList;
+ }
- public List<Employee> getEmployeeList() {
- if(employeeList == null){
- employeeList = EmployeeUtils.obtainDefaultEmployeeList();
- }
- return employeeList;
- }
+ public List<Employee> getEmployeeList() {
+ if(employeeList == null){
+ employeeList = EmployeeUtils.obtainDefaultEmployeeList();
+ }
+ return employeeList;
+ }
- public boolean isState() {
- return state;
- }
+ public boolean isState() {
+ return state;
+ }
- public void setState(boolean state) {
- this.state = state;
- }
-
- public void sortingListener(SortingEvent event) {
- System.out.println(event.getSortOrder());
- }
-
- public Date getDate() {
- return new Date();
- }
+ public void setState(boolean state) {
+ this.state = state;
+ }
+ public void sortingListener(SortingEvent event) {
+ System.out.println(event.getSortOrder());
+ }
+
+ public Date getDate() {
+ return new Date();
+ }
+
public void setRendered(boolean rendered) {
this.rendered = rendered;
}
Modified:
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/model/Company.java
===================================================================
---
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/model/Company.java 2010-05-28
15:23:13 UTC (rev 17369)
+++
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/model/Company.java 2010-05-28
15:30:17 UTC (rev 17370)
@@ -4,56 +4,56 @@
public class Company {
- private String name;
+ private String name;
- private String state;
+ private String state;
- private String phone;
-
+ private String phone;
- public Company(String name) {
- this.name = name;
- }
- public String getName() {
- return name;
- }
+ public Company(String name) {
+ this.name = name;
+ }
- public void setName(String name) {
- this.name = name;
- }
+ public String getName() {
+ return name;
+ }
- public String getState() {
- return state;
- }
+ public void setName(String name) {
+ this.name = name;
+ }
- public void setState(String state) {
- this.state = state;
- }
+ public String getState() {
+ return state;
+ }
- public String getPhone() {
- return phone;
- }
+ public void setState(String state) {
+ this.state = state;
+ }
- public void setPhone(String phone) {
- this.phone = phone;
- }
+ public String getPhone() {
+ return phone;
+ }
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof Company)) {
- return false;
- }
- Company company = (Company) obj;
- return name.equals(company.getName());
- }
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
- @Override
- public int hashCode() {
- return 31 + 17 * name.hashCode();
- }
-
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof Company)) {
+ return false;
+ }
+ Company company = (Company) obj;
+ return name.equals(company.getName());
+ }
+
+ @Override
+ public int hashCode() {
+ return 31 + 17 * name.hashCode();
+ }
+
}
Modified:
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/model/Employee.java
===================================================================
---
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/model/Employee.java 2010-05-28
15:23:13 UTC (rev 17369)
+++
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/model/Employee.java 2010-05-28
15:30:17 UTC (rev 17370)
@@ -8,59 +8,58 @@
public class Employee {
- private String name;
+ private static String[] phoneNames = {"Cell phone", "Work phone",
"Home phone"};
- private String title;
+ private String name;
- private List <Company> companies;
+ private String title;
- private String eMail;
-
- private boolean expand;
+ private List <Company> companies;
+ private String eMail;
- private List<String[]> phones = new ArrayList<String[]>();
-
- private static String[] phoneNames = {"Cell phone", "Work phone",
"Home phone"};
-
- public Employee(String name, String title) {
- this.name = name;
- this.title = title;
- initPhones();
- }
+ private boolean expand;
- private void initPhones() {
- Random random = new Random();
- int count = random.nextInt(phoneNames.length + 1);
- for (int i = 0; i < count; i++) {
- phones.add(new String[]{phoneNames[i], "+" + random.nextInt(1000) +
"-" + random.nextInt(1000000000)});
- }
- }
-
- public String getTitle() {
- return title;
- }
+ private List<String[]> phones = new ArrayList<String[]>();
- public void setTitle(String title) {
- this.title = title;
- }
+ public Employee(String name, String title) {
+ this.name = name;
+ this.title = title;
+ initPhones();
+ }
- public String getName() {
- return name;
- }
+ private void initPhones() {
+ Random random = new Random();
+ int count = random.nextInt(phoneNames.length + 1);
+ for (int i = 0; i < count; i++) {
+ phones.add(new String[]{phoneNames[i], "+" + random.nextInt(1000) +
"-" + random.nextInt(1000000000)});
+ }
+ }
- public void setName(String name) {
- this.name = name;
- }
+ public String getTitle() {
+ return title;
+ }
- public List <Company> getCompanies() {
- return companies;
- }
+ public void setTitle(String title) {
+ this.title = title;
+ }
- public void setCompanies(List<Company> companies) {
- this.companies = companies;
- }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List <Company> getCompanies() {
+ return companies;
+ }
+
+ public void setCompanies(List<Company> companies) {
+ this.companies = companies;
+ }
+
public String getEMail() {
return eMail;
}
@@ -69,48 +68,48 @@
this.eMail = eMail;
}
- public void setPhones(List<String[]> phones) {
- this.phones = phones;
- }
+ public void setPhones(List<String[]> phones) {
+ this.phones = phones;
+ }
- public List<String[]> getPhones() {
- return phones;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof Employee)) {
- return false;
- }
- Employee employee = (Employee) obj;
- return name.equals(employee.getName())
- && title.equals(employee.getTitle())
- && (companies == null ? employee.getCompanies() == null : companies
- .equals(employee.getCompanies()));
- }
+ public List<String[]> getPhones() {
+ return phones;
+ }
- @Override
- public int hashCode() {
- int hash = 1;
- hash = hash * 17 + name.hashCode();
- hash = hash * 17 + title.hashCode();
- hash = hash * 17 + (companies == null ? 0 : companies.hashCode());
- return hash;
- }
-
- public void toggle(ToggleEvent event) {
- this.expand = event.isExpanded();
- }
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof Employee)) {
+ return false;
+ }
+ Employee employee = (Employee) obj;
+ return name.equals(employee.getName())
+ && title.equals(employee.getTitle())
+ && (companies == null ? employee.getCompanies() == null : companies
+ .equals(employee.getCompanies()));
+ }
- public boolean isExpand() {
- return expand;
- }
+ @Override
+ public int hashCode() {
+ int hash = 1;
+ hash = hash * 17 + name.hashCode();
+ hash = hash * 17 + title.hashCode();
+ hash = hash * 17 + (companies == null ? 0 : companies.hashCode());
+ return hash;
+ }
- public void setExpand(boolean expand) {
- this.expand = expand;
- }
+ public void toggle(ToggleEvent event) {
+ this.expand = event.isExpanded();
+ }
+ public boolean isExpand() {
+ return expand;
+ }
+
+ public void setExpand(boolean expand) {
+ this.expand = expand;
+ }
+
}
\ No newline at end of file
Modified:
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/utils/EmployeeUtils.java
===================================================================
---
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/utils/EmployeeUtils.java 2010-05-28
15:23:13 UTC (rev 17369)
+++
root/examples/iteration-demo/trunk/src/main/java/org/richfaces/demo/utils/EmployeeUtils.java 2010-05-28
15:30:17 UTC (rev 17370)
@@ -1,20 +1,22 @@
package org.richfaces.demo.utils;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
import org.richfaces.demo.model.Company;
import org.richfaces.demo.model.Employee;
-public class EmployeeUtils {
+public final class EmployeeUtils {
+ private EmployeeUtils() {
+ }
+
public static List<Employee> obtainDefaultEmployeeList() {
List<Employee> employeeList = new ArrayList<Employee>();
addEmployeeToCollection(employeeList, "9Alexander Ivanov",
"Director", "aivanov(a)beltelecom.by", "AMicrosoft",
"+375 29 255 00 00", "Minsk, Belarus");
- addEmployeeToCollection(employeeList, "4Bill Gates",
"President", "bgates(a)microsoft.com", "AMicrosoft",
"817-335-5881", "Tokyo, Japan");
+ addEmployeeToCollection(employeeList, "4Bill Gates",
"President", "bgates(a)microsoft.com", "AMicrosoft",
"817-335-5881", "Tokyo, Japan");
addEmployeeToCollection(employeeList, "Amanda Gellhouse",
"IT/Internet Support; Manager", "agellhouse(a)sun.com", "Sun",
"853-729-3784", "Sun Valley, USA");
addEmployeeToCollection(employeeList, "2Hideo Kodzima", "Vice
Prezident", "khideo(a)konami.jp", "AMicrosoft",
"419-615-2730", "Tokyo, Japan");
addEmployeeToCollection(employeeList, "3Stan Carpenter", "Lead
Designer", "scarpenter(a)ndogs.com", "AMicrosoft",
"714-647-3380", "Tokyo, Japan");