View Javadoc

1   /*
2    * This software was designed and created by Jason Carroll.
3    * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4    * The author can be reached at jcarroll@cowsultants.com
5    * ITracker website: http://www.cowsultants.com
6    * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7    *
8    * This program is free software; you can redistribute it and/or modify
9    * it only under the terms of the GNU General Public License as published by
10   * the Free Software Foundation; either version 2 of the License, or
11   * (at your option) any later version.
12   *
13   * This program is distributed in the hope that it will be useful,
14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   * GNU General Public License for more details.
17   */
18  
19  package org.itracker.model;
20  
21  import org.apache.commons.lang.builder.ToStringBuilder;
22  import org.itracker.core.resources.ITrackerResources;
23  
24  /**
25   * The system configuration of a User.
26   * 
27   * <p>
28   * User - UserPreferences is a 1-1 relationship.
29   * </p>
30   * 
31   * @author ready
32   */
33  public class UserPreferences extends AbstractEntity {
34  
35  	/**
36  	 * 
37  	 */
38  	private static final long serialVersionUID = 1L;
39  
40  	/** The User to whom these preferences belong. */
41  	private User user;
42  
43  	private boolean saveLogin = false;
44  
45  	private String userLocale = ITrackerResources.getDefaultLocale();
46  
47  	private int numItemsOnIndex = 0; // all
48  
49  	private int numItemsOnIssueList = 0; // all
50  
51  	private boolean showClosedOnIssueList = false;
52  
53  	private String sortColumnOnIssueList = "id";
54  
55  	private int hiddenIndexSections = 0;
56  
57  	private boolean rememberLastSearch = false;
58  
59  	private boolean useTextActions = false;
60  
61  	public int getHiddenIndexSections() {
62  		return hiddenIndexSections;
63  	}
64  
65  	public void setHiddenIndexSections(int hiddenIndexSections) {
66  		this.hiddenIndexSections = hiddenIndexSections;
67  	}
68  
69  	public int getNumItemsOnIndex() {
70  		return numItemsOnIndex;
71  	}
72  
73  	public void setNumItemsOnIndex(int numItemsOnIndex) {
74  		this.numItemsOnIndex = numItemsOnIndex;
75  	}
76  
77  	public int getNumItemsOnIssueList() {
78  		return numItemsOnIssueList;
79  	}
80  
81  	public void setNumItemsOnIssueList(int numItemsOnIssueList) {
82  		this.numItemsOnIssueList = numItemsOnIssueList;
83  	}
84  
85  	public boolean getRememberLastSearch() {
86  		return rememberLastSearch;
87  	}
88  
89  	public void setRememberLastSearch(boolean rememberLastSearch) {
90  		this.rememberLastSearch = rememberLastSearch;
91  	}
92  
93  	public boolean getSaveLogin() {
94  		return saveLogin;
95  	}
96  
97  	public void setSaveLogin(boolean saveLogin) {
98  		this.saveLogin = saveLogin;
99  	}
100 
101 	public boolean getShowClosedOnIssueList() {
102 		return showClosedOnIssueList;
103 	}
104 
105 	public void setShowClosedOnIssueList(boolean showClosedOnIssueList) {
106 		this.showClosedOnIssueList = showClosedOnIssueList;
107 	}
108 
109 	public String getSortColumnOnIssueList() {
110 		return sortColumnOnIssueList;
111 	}
112 
113 	public void setSortColumnOnIssueList(String sortColumnOnIssueList) {
114 		this.sortColumnOnIssueList = sortColumnOnIssueList;
115 	}
116 
117 	public User getUser() {
118 		return user;
119 	}
120 
121 	public void setUser(User user) {
122 		this.user = user;
123 	}
124 
125 	public String getUserLocale() {
126 		return userLocale;
127 	}
128 
129 	public void setUserLocale(String userLocale) {
130 		this.userLocale = userLocale;
131 	}
132 
133 	public boolean getUseTextActions() {
134 		return useTextActions;
135 	}
136 
137 	public void setUseTextActions(boolean useTextActions) {
138 		this.useTextActions = useTextActions;
139 	}
140 
141 	@Override
142 	public String toString() {
143 		return new ToStringBuilder(this).append("id", getId()).append("user", getUser())
144 				.append("userLocale", getUserLocale()).append("useTextActions",
145 						getUseTextActions()).append("saveLogin", getSaveLogin()).append(
146 						"rememberLastSearch", getRememberLastSearch()).append(
147 						"hiddenIndexSections", getHiddenIndexSections()).append(
148 						"numItemsOnIndex", getNumItemsOnIndex()).append(
149 						"numItemsOnIssueList", getNumItemsOnIssueList()).append(
150 						"showClosedOnIssueList", getShowClosedOnIssueList())
151 				.toString();
152 	}
153 
154 }