Revision 9ab5db6d src/gr/ebs/gss/client/commands/PropertiesCommand.java
b/src/gr/ebs/gss/client/commands/PropertiesCommand.java | ||
---|---|---|
19 | 19 |
package gr.ebs.gss.client.commands; |
20 | 20 |
|
21 | 21 |
import gr.ebs.gss.client.FileMenu; |
22 |
import gr.ebs.gss.client.FileMenu.Images; |
|
23 | 22 |
import gr.ebs.gss.client.FilePropertiesDialog; |
24 | 23 |
import gr.ebs.gss.client.FilesPropertiesDialog; |
25 | 24 |
import gr.ebs.gss.client.FolderPropertiesDialog; |
26 | 25 |
import gr.ebs.gss.client.GSS; |
26 |
import gr.ebs.gss.client.FileMenu.Images; |
|
27 | 27 |
import gr.ebs.gss.client.rest.GetCommand; |
28 | 28 |
import gr.ebs.gss.client.rest.HeadCommand; |
29 | 29 |
import gr.ebs.gss.client.rest.MultipleGetCommand; |
30 |
import gr.ebs.gss.client.rest.MultipleGetCommand.Cached; |
|
31 | 30 |
import gr.ebs.gss.client.rest.MultipleHeadCommand; |
32 | 31 |
import gr.ebs.gss.client.rest.RestException; |
32 |
import gr.ebs.gss.client.rest.MultipleGetCommand.Cached; |
|
33 | 33 |
import gr.ebs.gss.client.rest.resource.FileResource; |
34 | 34 |
import gr.ebs.gss.client.rest.resource.FolderResource; |
35 | 35 |
import gr.ebs.gss.client.rest.resource.GroupResource; |
... | ... | |
62 | 62 |
|
63 | 63 |
private int tabToShow = 0; |
64 | 64 |
|
65 |
private String userName; |
|
66 |
|
|
65 | 67 |
/** |
66 | 68 |
* @param _containerPanel |
67 | 69 |
* @param _newImages the images of all the possible delete dialogs |
... | ... | |
156 | 158 |
private void initialize(){ |
157 | 159 |
getGroups(); |
158 | 160 |
getVersions(); |
161 |
getOwnerFullName(); |
|
159 | 162 |
DeferredCommand.addCommand(new IncrementalCommand() { |
160 | 163 |
|
161 | 164 |
@Override |
162 | 165 |
public boolean execute() { |
163 | 166 |
boolean res = canContinue(); |
164 | 167 |
if (res) { |
165 |
displayProperties(newImages); |
|
168 |
displayProperties(newImages, GSS.get().findUserFullName(userName));
|
|
166 | 169 |
return false; |
167 | 170 |
} |
168 | 171 |
return true; |
169 |
|
|
170 | 172 |
} |
171 | 173 |
|
172 | 174 |
}); |
175 |
|
|
173 | 176 |
} |
174 | 177 |
|
175 | 178 |
private boolean canContinue() { |
176 |
if (groups == null || versions == null) |
|
179 |
String userFullNameFromMap = GSS.get().findUserFullName(userName); |
|
180 |
if (groups == null || versions == null || userFullNameFromMap == null) |
|
177 | 181 |
return false; |
178 | 182 |
return true; |
179 | 183 |
} |
... | ... | |
184 | 188 |
* |
185 | 189 |
* @param propImages the images of all the possible properties dialogs |
186 | 190 |
*/ |
187 |
void displayProperties(final Images propImages) { |
|
191 |
void displayProperties(final Images propImages, final String _userName) {
|
|
188 | 192 |
if (GSS.get().getCurrentSelection() instanceof FolderResource) { |
189 | 193 |
FolderPropertiesDialog dlg = new FolderPropertiesDialog(propImages, false, groups); |
190 | 194 |
dlg.selectTab(tabToShow); |
191 | 195 |
dlg.center(); |
192 | 196 |
} else if (GSS.get().getCurrentSelection() instanceof FileResource) { |
193 |
FilePropertiesDialog dlg = new FilePropertiesDialog(propImages, groups, versions); |
|
197 |
FilePropertiesDialog dlg = new FilePropertiesDialog(propImages, groups, versions, _userName);
|
|
194 | 198 |
dlg.selectTab(tabToShow); |
195 | 199 |
dlg.center(); |
196 | 200 |
} |
... | ... | |
268 | 272 |
} else |
269 | 273 |
versions = new ArrayList<FileResource>(); |
270 | 274 |
} |
275 |
|
|
276 |
private void getOwnerFullName() { |
|
277 |
FileResource fileResource = (FileResource) GSS.get().getCurrentSelection(); |
|
278 |
userName = fileResource.getOwner(); |
|
279 |
GetUserCommand getUserCmd = new GetUserCommand(userName); |
|
280 |
getUserCmd.execute(); |
|
281 |
|
|
282 |
} |
|
283 |
|
|
271 | 284 |
} |
Also available in: Unified diff