bug fixing: on select for Workspace Explorer Paginated
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@151159 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
fabb7aa51d
commit
bd622a42f0
|
@ -188,6 +188,7 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
||||||
* @throws Exception the exception
|
* @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) throws Exception{
|
||||||
|
GWT.log("Using base init");
|
||||||
setParameters(folderId, folderName, showProperties, filter);
|
setParameters(folderId, folderName, showProperties, filter);
|
||||||
bindEvents();
|
bindEvents();
|
||||||
wsExplorer = new WorkspaceExplorer(eventBus, filter, showableTypes, selectableTypes, showProperties, showGcubeInfo, sortByColumn, new DISPLAY_FIELD[]{DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME,DISPLAY_FIELD.CREATION_DATE});
|
wsExplorer = new WorkspaceExplorer(eventBus, filter, showableTypes, selectableTypes, showProperties, showGcubeInfo, sortByColumn, new DISPLAY_FIELD[]{DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME,DISPLAY_FIELD.CREATION_DATE});
|
||||||
|
@ -431,8 +432,8 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
||||||
* @return true, if successful
|
* @return true, if successful
|
||||||
*/
|
*/
|
||||||
public boolean itemIsSelectable(Item item){
|
public boolean itemIsSelectable(Item item){
|
||||||
GWT.log("Selectable type: "+wsExplorer.getSelectableTypes());
|
//GWT.log("Selectable type: "+wsExplorer.getSelectableTypes());
|
||||||
GWT.log("item: "+item);
|
//GWT.log("item: "+item);
|
||||||
if (item!=null){
|
if (item!=null){
|
||||||
boolean selectable = wsExplorer.getSelectableTypes().contains(item.getType());
|
boolean selectable = wsExplorer.getSelectableTypes().contains(item.getType());
|
||||||
return selectable?true:false;
|
return selectable?true:false;
|
||||||
|
|
|
@ -29,7 +29,7 @@ import com.google.gwt.user.client.ui.DockPanel;
|
||||||
*/
|
*/
|
||||||
public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResourcesExplorerPanel {
|
public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResourcesExplorerPanel {
|
||||||
|
|
||||||
protected WorkspaceExplorerPaginated wsExplorer;
|
protected WorkspaceExplorerPaginated wsExplorerPaginated;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -101,13 +101,16 @@ public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResources
|
||||||
*/
|
*/
|
||||||
@Override
|
@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) throws Exception{
|
||||||
|
GWT.log("Using paginated init");
|
||||||
setParameters(folderId, folderName, showProperties, filter);
|
setParameters(folderId, folderName, showProperties, filter);
|
||||||
bindEvents();
|
bindEvents();
|
||||||
wsExplorer = 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, new DISPLAY_FIELD[]{DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME, DISPLAY_FIELD.CREATION_DATE});
|
||||||
wsExplorer.initPagination(ITEMS_PER_PAGE);
|
wsExplorerPaginated.initPagination(ITEMS_PER_PAGE);
|
||||||
|
//wsExplorer.initTable(dataProvider);
|
||||||
Item item = new Item(folderId, folderName, true);
|
Item item = new Item(folderId, folderName, true);
|
||||||
wsExplorer.loadFolder(item, true, ITEM_START_INDEX, ITEMS_PER_PAGE, true);
|
wsExplorerPaginated.loadFolder(item, true, ITEM_START_INDEX, ITEMS_PER_PAGE, true);
|
||||||
initPanel("");
|
initPanel("");
|
||||||
|
super.wsExplorer = wsExplorerPaginated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,7 +118,7 @@ public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResources
|
||||||
* Purge cache. It performs cache purge.
|
* Purge cache. It performs cache purge.
|
||||||
*/
|
*/
|
||||||
public void purgeCache(){
|
public void purgeCache(){
|
||||||
wsExplorer.purgeCache();
|
wsExplorerPaginated.purgeCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -124,7 +127,7 @@ public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResources
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
public void hardRefresh() throws Exception{
|
public void hardRefresh() throws Exception{
|
||||||
wsExplorer.purgeCache();
|
wsExplorerPaginated.purgeCache();
|
||||||
super.refreshRootFolderView();
|
super.refreshRootFolderView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +142,7 @@ public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResources
|
||||||
setTitle(super.captionTxt);
|
setTitle(super.captionTxt);
|
||||||
add(breadcrumbs, DockPanel.NORTH);
|
add(breadcrumbs, DockPanel.NORTH);
|
||||||
setCellHeight(breadcrumbs, offsetBreadcrumb+"px");
|
setCellHeight(breadcrumbs, offsetBreadcrumb+"px");
|
||||||
centerScrollable.add(wsExplorer.getPagerPanel());
|
centerScrollable.add(wsExplorerPaginated.getPagerPanel());
|
||||||
add(centerScrollable, DockPanel.CENTER);
|
add(centerScrollable, DockPanel.CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,15 +156,14 @@ public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResources
|
||||||
@Override
|
@Override
|
||||||
public <T> void onClick(final ClickItemEvent<T> clickItemEvent) {
|
public <T> void onClick(final ClickItemEvent<T> clickItemEvent) {
|
||||||
isSelect = false;
|
isSelect = false;
|
||||||
Item item = wsExplorer.getItemSelected();
|
Item item = wsExplorerPaginated.getItemSelected();
|
||||||
|
|
||||||
//Return if item is not selectable
|
//Return if item is not selectable
|
||||||
if(!itemIsSelectable(item)){
|
if(!itemIsSelectable(item)){
|
||||||
notifyNotValidSelection();
|
notifyNotValidSelection();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
notifySelectedItem(wsExplorer.getItemSelected());
|
notifySelectedItem(wsExplorerPaginated.getItemSelected());
|
||||||
isSelect = true;
|
isSelect = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -177,7 +179,7 @@ public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResources
|
||||||
Item item = (Item) loadFolderEvent.getTargetItem();
|
Item item = (Item) loadFolderEvent.getTargetItem();
|
||||||
if(item.isFolder()){
|
if(item.isFolder()){
|
||||||
try {
|
try {
|
||||||
wsExplorer.loadFolder(item, true, ITEM_START_INDEX, ITEMS_PER_PAGE, true);
|
wsExplorerPaginated.loadFolder(item, true, ITEM_START_INDEX, ITEMS_PER_PAGE, true);
|
||||||
loadParentBreadcrumbByItemId(item.getId(), true);
|
loadParentBreadcrumbByItemId(item.getId(), true);
|
||||||
clearMoreInfo();
|
clearMoreInfo();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -84,6 +84,7 @@ public class WorkspaceExplorer implements ShowableTypes, SelectableTypes, Folder
|
||||||
this.sortByColumn = sortByColumn;
|
this.sortByColumn = sortByColumn;
|
||||||
this.displayProperties = displayProperties;
|
this.displayProperties = displayProperties;
|
||||||
this.explorerPanel = new ScrollPanel();
|
this.explorerPanel = new ScrollPanel();
|
||||||
|
GWT.log("Base constructor "+WorkspaceExplorer.class.getSimpleName() + " "+ selectableTypes);
|
||||||
setShowableTypes(showableTypes);
|
setShowableTypes(showableTypes);
|
||||||
setSelectableTypes(selectableTypes);
|
setSelectableTypes(selectableTypes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -384,8 +384,6 @@ public class WorkspaceExplorerPaginated extends WorkspaceExplorer{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Purge cache.
|
* Purge cache.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue