Revision e5a2f3bd src/gr/ebs/gss/client/EditMenu.java
b/src/gr/ebs/gss/client/EditMenu.java | ||
---|---|---|
36 | 36 |
import com.google.gwt.user.client.Command; |
37 | 37 |
import com.google.gwt.user.client.ui.AbstractImagePrototype; |
38 | 38 |
import com.google.gwt.user.client.ui.MenuBar; |
39 |
import com.google.gwt.user.client.ui.MenuItem; |
|
39 | 40 |
import com.google.gwt.user.client.ui.PopupPanel; |
40 | 41 |
|
41 | 42 |
/** |
... | ... | |
187 | 188 |
pasteLabel = "Paste Files"; |
188 | 189 |
else if(GSS.get().getClipboard().getItem().getFolderResource() != null) |
189 | 190 |
pasteLabel = "Paste Folder"; |
190 |
contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.cut()).getHTML() + " "+cutLabel+"</span>", true, new CutCommand(this)).setVisible(cutcopyVisible); |
|
191 |
contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.copy()).getHTML() + " "+copyLabel+"</span>", true, new CopyCommand(this)).setVisible(cutcopyVisible); |
|
191 |
MenuItem cutItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.cut()).getHTML() + " "+cutLabel+"</span>", true, new CutCommand(this)); |
|
192 |
cutItem.getElement().setId("topMenu.editMenu.cut"); |
|
193 |
contextMenu.addItem(cutItem).setVisible(cutcopyVisible); |
|
194 |
|
|
195 |
MenuItem copyItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.copy()).getHTML() + " "+copyLabel+"</span>", true, new CopyCommand(this)); |
|
196 |
copyItem.getElement().setId("topMenu.editMenu.copy"); |
|
197 |
contextMenu.addItem(copyItem).setVisible(cutcopyVisible); |
|
198 |
|
|
199 |
MenuItem pasteItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.paste()).getHTML() + " "+pasteLabel+"</span>", true, new PasteCommand(this)); |
|
200 |
pasteItem.getElement().setId("topMenu.editMenu.paste"); |
|
192 | 201 |
if (GSS.get().getClipboard().getItem() != null) |
193 |
if(GSS.get().isUserListVisible() && GSS.get().getClipboard().getItem().getUser() == null) |
|
194 |
contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.paste()).getHTML() + " "+pasteLabel+"</span>", true, new PasteCommand(this)); |
|
202 |
if(GSS.get().isUserListVisible() && GSS.get().getClipboard().getItem().getUser() == null){ |
|
203 |
contextMenu.addItem(pasteItem); |
|
204 |
} |
|
195 | 205 |
else if(!GSS.get().isUserListVisible() && GSS.get().getClipboard().getItem().getUser() != null){ |
196 | 206 |
//do not show paste |
197 | 207 |
} |
198 |
else if (GSS.get().getFolders().getCurrent().getUserObject() instanceof FolderResource) |
|
199 |
contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.paste()).getHTML() + " "+pasteLabel+"</span>", true, new PasteCommand(this)); |
|
200 |
contextMenu .addItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + " Move to Trash</span>", true, new ToTrashCommand(this)) |
|
208 |
else if (GSS.get().getFolders().getCurrent().getUserObject() instanceof FolderResource){ |
|
209 |
contextMenu.addItem(pasteItem); |
|
210 |
} |
|
211 |
MenuItem moveToTrashItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + " Move to Trash</span>", true, new ToTrashCommand(this)); |
|
212 |
moveToTrashItem.getElement().setId("topMenu.editMenu.moveToTrash"); |
|
213 |
contextMenu .addItem(moveToTrashItem) |
|
201 | 214 |
.setVisible(cutcopyVisible); |
202 |
contextMenu .addItem("<span>" + AbstractImagePrototype.create(images.delete()).getHTML() + " Delete</span>", true, new DeleteCommand(this, images)) |
|
215 |
|
|
216 |
MenuItem deleteItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.delete()).getHTML() + " Delete</span>", true, new DeleteCommand(this, images)); |
|
217 |
deleteItem.getElement().setId("topMenu.editMenu.delete"); |
|
218 |
contextMenu .addItem(deleteItem) |
|
203 | 219 |
.setVisible(cutcopyVisible); |
204 |
contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.selectAll()).getHTML() + " Select All</span>", true, selectAllCommand); |
|
205 |
contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.unselectAll()).getHTML() + " Unselect All</span>", true, unselectAllCommand); |
|
220 |
|
|
221 |
MenuItem selectAllItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.selectAll()).getHTML() + " Select All</span>", true, selectAllCommand); |
|
222 |
selectAllItem.getElement().setId("topMenu.editMenu.selectAll"); |
|
223 |
contextMenu.addItem(selectAllItem); |
|
224 |
|
|
225 |
MenuItem unSelectAllItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.unselectAll()).getHTML() + " Unselect All</span>", true, unselectAllCommand); |
|
226 |
unSelectAllItem.getElement().setId("topMenu.editMenu.unSelectAll"); |
|
227 |
contextMenu.addItem(unSelectAllItem); |
|
206 | 228 |
return contextMenu; |
207 | 229 |
} |
208 | 230 |
|
Also available in: Unified diff