public class

PopupInfo

extends Object
java.lang.Object
   ↳ com.esri.core.map.popup.PopupInfo
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

The PopupInfo class represents popup definitions for features that need to be displayed in popups. Popup definitions contain information such as:

  • Whether or not a user should be allowed to edit the feature.
  • Which attributes of the feature should the popup display, whether they are editable, how to format numbers and dates, etc.
  • Whether or not the popup should show attachments for the feature.
  • What media, such as charts and images, should be displayed for the feature.

Summary

Fields
protected String description
protected LinkedHashMap<String, PopupFieldInfo> fieldInfos
protected double minScale
protected String title
Public Constructors
PopupInfo(PopupInfo popupInfo)
PopupInfo(Graphic graphic)
PopupInfo()
Default constructor for PopupInfo.
Public Methods
static PopupInfo fromJson(JsonParser parser)
String getDescription()
Returns the description that is shown for the graphic in the popup.
PopupFieldInfo getFieldInfo(String fieldName)
Given a field name, returns the definition of how a graphic's field should be displayed in the popup.
Map<String, PopupFieldInfo> getFieldInfos()
Return an array of PopupFieldInfo objects which represent how a graphic's fields should be displayed in the popup.
double getMaxScale()
Returns the maximum scale that this popup should be shown at.
PopupMediaInfo[] getMediaInfos()
double getMinScale()
Returns the minimum scale that this popup should be shown at.
String getTitle()
Returns the title of this popup.
boolean isShowAttachments()
void setDescription(String description)
Sets the description of this popup.
void setFieldInfos(Map<String, PopupFieldInfo> fieldInfos)
Sets a list of a graphic fields to be displayed in the popup.
void setMaxScale(double maxScale)
Sets the maximum scale that this popup should be shown at.
void setMediaInfos(PopupMediaInfo[] mediaInfos)
void setMinScale(double minScale)
Sets the minimum scale that this popup should be shown at.
void setShowAttachments(boolean showAttachments)
void setTitle(String title)
Sets the title of this popup.
String toJson()
Serializes a PopupInfo object into a JSON String.
String toString()
Returns string representation of the class.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected String description

protected LinkedHashMap<String, PopupFieldInfo> fieldInfos

protected double minScale

protected String title

Public Constructors

public PopupInfo (PopupInfo popupInfo)

public PopupInfo (Graphic graphic)

public PopupInfo ()

Default constructor for PopupInfo.

Public Methods

public static PopupInfo fromJson (JsonParser parser)

Returns
PopupInfo
Throws
Exception
Exception

public String getDescription ()

Returns the description that is shown for the graphic in the popup. This can be formatted as HTML. If the description is null then the PopupFieldInfos are used when viewing attributes. This can contain a literal value, or a placeholder for value from the graphic's attribute. The placeholder needs to be of the form {field_name} where field_name is a key in the graphic's attributes.

Returns
String description

public PopupFieldInfo getFieldInfo (String fieldName)

Given a field name, returns the definition of how a graphic's field should be displayed in the popup.

Parameters
fieldName String: The name of the field to return.
Returns
PopupFieldInfo fieldInfo

public Map<String, PopupFieldInfo> getFieldInfos ()

Return an array of PopupFieldInfo objects which represent how a graphic's fields should be displayed in the popup. If the description is null then the PopupFieldInfos are used when viewing attributes.

Returns
Map<String, PopupFieldInfo> fieldInfos

public double getMaxScale ()

Returns the maximum scale that this popup should be shown at.

Returns
double maxScale

public PopupMediaInfo[] getMediaInfos ()

Returns
PopupMediaInfo[] the mediaInfos

public double getMinScale ()

Returns the minimum scale that this popup should be shown at.

Returns
double minScale

public String getTitle ()

Returns the title of this popup.

Returns
String title

public boolean isShowAttachments ()

Returns
boolean the showAttachments

public void setDescription (String description)

Sets the description of this popup.

Parameters
description String: This popup's description

public void setFieldInfos (Map<String, PopupFieldInfo> fieldInfos)

Sets a list of a graphic fields to be displayed in the popup.

Parameters
fieldInfos Map: An array of PopupFieldInfos.

public void setMaxScale (double maxScale)

Sets the maximum scale that this popup should be shown at.

Parameters
maxScale double: The maximum scale the popup should be shown at

public void setMediaInfos (PopupMediaInfo[] mediaInfos)

Parameters
mediaInfos PopupMediaInfo: the mediaInfos to set

public void setMinScale (double minScale)

Sets the minimum scale that this popup should be shown at.

Parameters
minScale double: The minimum scale the popup should be shown at

public void setShowAttachments (boolean showAttachments)

Parameters
showAttachments boolean: the showAttachments to set

public void setTitle (String title)

Sets the title of this popup.

Parameters
title String: This popup's title

public String toJson ()

Serializes a PopupInfo object into a JSON String.

Returns
String a JSON String representing the PopupInfo.
Throws
Exception An exception thrown the object cannot be serialized into JSON string.

public String toString ()

Returns string representation of the class. The format and content of the returned string is not part of the contract of the method and is subject to change in any future release or patch without further notice.

Returns
String