diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java b/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java index 5c0c759..ba05211 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java @@ -433,5 +433,8 @@ public interface Icons extends ClientBundle { */ @Source("icons/info.png") ImageResource information(); + + @Source("icons/datacataloguepublish.png") + ImageResource datacataloguepublish(); } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/Resources.java b/src/main/java/org/gcube/portlets/user/workspace/client/resources/Resources.java index 60de396..3429c3c 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/resources/Resources.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/resources/Resources.java @@ -78,6 +78,19 @@ public class Resources { return AbstractImagePrototype.create(ICONS.tex()); } + + + /** + * Gets the data catalogue publish. + * + * @return the data catalogue publish + */ + public static AbstractImagePrototype getIconDataCataloguePublish(){ + + return AbstractImagePrototype.create(ICONS.datacataloguepublish()); + } + + /** * Gets the icon postscript. * diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/datacataloguepublish.png b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/datacataloguepublish.png new file mode 100644 index 0000000..53070c6 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/datacataloguepublish.png differ diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java index 9ea2079..a4f164f 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java @@ -68,7 +68,7 @@ public class ContextMenuTree { * Instantiates a new context menu tree. */ public ContextMenuTree() { - this.contextMenu.setWidth(140); + this.contextMenu.setWidth(140); this.listSelectedItems = new ArrayList(); createContextMenu(); @@ -82,13 +82,13 @@ public class ContextMenuTree { //SPECIFIC OPERATION //Preview Image - MenuItem previewImage = new MenuItem(); + MenuItem previewImage = new MenuItem(); previewImage.setId(WorkspaceOperation.PREVIEW.getId()); - previewImage.setText(ConstantsExplorer.MESSAGE_PREVIEW); - previewImage.setIcon(Resources.getIconPreview()); + previewImage.setText(ConstantsExplorer.MESSAGE_PREVIEW); + previewImage.setIcon(Resources.getIconPreview()); - previewImage.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + previewImage.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { // FileModel selected = treePanel.getSelectionModel().getSelectedItem(); @@ -100,19 +100,18 @@ public class ContextMenuTree { //clearListSelectedItems(); } - }); - - contextMenu.add(previewImage); + }); + contextMenu.add(previewImage); //Open Url - MenuItem openUrl = new MenuItem(); + MenuItem openUrl = new MenuItem(); openUrl.setId(WorkspaceOperation.LINK.getId()); - openUrl.setText(ConstantsExplorer.MESSAGE_OPEN_URL); - openUrl.setIcon(Resources.getIconOpenUrl()); + openUrl.setText(ConstantsExplorer.MESSAGE_OPEN_URL); + openUrl.setIcon(Resources.getIconOpenUrl()); - openUrl.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + openUrl.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { FileModel selected = listSelectedItems.get(0); @@ -121,37 +120,35 @@ public class ContextMenuTree { } - } - }); - - contextMenu.add(openUrl); + } + }); + contextMenu.add(openUrl); //Open Report Template - MenuItem openReportTemplate = new MenuItem(); + MenuItem openReportTemplate = new MenuItem(); openReportTemplate.setId(WorkspaceOperation.OPEN_REPORT_TEMPLATE.getId()); - openReportTemplate.setText(ConstantsExplorer.MESSAGE_OPEN_REPORT_TEMPLATE); - openReportTemplate.setIcon(Resources.getIconShow()); + openReportTemplate.setText(ConstantsExplorer.MESSAGE_OPEN_REPORT_TEMPLATE); + openReportTemplate.setIcon(Resources.getIconShow()); - openReportTemplate.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + openReportTemplate.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { FileModel selected = listSelectedItems.get(0); if(selected!=null){ eventBus.fireEvent(new OpenReportsEvent(selected)); } - } - }); - - contextMenu.add(openReportTemplate); + } + }); + contextMenu.add(openReportTemplate); //Open Report Template - MenuItem openReport = new MenuItem(); + MenuItem openReport = new MenuItem(); openReport.setId(WorkspaceOperation.OPEN_REPORT.getId()); - openReport.setText(ConstantsExplorer.MESSAGE_OPEN_REPORT); - openReport.setIcon(Resources.getIconShow()); + openReport.setText(ConstantsExplorer.MESSAGE_OPEN_REPORT); + openReport.setIcon(Resources.getIconShow()); openReport.addSelectionListener(new SelectionListener() { public void componentSelected(MenuEvent ce) { @@ -167,67 +164,65 @@ public class ContextMenuTree { contextMenu.add(openReport); contextMenu.add(new SeparatorMenuItem()); - //END SPECIFIC OPERATION - - MenuItem mnGetInfo = new MenuItem(); + MenuItem mnGetInfo = new MenuItem(); mnGetInfo.setId(WorkspaceOperation.GET_INFO.getId()); - mnGetInfo.setText(ConstantsExplorer.MESSAGE_GET_INFO); - mnGetInfo.setIcon(Resources.getIconInfo()); + mnGetInfo.setText(ConstantsExplorer.MESSAGE_GET_INFO); + mnGetInfo.setIcon(Resources.getIconInfo()); - mnGetInfo.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + mnGetInfo.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (FileModel sel : listSelectedItems) { - eventBus.fireEvent(new GetInfoEvent(sel)); - } - } - }); + for (FileModel sel : listSelectedItems) { + eventBus.fireEvent(new GetInfoEvent(sel)); + } + } + }); - contextMenu.add(mnGetInfo); + contextMenu.add(mnGetInfo); //SHARE LINK - MenuItem mnGetLink = new MenuItem(); + MenuItem mnGetLink = new MenuItem(); mnGetLink.setId(WorkspaceOperation.SHARE_LINK.getId()); - mnGetLink.setText(ConstantsExplorer.MESSAGE_SHARE_LINK); - mnGetLink.setIcon(Resources.getIconShareLink()); + mnGetLink.setText(ConstantsExplorer.MESSAGE_SHARE_LINK); + mnGetLink.setIcon(Resources.getIconShareLink()); - mnGetLink.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + mnGetLink.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (FileModel sel : listSelectedItems) { - eventBus.fireEvent(new GetShareLinkEvent(sel)); - } - } - }); + for (FileModel sel : listSelectedItems) { + eventBus.fireEvent(new GetShareLinkEvent(sel)); + } + } + }); - contextMenu.add(mnGetLink); + contextMenu.add(mnGetLink); //PUBLIC LINK - MenuItem mnPublicLink = new MenuItem(); + MenuItem mnPublicLink = new MenuItem(); mnPublicLink.setId(WorkspaceOperation.PUBLIC_LINK.getId()); - mnPublicLink.setText(ConstantsExplorer.MESSAGE_PUBLIC_LINK); - mnPublicLink.setIcon(Resources.getIconPublicLink()); + mnPublicLink.setText(ConstantsExplorer.MESSAGE_PUBLIC_LINK); + mnPublicLink.setIcon(Resources.getIconPublicLink()); - mnPublicLink.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + mnPublicLink.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (FileModel sel : listSelectedItems) { - eventBus.fireEvent(new GetPublicLinkEvent(sel)); - } - } - }); + for (FileModel sel : listSelectedItems) { + eventBus.fireEvent(new GetPublicLinkEvent(sel)); + } + } + }); - contextMenu.add(mnPublicLink); + contextMenu.add(mnPublicLink); contextMenu.add(new SeparatorMenuItem()); MenuItem mnHistory = new MenuItem(); mnHistory.setIcon(Resources.getIconHistory()); mnHistory.setId(WorkspaceOperation.HISTORY.getId()); - mnHistory.setText(ConstantsExplorer.HISTORY); + mnHistory.setText(ConstantsExplorer.HISTORY); mnHistory.addSelectionListener(new SelectionListener() { @@ -242,13 +237,13 @@ public class ContextMenuTree { } } }); - contextMenu.add(mnHistory); + contextMenu.add(mnHistory); //ACCOUNTING READ mnRead = new MenuItem(); mnRead.setIcon(Resources.getIconRead()); mnRead.setId(WorkspaceOperation.ACCREAD.getId()); - mnRead.setText(ConstantsExplorer.ACCREAD); + mnRead.setText(ConstantsExplorer.ACCREAD); mnRead.addSelectionListener(new SelectionListener() { @@ -265,14 +260,14 @@ public class ContextMenuTree { }); //COMMENTED AT 29/08/2013 - // contextMenu.add(mnRead); + // contextMenu.add(mnRead); contextMenu.add(new SeparatorMenuItem()); - MenuItem insertFolder = new MenuItem(); + MenuItem insertFolder = new MenuItem(); insertFolder.setId(WorkspaceOperation.INSERT_FOLDER.getId()); - insertFolder.setText(ConstantsExplorer.MESSAGE_ADD_FOLDER); - insertFolder.setIcon(Resources.getIconAddFolder()); + insertFolder.setText(ConstantsExplorer.MESSAGE_ADD_FOLDER); + insertFolder.setIcon(Resources.getIconAddFolder()); insertFolder.addSelectionListener(new SelectionListener() { public void componentSelected(MenuEvent ce) { @@ -286,13 +281,13 @@ public class ContextMenuTree { } }); - contextMenu.add(insertFolder); + contextMenu.add(insertFolder); - MenuItem createShareFolder = new MenuItem(); + MenuItem createShareFolder = new MenuItem(); createShareFolder.setId(WorkspaceOperation.INSERT_SHARED_FOLDER.getId()); - createShareFolder.setText(ConstantsExplorer.MESSAGE_ADD_SHARED_FOLDER); - createShareFolder.setIcon(Resources.getIconSharedFolder()); + createShareFolder.setText(ConstantsExplorer.MESSAGE_ADD_SHARED_FOLDER); + createShareFolder.setIcon(Resources.getIconSharedFolder()); createShareFolder.addSelectionListener(new SelectionListener() { public void componentSelected(MenuEvent ce) { @@ -304,19 +299,19 @@ public class ContextMenuTree { } } }); - contextMenu.add(createShareFolder); + contextMenu.add(createShareFolder); // publish on data catalogue - MenuItem publishOnDataCatalogue = new MenuItem(); + MenuItem publishOnDataCatalogue = new MenuItem(); publishOnDataCatalogue.setId(WorkspaceOperation.PUBLISH_ON_DATA_CATALOGUE.getId()); - publishOnDataCatalogue.setText(ConstantsExplorer.MESSAGE_DATA_CATALOGUE_PUBLISH); - publishOnDataCatalogue.setIcon(Resources.getIconPublicLink()); // TODO change icon + publishOnDataCatalogue.setText(ConstantsExplorer.MESSAGE_DATA_CATALOGUE_PUBLISH); + publishOnDataCatalogue.setIcon(Resources.getIconDataCataloguePublish()); // TODO change icon publishOnDataCatalogue.addSelectionListener(new SelectionListener() { public void componentSelected(MenuEvent ce) { FileModel sourceFileModel = listSelectedItems.get(0); - String folderId = sourceFileModel.getIdentifier(); + String folderId = sourceFileModel.getIdentifier(); if (sourceFileModel != null) { eventBus.fireEvent(new PublishOnDataCatalogueEvent(folderId)); @@ -324,13 +319,13 @@ public class ContextMenuTree { } }); publishOnDataCatalogue.setVisible(false); - contextMenu.add(publishOnDataCatalogue); + contextMenu.add(publishOnDataCatalogue); - MenuItem editPermissions = new MenuItem(); + MenuItem editPermissions = new MenuItem(); editPermissions.setId(WorkspaceOperation.EDIT_PERMISSIONS.getId()); - editPermissions.setText(ConstantsExplorer.EDIT_PERMISSIONS); - editPermissions.setIcon(Resources.getIconPermissions()); + editPermissions.setText(ConstantsExplorer.EDIT_PERMISSIONS); + editPermissions.setIcon(Resources.getIconPermissions()); editPermissions.addSelectionListener(new SelectionListener() { public void componentSelected(MenuEvent ce) { @@ -343,17 +338,16 @@ public class ContextMenuTree { } }); - contextMenu.add(editPermissions); - + contextMenu.add(editPermissions); //Add Url - MenuItem addUrl = new MenuItem(); + MenuItem addUrl = new MenuItem(); addUrl.setId(WorkspaceOperation.ADD_URL.getId()); - addUrl.setText(ConstantsExplorer.MESSAGE_ADD_URL); - addUrl.setIcon(Resources.getIconAddUrl()); + addUrl.setText(ConstantsExplorer.MESSAGE_ADD_URL); + addUrl.setIcon(Resources.getIconAddUrl()); - addUrl.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + addUrl.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { FileModel selected = listSelectedItems.get(0); @@ -363,28 +357,28 @@ public class ContextMenuTree { eventBus.fireEvent(new CreateUrlEvent(null, parent)); } - } - }); + } + }); - contextMenu.add(addUrl); + contextMenu.add(addUrl); contextMenu.add(new SeparatorMenuItem()); MenuItem copy = new MenuItem(); copy.setId(WorkspaceOperation.COPY.getId()); - copy.setText(ConstantsExplorer.COPYITEM); - copy.setIcon(Resources.getIconCopy()); + copy.setText(ConstantsExplorer.COPYITEM); + copy.setIcon(Resources.getIconCopy()); - copy.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + copy.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { // //HERE THE MULTI-SELECTION IS NOT ENABLED - // for (FileModel target : listSelectedItems) { + // for (FileModel target : listSelectedItems) { // if(target.getIdentifier()!=null){ // CopyAndPaste.copy(target.getIdentifier())); // eventBus.fireEvent(new CopytemEvent(target.getIdentifier())); // } // } - // + // List ids = FileModelUtils.convertFileModelsToIds(listSelectedItems); if(ids.size()>0){ @@ -392,20 +386,20 @@ public class ContextMenuTree { eventBus.fireEvent(new CopytemEvent(ids)); } - } - }); + } + }); - contextMenu.add(copy); + contextMenu.add(copy); MenuItem paste = new MenuItem(); paste.setId(WorkspaceOperation.PASTE.getId()); - paste.setText(ConstantsExplorer.PASTEITEM); - paste.setIcon(Resources.getIconPaste()); + paste.setText(ConstantsExplorer.PASTEITEM); + paste.setIcon(Resources.getIconPaste()); - paste.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + paste.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (FileModel target : listSelectedItems) { + for (FileModel target : listSelectedItems) { FileModel parentTarget = getDirectoryOrParent(target); if(parentTarget!=null){ @@ -416,258 +410,255 @@ public class ContextMenuTree { } } - } - }); + } + }); - contextMenu.add(paste); + contextMenu.add(paste); MenuItem share = new MenuItem(); share.setId(WorkspaceOperation.SHARE.getId()); - share.setText("Share"); - share.setIcon(Resources.getIconShareFolder()); + share.setText("Share"); + share.setIcon(Resources.getIconShareFolder()); - share.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + share.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { FileModel sourceFileModel = listSelectedItems.get(0); if (sourceFileModel != null) { - eventBus.fireEvent(new CreateSharedFolderEvent(sourceFileModel, sourceFileModel.getParentFileModel(),false)); + eventBus.fireEvent(new CreateSharedFolderEvent(sourceFileModel, sourceFileModel.getParentFileModel(),false)); } - } - }); + } + }); - contextMenu.add(share); + contextMenu.add(share); MenuItem unShare = new MenuItem(); unShare.setId(WorkspaceOperation.UNSHARE.getId()); - unShare.setText("UnShare"); - unShare.setIcon(Resources.getIconUnShareUser()); + unShare.setText("UnShare"); + unShare.setIcon(Resources.getIconUnShareUser()); - unShare.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { - for (FileModel target : listSelectedItems) { + unShare.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { + for (FileModel target : listSelectedItems) { if(target.getIdentifier()!=null){ eventBus.fireEvent( new UnShareFolderEvent(target)); } } - } - }); + } + }); - contextMenu.add(unShare); + contextMenu.add(unShare); MenuItem rename = new MenuItem(); rename.setId(WorkspaceOperation.RENAME.getId()); - rename.setText("Rename Item"); - rename.setIcon(Resources.getIconRenameItem()); + rename.setText("Rename Item"); + rename.setIcon(Resources.getIconRenameItem()); - rename.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + rename.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (FileModel target : listSelectedItems) { + for (FileModel target : listSelectedItems) { if(target.getIdentifier()!=null){ eventBus.fireEvent(new RenameItemEvent(target)); } } - } - }); + } + }); - contextMenu.add(rename); + contextMenu.add(rename); - MenuItem remove = new MenuItem(); + MenuItem remove = new MenuItem(); remove.setId(WorkspaceOperation.REMOVE.getId()); - remove.setText(ConstantsExplorer.MESSAGE_DELETE_ITEM); - remove.setIcon(Resources.getIconDeleteItem()); + remove.setText(ConstantsExplorer.MESSAGE_DELETE_ITEM); + remove.setIcon(Resources.getIconDeleteItem()); - remove.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + remove.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (FileModel sel : listSelectedItems) { + for (FileModel sel : listSelectedItems) { eventBus.fireEvent(new DeleteItemEvent(sel)); - } + } - } - }); + } + }); - contextMenu.add(remove); + contextMenu.add(remove); contextMenu.add(new SeparatorMenuItem()); - - MenuItem show = new MenuItem(); + MenuItem show = new MenuItem(); show.setId(WorkspaceOperation.SHOW.getId()); - show.setText(ConstantsExplorer.MESSAGE_SHOW); - show.setIcon(Resources.getIconShow()); + show.setText(ConstantsExplorer.MESSAGE_SHOW); + show.setIcon(Resources.getIconShow()); - show.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + show.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (final FileModel sel : listSelectedItems) { + for (final FileModel sel : listSelectedItems) { eventBus.fireEvent(new FileDownloadEvent(sel.getIdentifier(), sel.getName(), DownloadType.SHOW)); - } - } - }); + } + } + }); - contextMenu.add(show); + contextMenu.add(show); - - - MenuItem viewWebDav = new MenuItem(); + MenuItem viewWebDav = new MenuItem(); viewWebDav.setId(WorkspaceOperation.WEBDAV_URL.getId()); - viewWebDav.setText(ConstantsExplorer.MESSAGE_WEBDAV_URL); - viewWebDav.setIcon(Resources.getIconUrlWebDav()); + viewWebDav.setText(ConstantsExplorer.MESSAGE_WEBDAV_URL); + viewWebDav.setIcon(Resources.getIconUrlWebDav()); - viewWebDav.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + viewWebDav.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { for (final FileModel sel : listSelectedItems) eventBus.fireEvent(new WebDavUrlEvent(sel.getIdentifier())); - } - }); + } + }); - contextMenu.add(viewWebDav); + contextMenu.add(viewWebDav); - MenuItem sendTo = new MenuItem(); + MenuItem sendTo = new MenuItem(); sendTo.setId(WorkspaceOperation.SENDTO.getId()); - sendTo.setText(ConstantsExplorer.MESSAGE_SEND_TO); - sendTo.setIcon(Resources.getIconSendTo()); + sendTo.setText(ConstantsExplorer.MESSAGE_SEND_TO); + sendTo.setIcon(Resources.getIconSendTo()); - sendTo.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + sendTo.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { if(listSelectedItems!=null && listSelectedItems.size()>0) eventBus.fireEvent(new SendMessageEvent(listSelectedItems)); - } - }); + } + }); - contextMenu.add(sendTo); + contextMenu.add(sendTo); - MenuItem upload = new MenuItem(); + MenuItem upload = new MenuItem(); upload.setId(WorkspaceOperation.UPLOAD_FILE.getId()); - upload.setText(ConstantsExplorer.MESSAGE_UPLOAD_FILE); - upload.setIcon(Resources.getIconFileUpload()); + upload.setText(ConstantsExplorer.MESSAGE_UPLOAD_FILE); + upload.setIcon(Resources.getIconFileUpload()); - upload.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + upload.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (final FileModel sel : listSelectedItems) { + for (final FileModel sel : listSelectedItems) { FileModel parent = getDirectoryOrParent(sel); eventBus.fireEvent(new FileUploadEvent(parent, WS_UPLOAD_TYPE.File)); } - } - }); + } + }); - contextMenu.add(upload); + contextMenu.add(upload); - MenuItem uploadArchive = new MenuItem(); + MenuItem uploadArchive = new MenuItem(); uploadArchive.setId(WorkspaceOperation.UPLOAD_ARCHIVE.getId()); uploadArchive.setText(ConstantsExplorer.MESSAGE_UPLOAD_ARCHIVE); - uploadArchive.setToolTip("Upload a zip archive into workspace"); - uploadArchive.setIcon(Resources.getIconArchiveUpload()); + uploadArchive.setToolTip("Upload a zip archive into workspace"); + uploadArchive.setIcon(Resources.getIconArchiveUpload()); - uploadArchive.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + uploadArchive.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (FileModel sel : listSelectedItems) { + for (FileModel sel : listSelectedItems) { FileModel parent = getDirectoryOrParent(sel); eventBus.fireEvent(new FileUploadEvent(parent, WS_UPLOAD_TYPE.Archive)); - } + } - } - }); + } + }); - contextMenu.add(uploadArchive); + contextMenu.add(uploadArchive); - MenuItem downloadArchive = new MenuItem(); + MenuItem downloadArchive = new MenuItem(); downloadArchive.setId(WorkspaceOperation.DOWNLOAD.getId()); - downloadArchive.setText(ConstantsExplorer.MESSAGE_DOWNLOAD_ITEM); - downloadArchive.setIcon(Resources.getIconDownload()); + downloadArchive.setText(ConstantsExplorer.MESSAGE_DOWNLOAD_ITEM); + downloadArchive.setIcon(Resources.getIconDownload()); - downloadArchive.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + downloadArchive.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (FileModel sel : listSelectedItems) { + for (FileModel sel : listSelectedItems) { eventBus.fireEvent(new FileDownloadEvent(sel.getIdentifier(), sel.getName(), DownloadType.DOWNLOAD)); - } - } - }); + } + } + }); - contextMenu.add(downloadArchive); + contextMenu.add(downloadArchive); contextMenu.add(new SeparatorMenuItem()); MenuItem changePermission = new MenuItem(); changePermission.setId(WorkspaceOperation.VRE_CHANGE_PERIMISSIONS.getId()); - changePermission.setText("Change Permission"); - changePermission.setIcon(Resources.getIconWriteAll()); + changePermission.setText("Change Permission"); + changePermission.setIcon(Resources.getIconWriteAll()); - changePermission.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { - for (FileModel target : listSelectedItems) { + changePermission.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { + for (FileModel target : listSelectedItems) { if(target.getIdentifier()!=null){ eventBus.fireEvent(new VRESettingPermissionEvent(target)); } } - } + } }); - contextMenu.add(changePermission); + contextMenu.add(changePermission); contextMenu.add(new SeparatorMenuItem()); - MenuItem addAdministrator = new MenuItem(); + MenuItem addAdministrator = new MenuItem(); // addAdministrator.setId(WorkspaceOperation.ADD_ADMINISTRATOR.getId()); - addAdministrator.setText("Manage Administrator/s"); - addAdministrator.setIcon(Resources.getIconManageAdministrator()); + addAdministrator.setText("Manage Administrator/s"); + addAdministrator.setIcon(Resources.getIconManageAdministrator()); - addAdministrator.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + addAdministrator.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (FileModel sel : listSelectedItems) { - eventBus.fireEvent(new AddAdministratorEvent(sel)); - } - } - }); + for (FileModel sel : listSelectedItems) { + eventBus.fireEvent(new AddAdministratorEvent(sel)); + } + } + }); - // contextMenu.add(addAdministrator); + // contextMenu.add(addAdministrator); - MenuItem refreshItem = new MenuItem(); + MenuItem refreshItem = new MenuItem(); refreshItem.setId(WorkspaceOperation.REFRESH_FOLDER.getId()); - refreshItem.setText(ConstantsExplorer.MESSAGE_REFRESH_FOLDER); - refreshItem.setIcon(Resources.getIconRefresh()); + refreshItem.setText(ConstantsExplorer.MESSAGE_REFRESH_FOLDER); + refreshItem.setIcon(Resources.getIconRefresh()); - refreshItem.addSelectionListener(new SelectionListener() { - public void componentSelected(MenuEvent ce) { + refreshItem.addSelectionListener(new SelectionListener() { + public void componentSelected(MenuEvent ce) { - for (FileModel sel : listSelectedItems) { - eventBus.fireEvent(new RefreshFolderEvent(sel, true, false, false)); - } - } - }); + for (FileModel sel : listSelectedItems) { + eventBus.fireEvent(new RefreshFolderEvent(sel, true, false, false)); + } + } + }); - contextMenu.add(refreshItem); + contextMenu.add(refreshItem); contextMenu.add(new SeparatorMenuItem()); } @@ -677,14 +668,14 @@ public class ContextMenuTree { */ public void clearListSelectedItems() { listSelectedItems.clear(); - } + } /** * Sets the hide sharing. */ public void setHideSharing() { - hideSharing = true; + hideSharing = true; } /** @@ -748,7 +739,7 @@ public class ContextMenuTree { contextMenu.getItemByItemId(WorkspaceOperation.INSERT_FOLDER.getId()).setVisible(false); //set invisible create folder contextMenu.getItemByItemId(WorkspaceOperation.INSERT_SHARED_FOLDER.getId()).setVisible(false); //set invisible create shared folder contextMenu.getItemByItemId(WorkspaceOperation.WEBDAV_URL.getId()).setVisible(false); //set invisible webdav url - contextMenu.getItemByItemId(WorkspaceOperation.UPLOAD_FILE.getId()).setVisible(false); //set invisible upload file + contextMenu.getItemByItemId(WorkspaceOperation.UPLOAD_FILE.getId()).setVisible(false); //set invisible upload file contextMenu.getItemByItemId(WorkspaceOperation.UPLOAD_ARCHIVE.getId()).setVisible(false); //set invisible upload archive contextMenu.getItemByItemId(WorkspaceOperation.ADD_URL.getId()).setVisible(false); //set invisible add url contextMenu.getItemByItemId(WorkspaceOperation.REFRESH_FOLDER.getId()).setVisible(false); //set invisible refresh @@ -782,8 +773,8 @@ public class ContextMenuTree { contextMenu.getItemByItemId(WorkspaceOperation.INSERT_FOLDER.getId()).setVisible(true); //insert folder contextMenu.getItemByItemId(WorkspaceOperation.INSERT_SHARED_FOLDER.getId()).setVisible(true); //insert shared folder contextMenu.getItemByItemId(WorkspaceOperation.UPLOAD_FILE.getId()).setVisible(true); - contextMenu.getItemByItemId(WorkspaceOperation.UPLOAD_ARCHIVE.getId()).setVisible(true); - contextMenu.getItemByItemId(WorkspaceOperation.ADD_URL.getId()).setVisible(true); + contextMenu.getItemByItemId(WorkspaceOperation.UPLOAD_ARCHIVE.getId()).setVisible(true); + contextMenu.getItemByItemId(WorkspaceOperation.ADD_URL.getId()).setVisible(true); contextMenu.getItemByItemId(WorkspaceOperation.SENDTO.getId()).setVisible(true); //send to contextMenu.getItemByItemId(WorkspaceOperation.DOWNLOAD.getId()).setVisible(true); //DOWNLOAD contextMenu.getItemByItemId(WorkspaceOperation.COPY.getId()).setEnabled(true); //DOWNLOAD @@ -807,7 +798,7 @@ public class ContextMenuTree { if(selectedItem.isShared()){ //SHARE LINK ON SHARED ITEM - contextMenu.getItemByItemId(WorkspaceOperation.SHARE_LINK.getId()).setVisible(true); + contextMenu.getItemByItemId(WorkspaceOperation.SHARE_LINK.getId()).setVisible(true); } //IS VRE FOLDER or SPECIAL FOLDER? @@ -820,7 +811,7 @@ public class ContextMenuTree { contextMenu.getItemByItemId(WorkspaceOperation.REMOVE.getId()).setVisible(false); //REMOVE contextMenu.getItemByItemId(WorkspaceOperation.REFRESH_FOLDER.getId()).setVisible(true); //REFRESH_FOLDER - //ADDED 14/03/2014 + //ADDED 14/03/2014 if(selectedItem.isVreFolder()){ contextMenu.getItemByItemId(WorkspaceOperation.VRE_CHANGE_PERIMISSIONS.getId()).setVisible(true); //REFRESH_FOLDER if(CutCopyAndPaste.getCopiedIdsFilesModel()!=null) @@ -830,14 +821,14 @@ public class ContextMenuTree { // if(selectedItem.isVreFolder() && CutCopyAndPaste.getCopiedIdsFilesModel()!=null) // contextMenu.getItemByItemId(WorkspaceOperation.PASTE.getId()).setEnabled(true); //enable paste button else if(selectedItem.isSpecialFolder()){ - contextMenu.getItemByItemId(WorkspaceOperation.COPY.getId()).setEnabled(false); + contextMenu.getItemByItemId(WorkspaceOperation.COPY.getId()).setEnabled(false); contextMenu.getItemByItemId(WorkspaceOperation.PASTE.getId()).setEnabled(false); contextMenu.getItemByItemId(WorkspaceOperation.UPLOAD_FILE.getId()).setVisible(false); - contextMenu.getItemByItemId(WorkspaceOperation.UPLOAD_ARCHIVE.getId()).setVisible(false); - contextMenu.getItemByItemId(WorkspaceOperation.ADD_URL.getId()).setVisible(false); + contextMenu.getItemByItemId(WorkspaceOperation.UPLOAD_ARCHIVE.getId()).setVisible(false); + contextMenu.getItemByItemId(WorkspaceOperation.ADD_URL.getId()).setVisible(false); contextMenu.getItemByItemId(WorkspaceOperation.SENDTO.getId()).setVisible(false); contextMenu.getItemByItemId(WorkspaceOperation.INSERT_FOLDER.getId()).setVisible(false); //insert folder - contextMenu.getItemByItemId(WorkspaceOperation.DOWNLOAD.getId()).setVisible(false); + contextMenu.getItemByItemId(WorkspaceOperation.DOWNLOAD.getId()).setVisible(false); } return; @@ -871,7 +862,7 @@ public class ContextMenuTree { GWT.log("HideSharing = " + hideSharing); //not supported in tree Reports - if (hideSharing) { + if (hideSharing) { contextMenu.getItemByItemId(WorkspaceOperation.SHARE.getId()).setVisible(false); //SHARE contextMenu.getItemByItemId(WorkspaceOperation.INSERT_SHARED_FOLDER.getId()).setVisible(false); //insert shared folder contextMenu.getItemByItemId(WorkspaceOperation.UNSHARE.getId()).setVisible(false); //UNSHARE @@ -882,48 +873,48 @@ public class ContextMenuTree { switch(selectedItem.getGXTFolderItemType()){ - case EXTERNAL_IMAGE: + case EXTERNAL_IMAGE: contextMenu.getItemByItemId(WorkspaceOperation.PREVIEW.getId()).setVisible(true); contextMenu.getItemByItemId(WorkspaceOperation.PUBLIC_LINK.getId()).setVisible(true); //public link break; - case EXTERNAL_FILE: + case EXTERNAL_FILE: contextMenu.getItemByItemId(WorkspaceOperation.PUBLIC_LINK.getId()).setVisible(true); //public link break; - case EXTERNAL_PDF_FILE: + case EXTERNAL_PDF_FILE: contextMenu.getItemByItemId(WorkspaceOperation.PUBLIC_LINK.getId()).setVisible(true); //public link break; - case EXTERNAL_URL: + case EXTERNAL_URL: contextMenu.getItemByItemId(WorkspaceOperation.LINK.getId()).setVisible(true); break; - case REPORT_TEMPLATE: - contextMenu.getItemByItemId(WorkspaceOperation.OPEN_REPORT_TEMPLATE.getId()).setVisible(true); + case REPORT_TEMPLATE: + contextMenu.getItemByItemId(WorkspaceOperation.OPEN_REPORT_TEMPLATE.getId()).setVisible(true); break; - case REPORT: + case REPORT: contextMenu.getItemByItemId(WorkspaceOperation.OPEN_REPORT.getId()).setVisible(true); break; - case QUERY: + case QUERY: break; - case TIME_SERIES: + case TIME_SERIES: break; - // case AQUAMAPS_ITEM: + // case AQUAMAPS_ITEM: // break; - case PDF_DOCUMENT: + case PDF_DOCUMENT: break; - case IMAGE_DOCUMENT: + case IMAGE_DOCUMENT: contextMenu.getItemByItemId(WorkspaceOperation.PREVIEW.getId()).setVisible(true); break; - case DOCUMENT: + case DOCUMENT: break; - case URL_DOCUMENT: + case URL_DOCUMENT: contextMenu.getItemByItemId(WorkspaceOperation.LINK.getId()).setVisible(true); break; - case METADATA: + case METADATA: break; - case WORKFLOW_REPORT: + case WORKFLOW_REPORT: break; - case WORKFLOW_TEMPLATE: + case WORKFLOW_TEMPLATE: break; - case EXTERNAL_RESOURCE_LINK: + case EXTERNAL_RESOURCE_LINK: break; default: