Revision 5d18aa82 src/gr/grnet/pithos/web/client/ToolsMenu.java

b/src/gr/grnet/pithos/web/client/ToolsMenu.java
100 100
	        Boolean[] permissions = folder.getPermissions().get(app.getUsername());
101 101
	    	boolean canWrite = folder.getOwner().equals(app.getUsername()) || (permissions!= null && permissions[1] != null && permissions[1]);
102 102
	    	boolean isFolderTreeSelected = selectedTree.equals(app.getFolderTreeView());
103
	    	boolean isMysharedTreeSelected = app.isMySharedSelected();
103 104
	    	
104 105
	        if (!folder.isInTrash()) {
105 106
	        	if (canWrite) {
......
119 120
			        }
120 121
	        	}
121 122
	
122
        		MenuItem copy = null;
123
	        	if (files != null && !files.isEmpty())
124
	        		copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy files</span>", true, new CopyCommand(app, this, files));
125
	        	else if (isFolderTreeSelected && !folder.isContainer())
126
	        		copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy folder</span>", true, new CopyCommand(app, this, folder));
127
	        	if (copy != null) {
128
	        		contextMenu.addItem(copy);
129
		        	empty = false;
123
	        	if (!isMysharedTreeSelected) {
124
	        		MenuItem copy = null;
125
		        	if (files != null && !files.isEmpty())
126
		        		copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy files</span>", true, new CopyCommand(app, this, files));
127
		        	else if (isFolderTreeSelected && !folder.isContainer())
128
		        		copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy folder</span>", true, new CopyCommand(app, this, folder));
129
		        	if (copy != null) {
130
		        		contextMenu.addItem(copy);
131
			        	empty = false;
132
		        	}
130 133
	        	}
131 134
		
132 135
	        	if (canWrite) {
133
			        if (!app.getClipboard().isEmpty()) {
136
			        if (!isMysharedTreeSelected && !app.getClipboard().isEmpty()) {
134 137
			        	Object item = app.getClipboard().getItem();
135 138
			        	boolean showPaste = false;
136 139
			        	if (item instanceof List) {
......
174 177
				        	contextMenu.addItem(delete);
175 178
				        	empty = false;
176 179
				        }
177
				
180
				    }
181
				    if (isFolderTreeSelected || isMysharedTreeSelected) {
178 182
				        if (files != null && files.size() == 1) {
179 183
				        	contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;File properties</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.PROPERTIES)));
180 184
				        	contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.group()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.PERMISSIONS)));
181 185
				        	contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.internet()).getHTML() + "&nbsp;Publish</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.PUBLISH)));
182
				        	contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.versions()).getHTML() + "&nbsp;Versions</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.VERSIONS)));
186
				        	if (!isMysharedTreeSelected)
187
				        		contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.versions()).getHTML() + "&nbsp;Versions</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.VERSIONS)));
183 188
				        	empty = false;
184 189
				        }
185 190
				        else if (!folder.isContainer()) {

Also available in: Unified diff