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   * <p/>
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      /**
41       * The User to whom these preferences belong.
42       */
43      private User user;
44  
45  
46      private String userLocale = ITrackerResources.getDefaultLocale();
47  
48      private int numItemsOnIndex = 0; // all
49  
50      private int numItemsOnIssueList = 0; // all
51  
52      private boolean showClosedOnIssueList = false;
53  
54      private String sortColumnOnIssueList = "id";
55  
56      private int hiddenIndexSections = 0;
57  
58      private boolean rememberLastSearch = false;
59  
60      private boolean useTextActions = false;
61      private boolean saveLogin;
62  
63      @Deprecated
64      public boolean getSaveLogin() {
65          return saveLogin;
66      }
67  
68      @Deprecated
69      public void setSaveLogin(boolean saveLogin) {
70          this.saveLogin = saveLogin;
71      }
72  
73      public int getHiddenIndexSections() {
74          return hiddenIndexSections;
75      }
76  
77      public void setHiddenIndexSections(int hiddenIndexSections) {
78          this.hiddenIndexSections = hiddenIndexSections;
79      }
80  
81      public int getNumItemsOnIndex() {
82          return numItemsOnIndex;
83      }
84  
85      public void setNumItemsOnIndex(int numItemsOnIndex) {
86          this.numItemsOnIndex = numItemsOnIndex;
87      }
88  
89      public int getNumItemsOnIssueList() {
90          return numItemsOnIssueList;
91      }
92  
93      public void setNumItemsOnIssueList(int numItemsOnIssueList) {
94          this.numItemsOnIssueList = numItemsOnIssueList;
95      }
96  
97      public boolean getRememberLastSearch() {
98          return rememberLastSearch;
99      }
100 
101     public void setRememberLastSearch(boolean rememberLastSearch) {
102         this.rememberLastSearch = rememberLastSearch;
103     }
104 
105     public boolean getShowClosedOnIssueList() {
106         return showClosedOnIssueList;
107     }
108 
109     public void setShowClosedOnIssueList(boolean showClosedOnIssueList) {
110         this.showClosedOnIssueList = showClosedOnIssueList;
111     }
112 
113     public String getSortColumnOnIssueList() {
114         return sortColumnOnIssueList;
115     }
116 
117     public void setSortColumnOnIssueList(String sortColumnOnIssueList) {
118         this.sortColumnOnIssueList = sortColumnOnIssueList;
119     }
120 
121     public User getUser() {
122         return user;
123     }
124 
125     public void setUser(User user) {
126         this.user = user;
127     }
128 
129     public String getUserLocale() {
130         return userLocale;
131     }
132 
133     public void setUserLocale(String userLocale) {
134         this.userLocale = userLocale;
135     }
136 
137     public boolean getUseTextActions() {
138         return useTextActions;
139     }
140 
141     public void setUseTextActions(boolean useTextActions) {
142         this.useTextActions = useTextActions;
143     }
144 
145     @Override
146     public String toString() {
147         return new ToStringBuilder(this).append("id", getId()).append("user", getUser())
148                 .append("userLocale", getUserLocale()).append("useTextActions",
149                         getUseTextActions()).append(
150                         "rememberLastSearch", getRememberLastSearch()).append(
151                         "hiddenIndexSections", getHiddenIndexSections()).append(
152                         "numItemsOnIndex", getNumItemsOnIndex()).append(
153                         "numItemsOnIssueList", getNumItemsOnIssueList()).append(
154                         "showClosedOnIssueList", getShowClosedOnIssueList())
155                 .toString();
156     }
157 
158 }