package org.gcube.portlets.user.geoportaldataviewer.client.events; import org.gcube.portlets.user.geoportaldataviewer.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) * * Nov 13, 2020 */ public class ShowDetailsEvent extends GwtEvent { public static Type TYPE = new Type(); private String geonaItemType; private FeatureRow featureRow; private Long geonaID; private String itemName; /** * Instantiates a new show details event. * * @param geonaItemType the geona item type * @param geonaID the geona ID * @param itemName the item name * @param featureRow the feature row */ public ShowDetailsEvent(String geonaItemType, Long geonaID, String itemName, FeatureRow featureRow) { this.geonaItemType = geonaItemType; this.geonaID = geonaID; 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.geonaID = gir.getItemId(); this.itemName = itemName; this.featureRow = featureRow; } /** * Gets the associated type. * * @return the associated type */ @Override public Type 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 ID. * * @return the geona ID */ public Long getGeonaID() { return geonaID; } /** * 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(geonaID, geonaItemType); } }