Added Initial Common Event

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event@85370 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2013-11-12 14:47:21 +00:00
parent 3e49149749
commit 0b857e66ae
13 changed files with 337 additions and 1 deletions

View File

@ -17,7 +17,7 @@
<version>1.0.0-SNAPSHOT</version>
<name>tabular-data-widget-common-event</name>
<description>tabular-data-widget-common-event </description>
<description>tabular-data-widget-common-event contains events that are common to all widgets</description>
<scm>
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event</url>

View File

@ -0,0 +1,44 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.CloseTabularResourceType;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HasHandlers;
public class CloseTabularResourceEvent extends GwtEvent<CloseTabularResourceEvent.CloseTabularResourceHandler> {
public static Type<CloseTabularResourceHandler> TYPE = new Type<CloseTabularResourceHandler>();
private CloseTabularResourceType closeType;
public interface CloseTabularResourceHandler extends EventHandler {
void onCloseTabularResource(CloseTabularResourceEvent event);
}
public CloseTabularResourceEvent(CloseTabularResourceType closeType) {
this.closeType = closeType;
}
public CloseTabularResourceType getCloseType() {
return closeType;
}
@Override
protected void dispatch(CloseTabularResourceHandler handler) {
handler.onCloseTabularResource(this);
}
@Override
public Type<CloseTabularResourceHandler> getAssociatedType() {
return TYPE;
}
public static Type<CloseTabularResourceHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source, CloseTabularResourceType closeType) {
source.fireEvent(new CloseTabularResourceEvent(closeType));
}
}

View File

@ -0,0 +1,44 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.EventHandler;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ExportTableType;
import com.google.gwt.event.shared.HasHandlers;
public class ExportTableEvent extends GwtEvent<ExportTableEvent.ExportTableHandler> {
public static Type<ExportTableHandler> TYPE = new Type<ExportTableHandler>();
private ExportTableType exportType;
public interface ExportTableHandler extends EventHandler {
void onExportTable(ExportTableEvent event);
}
public ExportTableEvent(ExportTableType exportType) {
this.exportType = exportType;
}
public ExportTableType getExportType() {
return exportType;
}
@Override
protected void dispatch(ExportTableHandler handler) {
handler.onExportTable(this);
}
@Override
public Type<ExportTableHandler> getAssociatedType() {
return TYPE;
}
public static Type<ExportTableHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source, ExportTableType exportType) {
source.fireEvent(new ExportTableEvent(exportType));
}
}

View File

@ -0,0 +1,44 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.EventHandler;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ImportTableType;
import com.google.gwt.event.shared.HasHandlers;
public class ImportTableEvent extends GwtEvent<ImportTableEvent.ImportTableHandler> {
public static Type<ImportTableHandler> TYPE = new Type<ImportTableHandler>();
private ImportTableType importType;
public interface ImportTableHandler extends EventHandler {
void onImportTable(ImportTableEvent event);
}
public ImportTableEvent(ImportTableType importType) {
this.importType = importType;
}
public ImportTableType getImportType() {
return importType;
}
@Override
protected void dispatch(ImportTableHandler handler) {
handler.onImportTable(this);
}
@Override
public Type<ImportTableHandler> getAssociatedType() {
return TYPE;
}
public static Type<ImportTableHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source, ImportTableType importType) {
source.fireEvent(new ImportTableEvent(importType));
}
}

View File

@ -0,0 +1,44 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.OpenFunctionalityType;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HasHandlers;
public class OpenFunctionalityEvent extends GwtEvent<OpenFunctionalityEvent.OpenFunctionalityHandler> {
public static Type<OpenFunctionalityHandler> TYPE = new Type<OpenFunctionalityHandler>();
private OpenFunctionalityType openFunctionalityType;
public interface OpenFunctionalityHandler extends EventHandler {
void onOpenFunctionality(OpenFunctionalityEvent event);
}
public OpenFunctionalityEvent(OpenFunctionalityType openFunctionalityType) {
this.openFunctionalityType = openFunctionalityType;
}
public OpenFunctionalityType getOpenFunctionalityType() {
return openFunctionalityType;
}
@Override
protected void dispatch(OpenFunctionalityHandler handler) {
handler.onOpenFunctionality(this);
}
@Override
public Type<OpenFunctionalityHandler> getAssociatedType() {
return TYPE;
}
public static Type<OpenFunctionalityHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source, OpenFunctionalityType openFunctionalityType) {
source.fireEvent(new OpenFunctionalityEvent(openFunctionalityType));
}
}

View File

@ -0,0 +1,44 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.OpenTabularResourceType;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HasHandlers;
public class OpenTabularResourceEvent extends GwtEvent<OpenTabularResourceEvent.OpenTabularResourceHandler> {
public static Type<OpenTabularResourceHandler> TYPE = new Type<OpenTabularResourceHandler>();
private OpenTabularResourceType openType;
public interface OpenTabularResourceHandler extends EventHandler {
void onOpenTabularResource(OpenTabularResourceEvent event);
}
public OpenTabularResourceEvent(OpenTabularResourceType openType) {
this.openType = openType;
}
public OpenTabularResourceType getOpenType() {
return openType;
}
@Override
protected void dispatch(OpenTabularResourceHandler handler) {
handler.onOpenTabularResource(this);
}
@Override
public Type<OpenTabularResourceHandler> getAssociatedType() {
return TYPE;
}
public static Type<OpenTabularResourceHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source, OpenTabularResourceType openType) {
source.fireEvent(new OpenTabularResourceEvent(openType));
}
}

View File

@ -0,0 +1,44 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.EventHandler;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.UIStateType;
import com.google.gwt.event.shared.HasHandlers;
public class UIStateEvent extends GwtEvent<UIStateEvent.UIStateHandler> {
public static Type<UIStateHandler> TYPE = new Type<UIStateHandler>();
private UIStateType uiStateType;
public interface UIStateHandler extends EventHandler {
void onUIState(UIStateEvent event);
}
public UIStateEvent(UIStateType uiStateType) {
this.uiStateType = uiStateType;
}
public UIStateType getUIStateType() {
return uiStateType;
}
@Override
protected void dispatch(UIStateHandler handler) {
handler.onUIState(this);
}
@Override
public Type<UIStateHandler> getAssociatedType() {
return TYPE;
}
public static Type<UIStateHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source, UIStateType uiStateType) {
source.fireEvent(new UIStateEvent(uiStateType));
}
}

View File

@ -0,0 +1,12 @@
/**
*
*/
package org.gcube.portlets.user.td.widgetcommonevent.client.type;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public enum CloseTabularResourceType {
TABLE;
}

View File

@ -0,0 +1,14 @@
/**
*
*/
package org.gcube.portlets.user.td.widgetcommonevent.client.type;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public enum ExportTableType {
CSV,
SDMX,
JSON;
}

View File

@ -0,0 +1,14 @@
/**
*
*/
package org.gcube.portlets.user.td.widgetcommonevent.client.type;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public enum ImportTableType {
CSV,
SDMX,
JSON;
}

View File

@ -0,0 +1,12 @@
/**
*
*/
package org.gcube.portlets.user.td.widgetcommonevent.client.type;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public enum OpenFunctionalityType {
PROPERTIES;
}

View File

@ -0,0 +1,12 @@
/**
*
*/
package org.gcube.portlets.user.td.widgetcommonevent.client.type;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public enum OpenTabularResourceType {
TABLE;
}

View File

@ -0,0 +1,8 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.type;
public enum UIStateType {
START,
TR_OPEN,
TR_CLOSE,
WIZARD_OPEN;
}