209: TDM - Show the resources through a ListView widget
Task-Url: https://support.d4science.org/issues/209 Updated Resources git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-mainbox-widget@115276 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b605765544
commit
d10dacdaf7
|
@ -6,6 +6,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
|
|||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.UIStateType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.DataViewType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -108,8 +109,7 @@ public class MainBoxEntry implements EntryPoint {
|
|||
startInDevMode(mainBoxPanel);
|
||||
|
||||
|
||||
UIStateEvent uiStateEvent1 = new UIStateEvent(UIStateType.TR_OPEN);
|
||||
uiStateEvent1.setTrId(trId);
|
||||
UIStateEvent uiStateEvent1 = new UIStateEvent(UIStateType.TR_OPEN, trId, DataViewType.GRID);
|
||||
eventBus.fireEvent(uiStateEvent1);
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent;
|
|||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.UIStateType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.DataView;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.DataViewType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.TabularResourceDataView;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -110,18 +109,7 @@ public class MainBoxPanel extends ContentPanel {
|
|||
if (dataView == null || dataView.getDataViewType() == null) {
|
||||
return;
|
||||
}
|
||||
DataViewType dataViewType = dataView.getDataViewType();
|
||||
|
||||
switch (dataViewType) {
|
||||
case TABULARRESOURCE:
|
||||
doTabularResourceTab(event);
|
||||
break;
|
||||
case TABLE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void doTabularResourceTab(DataViewRequestEvent event) {
|
||||
|
|
|
@ -64,17 +64,35 @@ public class TDXTabPanel extends TabPanel {
|
|||
public void open(TabularResourceDataView dataView) {
|
||||
gridPanel.open(dataView);
|
||||
resourcesPanel.open(dataView.getTrId());
|
||||
forceLayout();
|
||||
setCurrentWidgetActive(dataView);
|
||||
|
||||
}
|
||||
|
||||
public void update(TabularResourceDataView dataView) {
|
||||
gridPanel.update(dataView);
|
||||
resourcesPanel.open(dataView.getTrId());
|
||||
forceLayout();
|
||||
setCurrentWidgetActive(dataView);
|
||||
|
||||
}
|
||||
|
||||
protected void setCurrentWidgetActive(TabularResourceDataView dataView) {
|
||||
if(dataView!=null&&dataView.getDataViewType()!=null){
|
||||
switch (dataView.getDataViewType()) {
|
||||
case RESOURCES:
|
||||
setActiveWidget(resourcesPanel);
|
||||
break;
|
||||
case GRID:
|
||||
setActiveWidget(gridPanel);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean isValidDataViewRequest(
|
||||
TabularResourceDataView dataViewRequest) {
|
||||
return gridPanel.isValidDataViewRequest(dataViewRequest);
|
||||
|
|
Loading…
Reference in New Issue