package org.gcube.portlets.user.geoportaldataviewer.client.events; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences; 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 { public static Type TYPE = new Type(); private String layerObjectType; private FeatureRow featureRow; private String itemName; private String profileID; private String projectID; private boolean loadTimelineRelationships; /** * Instantiates a new show details event. * * @param layerObjectType the geona item type * @param geonaMongoID the geona mongo ID * @param itemName the item name * @param featureRow the feature row */ public ShowDetailsEvent(String layerObjectType, String profileID, String projectID, String itemName, FeatureRow featureRow, boolean loadTimelineRelationships) { this.layerObjectType = layerObjectType; this.profileID = profileID; this.projectID = projectID; this.itemName = itemName; this.featureRow = featureRow; this.loadTimelineRelationships = loadTimelineRelationships; } /** * Instantiates a new show details event. * * @param gir the gir * @param itemName the item name * @param featureRow the feature row * @param loadTimelineRelationships the load timeline relationships */ public ShowDetailsEvent(GeoportalItemReferences gir, String itemName, FeatureRow featureRow, boolean loadTimelineRelationships) { this.layerObjectType = gir.getLayerObjectType(); this.profileID = gir.getProfileID(); this.projectID = gir.getProjectID(); this.itemName = itemName; this.featureRow = featureRow; this.loadTimelineRelationships = loadTimelineRelationships; } public static Type getTYPE() { return TYPE; } public String getLayerObjectType() { return layerObjectType; } public String getProfileID() { return profileID; } public String getProjectID() { return projectID; } /** * 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 feature row. * * @return the feature row */ public FeatureRow getFeatureRow() { return featureRow; } /** * 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; } /** * Checks if is load timeline relationships. * * @return true, if is load timeline relationships */ public boolean isLoadTimelineRelationships() { return loadTimelineRelationships; } /** * Gets the geona item ref. * * @return the geona item ref */ public GeoportalItemReferences getGeonaItemRef() { return new GeoportalItemReferences(projectID, profileID, layerObjectType); } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("ShowDetailsEvent [layerObjectType="); builder.append(layerObjectType); builder.append(", featureRow="); builder.append(featureRow); builder.append(", itemName="); builder.append(itemName); builder.append(", profileID="); builder.append(profileID); builder.append(", projectID="); builder.append(projectID); builder.append(", loadTimelineRelationships="); builder.append(loadTimelineRelationships); builder.append("]"); return builder.toString(); } }