Revision dc275351 web_client/src/gr/grnet/pithos/web/client/FileContextMenu.java

b/web_client/src/gr/grnet/pithos/web/client/FileContextMenu.java
50 50
import com.google.gwt.resources.client.ClientBundle;
51 51
import com.google.gwt.resources.client.ImageResource;
52 52
import com.google.gwt.user.client.Command;
53
import com.google.gwt.user.client.Window;
53 54
import com.google.gwt.user.client.ui.AbstractImagePrototype;
54 55
import com.google.gwt.user.client.ui.MenuBar;
55 56
import com.google.gwt.user.client.ui.MenuItem;
......
179 180
	 *
180 181
	 * @param newImages the image bundle passed on by the parent object
181 182
	 */
182
	public FileContextMenu(final Pithos app, Images newImages, TreeView selectedTree, Folder selectedFolder, List<File> selectedFiles) {
183
	public FileContextMenu(final Pithos app, Images newImages, TreeView selectedTree, Folder selectedFolder, final List<File> selectedFiles) {
183 184
		// The popup's constructor's argument is a boolean specifying that it
184 185
		// auto-close itself when the user clicks outside of it.
185 186
		super(true);
......
240 241
        		contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(app, this, selectedFiles, images, 0)));
241 242

  
242 243
        }
243
        if (selectedFiles.size() == 1)
244
		    contextMenu.addItem(new MenuItem("<span><a class='hidden-link' href='" + app.getApiPath() + selectedFiles.get(0).getOwner() + selectedFiles.get(0).getUri() + "?X-Auth-Token=" + app.getToken() + "' target='_blank'>" + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download</a></span>", true, (Command) null));
244
	    contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.download()).getHTML() + "&nbsp;Download</span>", true, new Command() {
245
			
246
			@Override
247
			public void execute() {
248
				for (File f : selectedFiles)
249
					Window.open(app.getApiPath() + f.getOwner() + f.getUri() + "?X-Auth-Token=" + app.getToken(), "_blank", "");
250
			}
251
		}));
245 252

  
246 253
		add(contextMenu);
247 254
	}

Also available in: Unified diff