209: TDM - Show the resources through a ListView widget

Task-Url: https://support.d4science.org/issues/209

Updated UI behaviour

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event@115281 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-06-09 17:07:57 +00:00
parent 8ea9ab9fa6
commit 7f9ca08068
3 changed files with 32 additions and 20 deletions

View File

@ -2,6 +2,7 @@ package org.gcube.portlets.user.td.widgetcommonevent.client.event;
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 com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
@ -10,8 +11,8 @@ import com.google.gwt.event.shared.HasHandlers;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class UIStateEvent extends GwtEvent<UIStateEvent.UIStateHandler> {
@ -19,23 +20,32 @@ public class UIStateEvent extends GwtEvent<UIStateEvent.UIStateHandler> {
public static Type<UIStateHandler> TYPE = new Type<UIStateHandler>();
private UIStateType uiStateType;
private TRId trId;
private DataViewType dataViewType;
public interface UIStateHandler extends EventHandler {
void onUIState(UIStateEvent event);
}
public interface HasUIStateHandler extends HasHandlers{
public interface HasUIStateHandler extends HasHandlers {
public HandlerRegistration addUIStateHandler(UIStateHandler handler);
}
public UIStateEvent(UIStateType uiStateType) {
this.uiStateType = uiStateType;
this.trId=null;
this.dataViewType=DataViewType.GRID;
}
public UIStateEvent(UIStateType uiStateType, TRId trId, DataViewType dataViewType) {
this.uiStateType = uiStateType;
this.trId=trId;
this.dataViewType=dataViewType;
}
public UIStateType getUIStateType() {
return uiStateType;
}
@Override
protected void dispatch(UIStateHandler handler) {
handler.onUIState(this);
@ -50,12 +60,10 @@ public class UIStateEvent extends GwtEvent<UIStateEvent.UIStateHandler> {
return TYPE;
}
public static void fire(HasHandlers source, UIStateType uiStateType) {
source.fireEvent(new UIStateEvent(uiStateType));
public static void fire(HasHandlers source, UIStateEvent uiStateEvent) {
source.fireEvent(uiStateEvent);
}
public TRId getTrId() {
return trId;
}
@ -64,13 +72,18 @@ public class UIStateEvent extends GwtEvent<UIStateEvent.UIStateHandler> {
this.trId = trId;
}
public DataViewType getDataViewType() {
return dataViewType;
}
public void setDataViewType(DataViewType dataViewType) {
this.dataViewType = dataViewType;
}
@Override
public String toString() {
return "UIStateEvent [uiStateType=" + uiStateType + ", trId=" + trId
+ "]";
+ ", dataViewType=" + dataViewType + "]";
}
}

View File

@ -7,9 +7,8 @@ package org.gcube.portlets.user.td.widgetcommonevent.shared.dataview;
*
*/
public enum DataViewType {
TABULARRESOURCE("TabularResource"),
MAP("Map"),
TABLE("Table");
GRID("Grid"),
RESOURCES("Resources");
/**
* @param text

View File

@ -18,20 +18,20 @@ public class TabularResourceDataView extends DataView {
public TabularResourceDataView() {
super();
dataViewType = DataViewType.TABULARRESOURCE;
dataViewType = DataViewType.GRID;
}
public TabularResourceDataView(TRId trId) {
super();
dataViewType = DataViewType.TABULARRESOURCE;
dataViewType = DataViewType.GRID;
this.trId = trId;
this.tabName = null;
}
public TabularResourceDataView(TRId trId, String tabName) {
super();
dataViewType = DataViewType.TABULARRESOURCE;
dataViewType = DataViewType.GRID;
this.trId = trId;
this.tabName = tabName;
}