Minor update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event@100591 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-09 16:55:21 +00:00
parent 2cff82de73
commit 9b67b994a5
3 changed files with 68 additions and 26 deletions

View File

@ -0,0 +1,63 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.DataView;
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 DataViewActiveEvent extends
GwtEvent<DataViewActiveEvent.DataViewActiveEventHandler> {
public static Type<DataViewActiveEventHandler> TYPE = new Type<DataViewActiveEventHandler>();
private DataView dataView;
public interface DataViewActiveEventHandler extends EventHandler {
void onDataViewActive(DataViewActiveEvent event);
}
public interface HasDataViewActiveEventHandler extends HasHandlers {
public HandlerRegistration addDataViewActiveEventHandler(
DataViewActiveEventHandler handler);
}
public DataViewActiveEvent(DataView dataView) {
this.dataView=dataView;
}
@Override
protected void dispatch(DataViewActiveEventHandler handler) {
handler.onDataViewActive(this);
}
@Override
public Type<DataViewActiveEventHandler> getAssociatedType() {
return TYPE;
}
public static Type<DataViewActiveEventHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source,
DataView dataView) {
source.fireEvent(new DataViewActiveEvent(dataView));
}
public DataView getDataView() {
return dataView;
}
}

View File

@ -1,7 +1,7 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.DataViewRequestType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.DataView;
import com.google.gwt.event.shared.EventHandler;
@ -19,7 +19,6 @@ public class DataViewRequestEvent extends
GwtEvent<DataViewRequestEvent.DataViewRequestEventHandler> {
public static Type<DataViewRequestEventHandler> TYPE = new Type<DataViewRequestEventHandler>();
private DataViewRequestType dataViewRequestType;
private DataView dataView;
@ -32,12 +31,8 @@ public class DataViewRequestEvent extends
DataViewRequestEventHandler handler);
}
public DataViewRequestEvent(DataViewRequestType dataViewRequestType) {
this.dataViewRequestType = dataViewRequestType;
}
public DataViewRequestType getDataViewRequestType() {
return dataViewRequestType;
public DataViewRequestEvent(DataView dataView) {
this.dataView = dataView;
}
@Override
@ -55,8 +50,8 @@ public class DataViewRequestEvent extends
}
public static void fire(HasHandlers source,
DataViewRequestType dataViewRequestType) {
source.fireEvent(new DataViewRequestEvent(dataViewRequestType));
DataView dataView) {
source.fireEvent(new DataViewRequestEvent(dataView));
}
public DataView getDataView() {

View File

@ -1,16 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.td.widgetcommonevent.client.type;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public enum DataViewRequestType {
TABULARRESOURCE,
RESOURCE;
}