geoportal-data-viewer-app/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/events/ShowDetailsEvent.java

134 lines
2.7 KiB
Java

package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class ShowDetailsEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jul 30, 2021
*/
public class ShowDetailsEvent extends GwtEvent<ShowDetailsEventHandler> {
public static Type<ShowDetailsEventHandler> TYPE = new Type<ShowDetailsEventHandler>();
private String geonaItemType;
private FeatureRow featureRow;
private String geonaMongoID;
private String itemName;
/**
* Instantiates a new show details event.
*
* @param geonaItemType the geona item type
* @param geonaMongoID the geona mongo ID
* @param itemName the item name
* @param featureRow the feature row
*/
public ShowDetailsEvent(String geonaItemType, String geonaMongoID, String itemName, FeatureRow featureRow) {
this.geonaItemType = geonaItemType;
this.geonaMongoID = geonaMongoID;
this.itemName = itemName;
this.featureRow = featureRow;
}
/**
* Instantiates a new show details event.
*
* @param gir the gir
* @param itemName the item name
* @param featureRow the feature row
*/
public ShowDetailsEvent(GeoNaItemRef gir, String itemName, FeatureRow featureRow) {
this.geonaItemType = gir.getItemType();
this.geonaMongoID = gir.getItemId();
this.itemName = itemName;
this.featureRow = featureRow;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<ShowDetailsEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(ShowDetailsEventHandler handler) {
handler.onShowDetails(this);
}
/**
* Gets the geona item type.
*
* @return the geona item type
*/
public String getGeonaItemType() {
return geonaItemType;
}
/**
* Gets the feature row.
*
* @return the feature row
*/
public FeatureRow getFeatureRow() {
return featureRow;
}
/**
* Gets the geona mongo ID.
*
* @return the geona mongo ID
*/
public String getGeonaMongoID() {
return geonaMongoID;
}
/**
* Gets the item name.
*
* @return the item name
*/
public String getItemName() {
return itemName;
}
/**
* Sets the item name.
*
* @param itemName the new item name
*/
public void setItemName(String itemName) {
this.itemName = itemName;
}
/**
* Gets the geona item ref.
*
* @return the geona item ref
*/
public GeoNaItemRef getGeonaItemRef() {
return new GeoNaItemRef(geonaMongoID, geonaItemType);
}
}