diff --git a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/WorkspaceExplorerConstants.java b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/WorkspaceExplorerConstants.java index 64a6488..518de1d 100644 --- a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/WorkspaceExplorerConstants.java +++ b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/WorkspaceExplorerConstants.java @@ -12,6 +12,8 @@ public class WorkspaceExplorerConstants { public static final String WORKSPACE_EXPLORER_CAPTION = "Workspace Explorer"; + public static final String WORKSPACE_EXPLORER_SAVE_AS_CAPTION = "Workspace Explorer Save As..."; + public static final String HOME_LABEL = "Home"; public static final String WORKSPACE_MY_SPECIAL_FOLDERS_PATH = "/Workspace/MySpecialFolders"; diff --git a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/save/WorkspaceExplorerSaveDialog.java b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/save/WorkspaceExplorerSaveDialog.java index 5f1dd7d..893941d 100644 --- a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/save/WorkspaceExplorerSaveDialog.java +++ b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/save/WorkspaceExplorerSaveDialog.java @@ -99,6 +99,25 @@ public class WorkspaceExplorerSaveDialog extends Modal implements HasWorskpaceEx WorkspaceExplorerController.eventBus.fireEvent(new LoadRootEvent()); initDialog(captionTxt, fileName); } + + + /** + * Instantiates a new workspace explorer save dialog. + * + * @param fileName the file name + * @param showableTypes the showable types + */ + public WorkspaceExplorerSaveDialog(String fileName, List showableTypes) { + + if (showableTypes != null) { + ItemType[] itemsType = new ItemType[showableTypes.size()]; + itemsType = showableTypes.toArray(itemsType); + setShowableTypes(showableTypes.toArray(itemsType)); + } + + WorkspaceExplorerController.eventBus.fireEvent(new LoadRootEvent()); + initDialog(captionTxt, fileName); + } /** @@ -108,7 +127,7 @@ public class WorkspaceExplorerSaveDialog extends Modal implements HasWorskpaceEx * @param fileName the file name */ private void initDialog(String captionTxt, String fileName) { - this.captionTxt = (captionTxt == null || captionTxt.isEmpty()) ? WorkspaceExplorerConstants.WORKSPACE_EXPLORER_CAPTION: captionTxt; + this.captionTxt = (captionTxt == null || captionTxt.isEmpty()) ? WorkspaceExplorerConstants.WORKSPACE_EXPLORER_SAVE_AS_CAPTION: captionTxt; setAnimation(false); setCloseVisible(true); hide(false); @@ -179,7 +198,7 @@ public class WorkspaceExplorerSaveDialog extends Modal implements HasWorskpaceEx } /** - * + * Adds the handlers. */ private void addHandlers() { @@ -218,7 +237,6 @@ public class WorkspaceExplorerSaveDialog extends Modal implements HasWorskpaceEx * Sets the file name. * * @param txt the txt - * @param select the select */ private void setFileName(final String txt){ if(txt==null) @@ -240,7 +258,8 @@ public class WorkspaceExplorerSaveDialog extends Modal implements HasWorskpaceEx /** * Notify parent selected. * - * @param selected the selected + * @param parent the parent + * @param fileName the file name */ private void notifySaving(Item parent, String fileName) { @@ -303,6 +322,8 @@ public class WorkspaceExplorerSaveDialog extends Modal implements HasWorskpaceEx } /** + * Gets the save button. + * * @return the saveButton */ public Button getSaveButton() {