Line | Hits | Source |
---|---|---|
1 | /******************************************************************************* | |
2 | * Demetrix process modelling system | |
3 | * | |
4 | * Copyright (c) 2003, 2004 Dimitri A. Pissarenko | |
5 | * | |
6 | * This file is part of Demetrix. | |
7 | * | |
8 | * Demetrix is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; either version 2.1 of the License, or | |
11 | * (at your option) any later version. | |
12 | * | |
13 | * Demetrix 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 | * You should have received a copy of the GNU General Public License | |
19 | * along with Demetrix; if not, write to the Free Software | |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | * | |
22 | * For further information you may | |
23 | * | |
24 | * - send an e-mail in Russian, German or English to dimitri.pissarenko@gmx.net | |
25 | * - look at http://sourceforge.net/projects/demetrix/ | |
26 | * - look at http://demetrix.sourceforge.net/ | |
27 | * - look at http://members.inode.at/d.pissarenko/ | |
28 | * | |
29 | *****************************************************************************/ | |
30 | ||
31 | package net.sourceforge.demetrix.properties; | |
32 | ||
33 | import java.io.File; | |
34 | ||
35 | import java.io.Serializable; | |
36 | ||
37 | import javax.swing.filechooser.FileFilter; | |
38 | ||
39 | 12 | public class FileProperty extends DemetrixProperty implements Serializable { |
40 | ||
41 | private boolean mustBeReadable; | |
42 | ||
43 | private boolean mustBeWriteable; | |
44 | ||
45 | private FileFilter fileFilter; | |
46 | ||
47 | /* (non-Javadoc) | |
48 | * @see net.sourceforge.demetrix.properties.DemetrixProperty#setValue(java.lang.Object) | |
49 | */ | |
50 | ||
51 | public void setValue(Object object) { | |
52 | ||
53 | 18 | this.setAllowedValue(object, File.class); |
54 | ||
55 | 14 | } |
56 | ||
57 | /** | |
58 | * @return | |
59 | */ | |
60 | ||
61 | public boolean isMustBeReadable() { | |
62 | ||
63 | 18 | return mustBeReadable; |
64 | ||
65 | } | |
66 | ||
67 | /** | |
68 | * @return | |
69 | */ | |
70 | ||
71 | public boolean isMustBeWriteable() { | |
72 | ||
73 | 18 | return mustBeWriteable; |
74 | ||
75 | } | |
76 | ||
77 | /** | |
78 | * @param b | |
79 | */ | |
80 | ||
81 | public void setMustBeReadable(boolean b) { | |
82 | ||
83 | 4 | mustBeReadable = b; |
84 | ||
85 | 4 | } |
86 | ||
87 | /** | |
88 | * @param b | |
89 | */ | |
90 | ||
91 | public void setMustBeWriteable(boolean b) { | |
92 | ||
93 | 4 | mustBeWriteable = b; |
94 | ||
95 | 4 | } |
96 | ||
97 | /** | |
98 | * @return | |
99 | */ | |
100 | ||
101 | public FileFilter getFileFilter() { | |
102 | ||
103 | 25 | return fileFilter; |
104 | ||
105 | } | |
106 | ||
107 | /** | |
108 | * @param filter | |
109 | */ | |
110 | ||
111 | public void setFileFilter(FileFilter filter) { | |
112 | ||
113 | 3 | fileFilter = filter; |
114 | ||
115 | 3 | } |
116 | ||
117 | /* (non-Javadoc) | |
118 | * @see java.lang.Object#equals(java.lang.Object) | |
119 | */ | |
120 | public boolean equals(Object arg0) { | |
121 | 2 | return super.equals(arg0); |
122 | } | |
123 | ||
124 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |