Added Expression Event

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event@91761 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-17 11:25:23 +00:00
parent 65993ed8c6
commit 5221092db2
10 changed files with 232 additions and 11 deletions

View File

@ -63,4 +63,13 @@ public class ChangeTableRequestEvent extends GwtEvent<ChangeTableRequestEvent.Ch
public void setTrId(TRId trId) {
this.trId = trId;
}
@Override
public String toString() {
return "ChangeTableRequestEvent [changeTableRequestType="
+ changeTableRequestType + ", trId=" + trId + "]";
}
}

View File

@ -0,0 +1,94 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ExpressionType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_ExpressionContainer;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HasHandlers;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ExpressionEvent extends GwtEvent<ExpressionEvent.ExpressionEventHandler> {
public static Type<ExpressionEventHandler> TYPE = new Type<ExpressionEventHandler>();
private ExpressionType expressionType;
private TRId trId;
private String columnName;
private C_ExpressionContainer c_ExpressionContainer;
public interface ExpressionEventHandler extends EventHandler {
void onExpression(ExpressionEvent event);
}
public interface HasExpressionEventHandler extends HasHandlers{
public HandlerRegistration addExpressionEventHandler(ExpressionEventHandler handler);
}
public ExpressionEvent(ExpressionType expressionType) {
this.expressionType = expressionType;
}
public ExpressionType getExpressionType() {
return expressionType;
}
@Override
protected void dispatch(ExpressionEventHandler handler) {
handler.onExpression(this);
}
@Override
public Type<ExpressionEventHandler> getAssociatedType() {
return TYPE;
}
public static Type<ExpressionEventHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source, ExpressionType expressionType) {
source.fireEvent(new ExpressionEvent(expressionType));
}
public TRId getTrId() {
return trId;
}
public void setTrId(TRId trId) {
this.trId = trId;
}
public String getColumnName() {
return columnName;
}
public void setColumnName(String columnName) {
this.columnName = columnName;
}
public C_ExpressionContainer getC_ExpressionContainer() {
return c_ExpressionContainer;
}
public void setC_ExpressionContainer(C_ExpressionContainer c_ExpressionContainer) {
this.c_ExpressionContainer = c_ExpressionContainer;
}
@Override
public String toString() {
return "ExpressionEvent [expressionType=" + expressionType + ", trId="
+ trId + ", columnName=" + columnName
+ ", c_ExpressionContainer=" + c_ExpressionContainer + "]";
}
}

View File

@ -75,6 +75,14 @@ public class GridHeaderColumnMenuItemEvent extends GwtEvent<GridHeaderColumnMenu
return operationId;
}
@Override
public String toString() {
return "GridHeaderColumnMenuItemEvent [itemType=" + itemType
+ ", columnSelected=" + columnSelected + ", operationId="
+ operationId + "]";
}
}

View File

@ -51,4 +51,12 @@ public class RibbonEvent extends GwtEvent<RibbonEvent.RibbonEventHandler> {
public static void fire(HasHandlers source, RibbonType ribbonType) {
source.fireEvent(new RibbonEvent(ribbonType));
}
@Override
public String toString() {
return "RibbonEvent [ribbonType=" + ribbonType + "]";
}
}

View File

@ -63,4 +63,13 @@ public class TasksMonitorEvent extends GwtEvent<TasksMonitorEvent.TasksMonitorEv
public void setTrId(TRId trId) {
this.trId = trId;
}
@Override
public String toString() {
return "TasksMonitorEvent [taskType=" + taskType + ", trId=" + trId
+ "]";
}
}

View File

@ -64,4 +64,13 @@ public class UIStateEvent extends GwtEvent<UIStateEvent.UIStateHandler> {
this.trId = trId;
}
@Override
public String toString() {
return "UIStateEvent [uiStateType=" + uiStateType + ", trId=" + trId
+ "]";
}
}

View File

@ -10,25 +10,27 @@ 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 WidgetRequestEvent extends GwtEvent<WidgetRequestEvent.WidgetRequestEventHandler> {
public class WidgetRequestEvent extends
GwtEvent<WidgetRequestEvent.WidgetRequestEventHandler> {
public static Type<WidgetRequestEventHandler> TYPE = new Type<WidgetRequestEventHandler>();
private WidgetRequestType widgetRequestType;
private TRId trId;
private String columnName;
public interface WidgetRequestEventHandler extends EventHandler {
void onWidgetRequest(WidgetRequestEvent event);
}
public interface HasWidgetRequestEventHandler extends HasHandlers{
public HandlerRegistration addWidgetRequestEventHandler(WidgetRequestEventHandler handler);
public interface HasWidgetRequestEventHandler extends HasHandlers {
public HandlerRegistration addWidgetRequestEventHandler(
WidgetRequestEventHandler handler);
}
public WidgetRequestEvent(WidgetRequestType closeType) {
this.widgetRequestType = closeType;
}
@ -51,10 +53,11 @@ public class WidgetRequestEvent extends GwtEvent<WidgetRequestEvent.WidgetReques
return TYPE;
}
public static void fire(HasHandlers source, WidgetRequestType widgetRequestType) {
public static void fire(HasHandlers source,
WidgetRequestType widgetRequestType) {
source.fireEvent(new WidgetRequestEvent(widgetRequestType));
}
public TRId getTrId() {
return trId;
}
@ -62,7 +65,7 @@ public class WidgetRequestEvent extends GwtEvent<WidgetRequestEvent.WidgetReques
public void setTrId(TRId trId) {
this.trId = trId;
}
public String getColumnName() {
return columnName;
}
@ -71,4 +74,10 @@ public class WidgetRequestEvent extends GwtEvent<WidgetRequestEvent.WidgetReques
this.columnName = columnName;
}
@Override
public String toString() {
return "WidgetRequestEvent [widgetRequestType=" + widgetRequestType
+ ", trId=" + trId + ", columnName=" + columnName + "]";
}
}

View File

@ -0,0 +1,13 @@
/**
*
*/
package org.gcube.portlets.user.td.widgetcommonevent.client.type;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* @Dec 9, 2013
*
*/
public enum ExpressionType {
CREATECOLUMNEXPRESSION;
}

View File

@ -0,0 +1,23 @@
package org.gcube.portlets.user.td.widgetcommonevent.shared.expression;
import java.io.Serializable;
public class C_Expression implements Serializable{
private static final long serialVersionUID = 7818512507606450235L;
protected String id="Expression";
public String getId() {
return id;
}
@Override
public String toString() {
return "Expression [id=" + id + "]";
}
}

View File

@ -0,0 +1,39 @@
package org.gcube.portlets.user.td.widgetcommonevent.shared.expression;
import java.io.Serializable;
public class C_ExpressionContainer implements Serializable {
private static final long serialVersionUID = -4021332410069520707L;
public enum Contains {
C_Expression, Rule;
}
protected Contains id;
protected C_Expression exp;
public Contains getId() {
return id;
}
public void setId(Contains id) {
this.id = id;
}
public C_Expression getExp() {
return exp;
}
public void setExp(C_Expression exp) {
this.exp = exp;
}
@Override
public String toString() {
return "C_ExpressionContainer [id=" + id + ", exp=" + exp + "]";
}
}