Added RowRaw

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event@95685 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-14 15:08:53 +00:00
parent 98ce257e7b
commit bb1eb2132b
2 changed files with 80 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import org.gcube.portlets.user.td.widgetcommonevent.shared.CellData;
import org.gcube.portlets.user.td.widgetcommonevent.shared.GridOperationId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.grid.model.RowRaw;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
@ -23,6 +24,7 @@ public class GridContextMenuItemEvent extends GwtEvent<GridContextMenuItemEvent.
public static Type<GridContextMenuItemEventHandler> TYPE = new Type<GridContextMenuItemEventHandler>();
private GridOperationId gridOperationId;
private ArrayList<String> rows;
private RowRaw rowRaw;
private CellData cellData;
public interface GridContextMenuItemEventHandler extends EventHandler {
@ -34,8 +36,8 @@ public class GridContextMenuItemEvent extends GwtEvent<GridContextMenuItemEvent.
}
public static void fire(HasHandlers source, GridOperationId gridOperationId, ArrayList<String> rows) {
source.fireEvent(new GridContextMenuItemEvent(gridOperationId,rows));
public static void fire(HasHandlers source, GridContextMenuItemEvent gridContextMenuItemEvent) {
source.fireEvent(gridContextMenuItemEvent);
}
public GridContextMenuItemEvent(GridOperationId gridOperationId,ArrayList<String> rows) {
@ -47,7 +49,11 @@ public class GridContextMenuItemEvent extends GwtEvent<GridContextMenuItemEvent.
this.gridOperationId=gridOperationId;
this.cellData=cellData;
}
public GridContextMenuItemEvent(GridOperationId gridOperationId, RowRaw rowRaw) {
this.gridOperationId=gridOperationId;
this.rowRaw=rowRaw;
}
public static Type<GridContextMenuItemEventHandler> getType() {
return TYPE;
@ -91,14 +97,28 @@ public class GridContextMenuItemEvent extends GwtEvent<GridContextMenuItemEvent.
public void setCellData(CellData cellData) {
this.cellData = cellData;
}
public RowRaw getRowRaw() {
return rowRaw;
}
public void setRowRaw(RowRaw rowRaw) {
this.rowRaw = rowRaw;
}
@Override
public String toString() {
return "GridContextMenuItemEvent [gridOperationId=" + gridOperationId
+ ", rows=" + rows + ", cellData=" + cellData + "]";
+ ", rows=" + rows + ", rowRaw=" + rowRaw + ", cellData="
+ cellData + "]";
}

View File

@ -0,0 +1,56 @@
package org.gcube.portlets.user.td.widgetcommonevent.shared.grid.model;
import java.io.Serializable;
import java.util.Map;
/**
*
*
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class RowRaw implements Serializable {
private static final long serialVersionUID = -1603145847134978854L;
protected Map<String, String> rowRaw;
protected String rowId;
public RowRaw() {
}
/**
*
* @param rowId row identify
* @param rowRaw A map from columnLocalId to value as String
*/
public RowRaw(String rowId, Map<String, String> rowRaw) {
this.rowId = rowId;
this.rowRaw = rowRaw;
}
public Map<String, String> getRowRaw() {
return rowRaw;
}
public void setRowRaw(Map<String, String> rowRaw) {
this.rowRaw = rowRaw;
}
public String getRowId() {
return rowId;
}
public void setRowId(String rowId) {
this.rowId = rowId;
}
@Override
public String toString() {
return "RowRaw [rowId=" + rowId + ", rowRaw=" + rowRaw + "]";
}
}