Statistics
| Branch: | Tag: | Revision:

root / src / gr / ebs / gss / client / clipboard / ClipboardItem.java @ 31840568

History | View | Annotate | Download (3.7 kB)

1
/*
2
 * Copyright 2008, 2009 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
6
 * GSS is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * GSS is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with GSS.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19
package gr.ebs.gss.client.clipboard;
20

    
21
import gr.ebs.gss.client.rest.resource.FileResource;
22
import gr.ebs.gss.client.rest.resource.RestResourceWrapper;
23
import gr.ebs.gss.client.rest.resource.GroupUserResource;
24

    
25
import java.io.Serializable;
26
import java.util.List;
27

    
28

    
29
/**
30
 * @author kman
31
 *
32
 */
33
public class ClipboardItem implements Serializable{
34
        private int operation;
35
        private FileResource file;
36
        private List<FileResource> files;
37
        private RestResourceWrapper folderResource;
38
        private GroupUserResource user;
39

    
40
        public ClipboardItem(){}
41

    
42
        public ClipboardItem(int anOperation, List<FileResource> theFiles){
43
                operation = anOperation;
44
                files = theFiles;
45
        }
46

    
47
        public ClipboardItem(int anOperation, FileResource aFile){
48
                operation = anOperation;
49
                file = aFile;
50
        }
51

    
52
        public ClipboardItem(int anOperation, RestResourceWrapper folder){
53
                operation = anOperation;
54
                folderResource = folder;
55
        }
56
        public ClipboardItem(int anOperation, GroupUserResource aUser){
57
                operation = anOperation;
58
                user = aUser;
59
        }
60

    
61
        public ClipboardItem(GroupUserResource aUser){
62
                operation = Clipboard.COPY;
63
                user = aUser;
64
        }
65

    
66
        public ClipboardItem(List<FileResource> theFiles){
67
                operation = Clipboard.COPY;
68
                files = theFiles;
69
        }
70

    
71
        public ClipboardItem(FileResource aFile){
72
                operation = Clipboard.COPY;
73
                file = aFile;
74
        }
75

    
76
        public ClipboardItem(RestResourceWrapper folder){
77
                operation = Clipboard.COPY;
78
                folderResource = folder;
79
        }
80

    
81
        /**
82
         * Retrieve the user.
83
         *
84
         * @return the user
85
         */
86
        public GroupUserResource getUser() {
87
                return user;
88
        }
89

    
90
        /**
91
         * Modify the user.
92
         *
93
         * @param aUser the user to set
94
         */
95
        public void setUser(GroupUserResource aUser) {
96
                user = aUser;
97
        }
98

    
99
        /**
100
         * Retrieve the operation.
101
         *
102
         * @return the operation
103
         */
104
        public int getOperation() {
105
                return operation;
106
        }
107

    
108
        /**
109
         * Modify the operation.
110
         *
111
         * @param anOperation the operation to set
112
         */
113
        public void setOperation(int anOperation) {
114
                operation = anOperation;
115
        }
116

    
117
        /**
118
         * Retrieve the file.
119
         *
120
         * @return the file
121
         */
122
        public FileResource getFile() {
123
                return file;
124
        }
125

    
126
        /**
127
         * Modify the file.
128
         *
129
         * @param aFile the file to set
130
         */
131
        public void setFile(FileResource aFile) {
132
                file = aFile;
133
        }
134

    
135
        /**
136
         * Retrieve the files.
137
         *
138
         * @return the files
139
         */
140
        public List<FileResource> getFiles() {
141
                return files;
142
        }
143

    
144
        /**
145
         * checks whether the clipboard item is a file or folder
146
         */
147
        public boolean isFileOrFolder(){
148
                if(file !=null || files != null || folderResource != null)
149
                        return true;
150
                return false;
151
        }
152

    
153
        /**
154
         * checks whether the clipboard item is a file (or files)
155
         */
156
        public boolean isFile() {
157
                if(file !=null || files != null)
158
                        return true;
159
                return false;
160
        }
161

    
162
        public boolean isUser(){
163
                if( user!=null  )
164
                        return true;
165
                return false;
166
        }
167

    
168
        /**
169
         * Retrieve the folderResource.
170
         *
171
         * @return the folderResource
172
         */
173
        public RestResourceWrapper getRestResourceWrapper() {
174
                return folderResource;
175
        }
176

    
177
        /**
178
         * Modify the folderResource.
179
         *
180
         * @param aFolder the folderResource to set
181
         */
182
        public void setRestResourceWrapper(RestResourceWrapper aFolder) {
183
                folderResource = aFolder;
184
        }
185
}