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:
parent
2cff82de73
commit
9b67b994a5
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
|
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 org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.DataView;
|
||||||
|
|
||||||
import com.google.gwt.event.shared.EventHandler;
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
@ -19,7 +19,6 @@ public class DataViewRequestEvent extends
|
||||||
GwtEvent<DataViewRequestEvent.DataViewRequestEventHandler> {
|
GwtEvent<DataViewRequestEvent.DataViewRequestEventHandler> {
|
||||||
|
|
||||||
public static Type<DataViewRequestEventHandler> TYPE = new Type<DataViewRequestEventHandler>();
|
public static Type<DataViewRequestEventHandler> TYPE = new Type<DataViewRequestEventHandler>();
|
||||||
private DataViewRequestType dataViewRequestType;
|
|
||||||
private DataView dataView;
|
private DataView dataView;
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,12 +31,8 @@ public class DataViewRequestEvent extends
|
||||||
DataViewRequestEventHandler handler);
|
DataViewRequestEventHandler handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataViewRequestEvent(DataViewRequestType dataViewRequestType) {
|
public DataViewRequestEvent(DataView dataView) {
|
||||||
this.dataViewRequestType = dataViewRequestType;
|
this.dataView = dataView;
|
||||||
}
|
|
||||||
|
|
||||||
public DataViewRequestType getDataViewRequestType() {
|
|
||||||
return dataViewRequestType;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,8 +50,8 @@ public class DataViewRequestEvent extends
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void fire(HasHandlers source,
|
public static void fire(HasHandlers source,
|
||||||
DataViewRequestType dataViewRequestType) {
|
DataView dataView) {
|
||||||
source.fireEvent(new DataViewRequestEvent(dataViewRequestType));
|
source.fireEvent(new DataViewRequestEvent(dataView));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataView getDataView() {
|
public DataView getDataView() {
|
||||||
|
|
|
@ -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;
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue