UserPreferences.java

  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. package org.itracker.model;

  19. import org.apache.commons.lang.builder.ToStringBuilder;
  20. import org.itracker.core.resources.ITrackerResources;

  21. /**
  22.  * The system configuration of a User.
  23.  * <p/>
  24.  * <p>
  25.  * User - UserPreferences is a 1-1 relationship.
  26.  * </p>
  27.  *
  28.  * @author ready
  29.  */
  30. public class UserPreferences extends AbstractEntity {

  31.     /**
  32.      *
  33.      */
  34.     private static final long serialVersionUID = 1L;

  35.     /**
  36.      * The User to whom these preferences belong.
  37.      */
  38.     private User user;


  39.     private String userLocale = ITrackerResources.getDefaultLocale();

  40.     private int numItemsOnIndex = 0; // all

  41.     private int numItemsOnIssueList = 0; // all

  42.     private boolean showClosedOnIssueList = false;

  43.     private String sortColumnOnIssueList = "id";

  44.     private int hiddenIndexSections = 0;

  45.     private boolean rememberLastSearch = false;

  46.     private boolean useTextActions = false;
  47.     private boolean saveLogin;

  48.     @Deprecated
  49.     public boolean getSaveLogin() {
  50.         return saveLogin;
  51.     }

  52.     @Deprecated
  53.     public void setSaveLogin(boolean saveLogin) {
  54.         this.saveLogin = saveLogin;
  55.     }

  56.     public int getHiddenIndexSections() {
  57.         return hiddenIndexSections;
  58.     }

  59.     public void setHiddenIndexSections(int hiddenIndexSections) {
  60.         this.hiddenIndexSections = hiddenIndexSections;
  61.     }

  62.     public int getNumItemsOnIndex() {
  63.         return numItemsOnIndex;
  64.     }

  65.     public void setNumItemsOnIndex(int numItemsOnIndex) {
  66.         this.numItemsOnIndex = numItemsOnIndex;
  67.     }

  68.     public int getNumItemsOnIssueList() {
  69.         return numItemsOnIssueList;
  70.     }

  71.     public void setNumItemsOnIssueList(int numItemsOnIssueList) {
  72.         this.numItemsOnIssueList = numItemsOnIssueList;
  73.     }

  74.     public boolean getRememberLastSearch() {
  75.         return rememberLastSearch;
  76.     }

  77.     public void setRememberLastSearch(boolean rememberLastSearch) {
  78.         this.rememberLastSearch = rememberLastSearch;
  79.     }

  80.     public boolean getShowClosedOnIssueList() {
  81.         return showClosedOnIssueList;
  82.     }

  83.     public void setShowClosedOnIssueList(boolean showClosedOnIssueList) {
  84.         this.showClosedOnIssueList = showClosedOnIssueList;
  85.     }

  86.     public String getSortColumnOnIssueList() {
  87.         return sortColumnOnIssueList;
  88.     }

  89.     public void setSortColumnOnIssueList(String sortColumnOnIssueList) {
  90.         this.sortColumnOnIssueList = sortColumnOnIssueList;
  91.     }

  92.     public User getUser() {
  93.         return user;
  94.     }

  95.     public void setUser(User user) {
  96.         this.user = user;
  97.     }

  98.     public String getUserLocale() {
  99.         return userLocale;
  100.     }

  101.     public void setUserLocale(String userLocale) {
  102.         this.userLocale = userLocale;
  103.     }

  104.     public boolean getUseTextActions() {
  105.         return useTextActions;
  106.     }

  107.     public void setUseTextActions(boolean useTextActions) {
  108.         this.useTextActions = useTextActions;
  109.     }

  110.     @Override
  111.     public String toString() {
  112.         return new ToStringBuilder(this).append("id", getId()).append("user", getUser())
  113.                 .append("userLocale", getUserLocale()).append("useTextActions",
  114.                         getUseTextActions()).append(
  115.                         "rememberLastSearch", getRememberLastSearch()).append(
  116.                         "hiddenIndexSections", getHiddenIndexSections()).append(
  117.                         "numItemsOnIndex", getNumItemsOnIndex()).append(
  118.                         "numItemsOnIssueList", getNumItemsOnIssueList()).append(
  119.                         "showClosedOnIssueList", getShowClosedOnIssueList())
  120.                 .toString();
  121.     }

  122. }