PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/src/mpv5/db/objects/MailMessage.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 83 lines | 38 code | 13 blank | 32 comment | 1 complexity | 5b966bdc249921065353ecc019d268c5 MD5 | raw file
 1/*
 2 *  This file is part of YaBS.
 3 *
 4 *      YaBS is free software: you can redistribute it and/or modify
 5 *      it under the terms of the GNU General Public License as published by
 6 *      the Free Software Foundation, either version 3 of the License, or
 7 *      (at your option) any later version.
 8 *
 9 *      YaBS is distributed in the hope that it will be useful,
10 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
11 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 *      GNU General Public License for more details.
13 *
14 *      You should have received a copy of the GNU General Public License
15 *      along with YaBS.  If not, see <http://www.gnu.org/licenses/>.
16 */
17package mpv5.db.objects;
18
19import javax.swing.JComponent;
20
21import mpv5.db.common.Context;
22import mpv5.db.common.DatabaseObject;
23
24/**
25 *
26 *  Messages
27 */
28public class MailMessage extends DatabaseObject {
29
30    private int usersids;
31    private String description;
32
33    public MailMessage() {
34        setContext(Context.getMessage());
35    }
36
37    @Override
38    public JComponent getView() {
39        throw new UnsupportedOperationException("Not supported yet.");
40    }
41
42    @Override
43    public mpv5.utils.images.MPIcon getIcon() {
44        return null;
45    }
46
47    /**
48     * @return the usersids
49     */
50    public int __getUsersids() {
51        return usersids;
52    }
53
54    /**
55     * @param usersids the usersids to set
56     */
57    public void setUsersids(int usersids) {
58        this.usersids = usersids;
59    }
60
61    /**
62     * @return the description
63     */
64    public String __getDescription() {
65        return description;
66    }
67
68    /**
69     * @param description the description to set
70     */
71    public void setDescription(String description) {
72        this.description = description;
73    }
74
75    @Override
76    public boolean saveImport() {
77        if (usersids <= 0) {
78            usersids = User.getCurrentUser().__getIDS();
79        }
80
81        return super.saveImport();
82    }
83}