Revision 7260b946
b/src/gr/grnet/pithos/web/client/FileContextMenu.java | ||
---|---|---|
238 | 238 |
|
239 | 239 |
if (selectedFolder != null && !selectedFolder.isInTrash()) { |
240 | 240 |
if (isFolderTreeSelected && selectedFiles.size() == 1) |
241 |
contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties</span>", true, new PropertiesCommand(app, this, selectedFiles, images, 0)));
|
|
241 |
contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties</span>", true, new PropertiesCommand(app, this, selectedFiles, 0))); |
|
242 | 242 |
|
243 | 243 |
} |
244 | 244 |
contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download</span>", true, new Command() { |
b/src/gr/grnet/pithos/web/client/FolderContextMenu.java | ||
---|---|---|
134 | 134 |
MenuItem delete = new MenuItem("<span id = 'folderContextMenu.delete'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + " Delete</span>", true, new DeleteCommand(app, this, folder, MessagePanel.images)); |
135 | 135 |
contextMenu.addItem(delete); |
136 | 136 |
|
137 |
MenuItem properties = new MenuItem("<span id = 'folderContextMenu.properties'>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties</span>", true, new PropertiesCommand(app, this, folder, newImages, 0));
|
|
137 |
MenuItem properties = new MenuItem("<span id = 'folderContextMenu.properties'>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties</span>", true, new PropertiesCommand(app, this, folder, 0)); |
|
138 | 138 |
contextMenu.addItem(properties); |
139 | 139 |
} |
140 | 140 |
} |
b/src/gr/grnet/pithos/web/client/Pithos.java | ||
---|---|---|
35 | 35 |
package gr.grnet.pithos.web.client; |
36 | 36 |
|
37 | 37 |
import gr.grnet.pithos.web.client.commands.NewFolderCommand; |
38 |
import gr.grnet.pithos.web.client.commands.PropertiesCommand; |
|
38 | 39 |
import gr.grnet.pithos.web.client.commands.UploadFileCommand; |
39 | 40 |
import gr.grnet.pithos.web.client.foldertree.AccountResource; |
40 | 41 |
import gr.grnet.pithos.web.client.foldertree.File; |
... | ... | |
347 | 348 |
}); |
348 | 349 |
toolbar.add(newFolderButton); |
349 | 350 |
|
351 |
Anchor shareFolderButton = new Anchor("<span class='ico'></span><span class='title'>Share folder</span>", true); |
|
352 |
shareFolderButton.getElement().setId("sharefolder-button"); |
|
353 |
shareFolderButton.addStyleName("pithos-toolbarItem"); |
|
354 |
shareFolderButton.addClickHandler(new ClickHandler() { |
|
355 |
|
|
356 |
@Override |
|
357 |
public void onClick(@SuppressWarnings("unused") ClickEvent event) { |
|
358 |
Folder folder = getSelectedTree().getSelection(); |
|
359 |
if (folder != null) { |
|
360 |
Boolean[] permissions = folder.getPermissions().get(getUsername()); |
|
361 |
boolean canWrite = folder.getOwner().equals(getUsername()) || (permissions!= null && permissions[1] != null && permissions[1]); |
|
362 |
boolean isFolderTreeSelected = selectedTree.equals(getFolderTreeView()); |
|
363 |
|
|
364 |
if (!folder.isInTrash() && canWrite && isFolderTreeSelected && !folder.isContainer()) |
|
365 |
new PropertiesCommand(Pithos.this, null, folder, 1).execute(); |
|
366 |
} |
|
367 |
} |
|
368 |
}); |
|
369 |
toolbar.add(shareFolderButton); |
|
370 |
|
|
350 | 371 |
refreshButton = new Anchor("<span class='ico'></span><span class='title'>Refresh</span>", true); |
351 | 372 |
refreshButton.getElement().setId("refresh-button"); |
352 | 373 |
refreshButton.addStyleName("pithos-toolbarItem"); |
b/src/gr/grnet/pithos/web/client/ToolsMenu.java | ||
---|---|---|
168 | 168 |
|
169 | 169 |
MenuItem properties = null; |
170 | 170 |
if (files != null && files.size() == 1) |
171 |
properties = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " File properties</span>", true, new PropertiesCommand(app, this, files, images, 0));
|
|
171 |
properties = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " File properties</span>", true, new PropertiesCommand(app, this, files, 0)); |
|
172 | 172 |
else if (!folder.isContainer()) |
173 |
properties = new MenuItem("<span id = 'folderContextMenu.properties'>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Folder properties</span>", true, new PropertiesCommand(app, this, folder, newImages, 0));
|
|
173 |
properties = new MenuItem("<span id = 'folderContextMenu.properties'>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Folder properties</span>", true, new PropertiesCommand(app, this, folder, 0)); |
|
174 | 174 |
if (properties != null) |
175 | 175 |
contextMenu.addItem(properties); |
176 | 176 |
} |
b/src/gr/grnet/pithos/web/client/commands/PropertiesCommand.java | ||
---|---|---|
54 | 54 |
*/ |
55 | 55 |
public class PropertiesCommand implements Command { |
56 | 56 |
|
57 |
final FileContextMenu.Images newImages; |
|
58 |
|
|
59 | 57 |
private PopupPanel containerPanel; |
60 | 58 |
|
61 | 59 |
private int tabToShow = 0; |
... | ... | |
69 | 67 |
* @param _newImages the images of all the possible delete dialogs |
70 | 68 |
* @param _tab the tab to switch to |
71 | 69 |
*/ |
72 |
public PropertiesCommand(Pithos _app, PopupPanel _containerPanel, Object _resource, final FileContextMenu.Images _newImages, int _tab) {
|
|
70 |
public PropertiesCommand(Pithos _app, PopupPanel _containerPanel, Object _resource, int _tab) { |
|
73 | 71 |
containerPanel = _containerPanel; |
74 |
newImages = _newImages; |
|
75 | 72 |
tabToShow = _tab; |
76 | 73 |
resource = _resource; |
77 | 74 |
app = _app; |
b/src/gr/grnet/pithos/web/public/pithos.css | ||
---|---|---|
493 | 493 |
background-image: url(images/folder_new.png); |
494 | 494 |
} |
495 | 495 |
|
496 |
#shareFolder-button span.ico { |
|
497 |
background-image: url(images/myshared22.png); |
|
498 |
} |
|
499 |
|
|
496 | 500 |
/*move background from inner to centerinner to wrap action buttons too*/ |
497 | 501 |
.dialogMiddleCenterInner.dialogContent { |
498 | 502 |
background: url(images/white50.png); |
Also available in: Unified diff