changed constructors

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@173260 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-10-12 08:20:31 +00:00
parent 7add6a9070
commit 21e2c587b9
3 changed files with 73 additions and 18 deletions

View File

@ -203,6 +203,33 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
}
/**
* Instantiates a new workspace explorer panel.
*
* @param folderId the folder id
* @param showOnlyFolders the show only folders
* @param showProperties the show properties - show the input properties as column/s
* @param filter the filter - get only workspace item/s with input key=value like GcubeProperty
* @param showGcubeInfo the show gcube info - if true shows all the properties associated to a file (or a gcube item) by opening a popup window when clicking on the item
* @param sortByColumn the sort by column
* @param displayFields the display fields
* @throws Exception the exception
*/
public WorkspaceResourcesExplorerPanel(String folderId, boolean showOnlyFolders, List<String> showProperties, FilterCriteria filter, boolean showGcubeInfo, DISPLAY_FIELD sortByColumn, DISPLAY_FIELD... displayFields) throws Exception {
if(showOnlyFolders){
ItemType[] itemsType = new ItemType[4];
itemsType[0] = ItemType.FOLDER;
itemsType[1] = ItemType.PRIVATE_FOLDER;
itemsType[2] = ItemType.SHARED_FOLDER;
itemsType[3] = ItemType.VRE_FOLDER;
initExplorer(folderId, "", itemsType, itemsType, showProperties, filter, showGcubeInfo, sortByColumn, displayFields);
}else{
initExplorer(folderId, "", ItemType.values(), ItemType.values(), showProperties, filter, showGcubeInfo, sortByColumn, displayFields);
}
}
/**
* Inits the explorer.
*
@ -214,13 +241,20 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
* @param filter the filter
* @param showGcubeInfo the show gcube info
* @param sortByColumn the sort by column
* @param displayFields the display fields
* @throws Exception the exception
*/
protected void initExplorer(String folderId, String folderName, ItemType[] selectableTypes, ItemType[] showableTypes, List<String> showProperties, FilterCriteria filter, boolean showGcubeInfo, DISPLAY_FIELD sortByColumn) throws Exception{
protected void initExplorer(String folderId, String folderName, ItemType[] selectableTypes, ItemType[] showableTypes, List<String> showProperties, FilterCriteria filter, boolean showGcubeInfo, DISPLAY_FIELD sortByColumn, DISPLAY_FIELD... displayFields) throws Exception{
GWT.log("Using base init");
setParameters(folderId, folderName, showProperties, filter);
bindEvents();
wsExplorer = new WorkspaceExplorer(eventBus, filter, showableTypes, selectableTypes, showProperties, showGcubeInfo, sortByColumn, new DISPLAY_FIELD[]{DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME,DISPLAY_FIELD.CREATION_DATE});
DISPLAY_FIELD[] showTheFields;
if(displayFields==null || displayFields.length==0)
showTheFields = new DISPLAY_FIELD[]{DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME,DISPLAY_FIELD.CREATION_DATE};
else
showTheFields = displayFields;
wsExplorer = new WorkspaceExplorer(eventBus, filter, showableTypes, selectableTypes, showProperties, showGcubeInfo, sortByColumn, showTheFields);
wsExplorer.initTable(new ListDataProvider<Item>());
Item item = new Item(folderId, folderName, true);
wsExplorer.loadFolder(item, true, -1, -1, false);

View File

@ -118,11 +118,11 @@ public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResources
* @throws Exception the exception
*/
@Override
protected void initExplorer(String folderId, String folderName, ItemType[] selectableTypes, ItemType[] showableTypes, List<String> showProperties, FilterCriteria filter, boolean showGcubeInfo, DISPLAY_FIELD sortByColumn) throws Exception{
protected void initExplorer(String folderId, String folderName, ItemType[] selectableTypes, ItemType[] showableTypes, List<String> showProperties, FilterCriteria filter, boolean showGcubeInfo, DISPLAY_FIELD sortByColumn, DISPLAY_FIELD... displayFields) throws Exception{
GWT.log("Using paginated init");
setParameters(folderId, folderName, showProperties, filter);
bindEvents();
wsExplorerPaginated = new WorkspaceExplorerPaginated(eventBus, filter, showableTypes, selectableTypes, showProperties, showGcubeInfo, sortByColumn, new DISPLAY_FIELD[]{DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME, DISPLAY_FIELD.CREATION_DATE});
wsExplorerPaginated = new WorkspaceExplorerPaginated(eventBus, filter, showableTypes, selectableTypes, showProperties, showGcubeInfo, sortByColumn, displayFields);
wsExplorerPaginated.initPagination(ITEMS_PER_PAGE);
//wsExplorer.initTable(dataProvider);
Item item = new Item(folderId, folderName, true);

View File

@ -141,6 +141,27 @@ public class WorkspaceExplorerSelectPanel extends ScrollPanel implements HasWors
loadExplorer(captionTxt, null);
}
/**
* Instantiates a new workspace explorer select panel.
*
* @param captionTxt the tool-tip of the panel
* @param showOnlyFolders the show only folders
* @param initFromFolderId the init from folder id
*/
public WorkspaceExplorerSelectPanel(String captionTxt, boolean showOnlyFolders, String baseFolderId) {
controller = new WorkspaceExplorerController(WorkspaceExplorerConstants.AUTO);
if(showOnlyFolders){
ItemType[] itemsType = new ItemType[4];
itemsType[0] = ItemType.FOLDER;
itemsType[1] = ItemType.PRIVATE_FOLDER;
itemsType[2] = ItemType.SHARED_FOLDER;
itemsType[3] = ItemType.VRE_FOLDER;
setSelectableTypes(itemsType);
setShowableTypes(itemsType);
}
loadExplorer(captionTxt, baseFolderId);
}
/**
* Instantiates a new workspace explorer select panel.