Class PopupDefinition
- java.lang.Object
-
- com.esri.arcgisruntime.mapping.popup.PopupDefinition
-
public final class PopupDefinition extends Object
A pop-up definition for aGeoElement
. This class defines how the geoelement will be displayed and behave in a pop-up. Pop-up definitions contain information such as:- Which attributes of the geoelement should the pop-up display, whether it is editable, how to format numbers and dates, etc.
- Whether the pop-up should show attachments for the geoelement.
- What media, such as charts and images, should be displayed for the geoelement.
- Since:
- 100.0.0
- See Also:
PopupSource
-
-
Constructor Summary
Constructors Constructor Description PopupDefinition()
Creates a new, empty pop-up definition.PopupDefinition(GeoElement geoElement)
Creates a new popup definition from aGeoElement
.PopupDefinition(PopupSource popupSource)
Creates a new popup definition from a popup source.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getDescription()
Gets a string that appears in the body of the pop-up as a description.List<PopupElement>
getElements()
Gets a mutable list ofPopupElement
that represent an ordered list of pop-up elements.List<PopupExpression>
getExpressions()
Gets a list of PopupExpression objects defining the various Arcade expressions on the pop-up.List<PopupField>
getFields()
Gets a list ofPopupField
objects defining how each field participates in the pop-up window.List<PopupMedia>
getMedia()
Gets a list of PopupMedia objects that define images and charts displayed in the pop-up.PopupRelatedFeaturesDefinition
getRelatedFeaturesDefinition()
Gets the related features definition for this pop-up definition.String
getTitle()
Gets a string that appears at the top of the pop-up as a title.boolean
isAllowDelete()
Checks if the pop-up allows the geoelement to be deleted.boolean
isAllowEdit()
Checks if the pop-up allows the associatedGeoElement
's attributes to be edited.boolean
isAllowEditGeometry()
Checks if the pop-up allows the associated geoelement's geometry to be edited.boolean
isShowAttachments()
Checks if attachments should be loaded for feature layers that have attachments.boolean
isShowEditSummary()
Checks if the pop-up should display the edit summary of the associated geoelement.boolean
isShowRelatedRecords()
Deprecated.As of 100.1.0, replaced byPopupRelatedFeaturesDefinition.isShowRelatedFeatures()
.void
setAllowDelete(boolean allowDelete)
Sets whether or not the pop-up allows the geoelement to be deleted.void
setAllowEdit(boolean allowEdit)
Sets whether or not the pop-up allows the associated geoelement's attributes to be edited.void
setAllowEditGeometry(boolean allowEditGeometry)
Sets whether or not the pop-up allows the associated geoelement's geometry to be edited.void
setDescription(String description)
Sets a string that appears in the body of the pop-up as a description.void
setRelatedFeaturesDefinition(PopupRelatedFeaturesDefinition popupRelatedFeaturesDefinition)
Sets the related features definition for this pop-up definition.void
setShowAttachments(boolean showAttachments)
Sets whether or not attachments should be loaded for feature layers that have attachments.void
setShowEditSummary(boolean showEditSummary)
Sets whether the pop-up should display the edit summary of the associated geoelement.void
setShowRelatedRecords(boolean showRelatedRecords)
Deprecated.As of 100.1.0, replaced byPopupRelatedFeaturesDefinition.setShowRelatedFeatures(boolean)
.void
setTitle(String title)
Sets a string that appears at the top of the pop-up as a title.
-
-
-
Constructor Detail
-
PopupDefinition
public PopupDefinition()
Creates a new, empty pop-up definition. Use this object to define the look and feel of pop-up windows when users click or query a feature.- Since:
- 100.0.0
-
PopupDefinition
public PopupDefinition(GeoElement geoElement)
Creates a new popup definition from aGeoElement
.This creates a new popup definition with default properties and default popup elements based on the geoelement fields. Use this object to define the look and feel of pop-up windows when users click or query a feature.
- Parameters:
geoElement
- the geoelement for the popup, such as aFeature
orGraphic
- Throws:
IllegalArgumentException
- if the geoElement is null- Since:
- 100.0.0
- See Also:
PopupField
-
PopupDefinition
public PopupDefinition(PopupSource popupSource)
Creates a new popup definition from a popup source.This creates a new popup definition with default properties and default popup elements based on the popup source fields. Use this object to define the look and feel of pop-up windows when users click or query a feature.
- Parameters:
popupSource
- the PopupSource on which to base the pop-up- Throws:
IllegalArgumentException
- if popupSource is null- Since:
- 100.0.0
-
-
Method Detail
-
getDescription
public String getDescription()
Gets a string that appears in the body of the pop-up as a description.- Returns:
- the description string
- Since:
- 100.0.0
- See Also:
setDescription(String)
-
setDescription
public void setDescription(String description)
Sets a string that appears in the body of the pop-up as a description.The description can contain a literal value, or a placeholder for value from the geoelement's attribute. The placeholder needs to be of the form
{field_name}
where field_name is a key in the geoelement's attributes- Parameters:
description
- the description string- Since:
- 100.0.0
- See Also:
getDescription()
-
getTitle
public String getTitle()
Gets a string that appears at the top of the pop-up as a title.- Returns:
- the title string
- Since:
- 100.0.0
- See Also:
setTitle(String)
-
setTitle
public void setTitle(String title)
Sets a string that appears at the top of the pop-up as a title.The title can contain a literal value, or a placeholder for value from the geo element's attribute. The placeholder needs to be of the form
{field_name}
where field_name is a key in the geoelement's attributes.- Parameters:
title
- the title string- Since:
- 100.0.0
- See Also:
getTitle()
-
isShowAttachments
public boolean isShowAttachments()
Checks if attachments should be loaded for feature layers that have attachments.- Returns:
- true if attachments should be shown; otherwise false
- Since:
- 100.0.0
- See Also:
setShowAttachments(boolean)
-
setShowAttachments
public void setShowAttachments(boolean showAttachments)
Sets whether or not attachments should be loaded for feature layers that have attachments.- Parameters:
showAttachments
- a boolean indicating whether attachments should be shown- Since:
- 100.0.0
- See Also:
isShowAttachments()
-
isShowEditSummary
public boolean isShowEditSummary()
Checks if the pop-up should display the edit summary of the associated geoelement.- Returns:
- true if edit summary will be displayed
- Since:
- 100.6.0
- See Also:
setShowEditSummary(boolean)
-
setShowEditSummary
public void setShowEditSummary(boolean showEditSummary)
Sets whether the pop-up should display the edit summary of the associated geoelement.- Parameters:
showEditSummary
- true if edit summary should be displayed; false otherwise- Since:
- 100.6.0
- See Also:
isShowEditSummary()
-
isShowRelatedRecords
@Deprecated public boolean isShowRelatedRecords()
Deprecated.As of 100.1.0, replaced byPopupRelatedFeaturesDefinition.isShowRelatedFeatures()
.Checks if the pop-up should show additional geoelements that are related to this pop-up's geoelement.- Returns:
- true if additional related geoelements should be shown; otherwise false
- Since:
- 100.0.0
-
setShowRelatedRecords
@Deprecated public void setShowRelatedRecords(boolean showRelatedRecords)
Deprecated.As of 100.1.0, replaced byPopupRelatedFeaturesDefinition.setShowRelatedFeatures(boolean)
.Sets whether or not the pop-up should show additional geoelements that are related to this pop-up's geoelement.- Parameters:
showRelatedRecords
- true to show additional related geoelements- Since:
- 100.0.0
-
getFields
public List<PopupField> getFields()
Gets a list ofPopupField
objects defining how each field participates in the pop-up window.The order of the list is the order that fields are shown in the pop-up window.
- Returns:
- a list of PopupField objects
- Since:
- 100.0.0
-
getMedia
public List<PopupMedia> getMedia()
Gets a list of PopupMedia objects that define images and charts displayed in the pop-up.The order of the list is the order that media are shown in the pop-up window.
- Returns:
- a list of PopupMedia objects
- Since:
- 100.0.0
-
getExpressions
public List<PopupExpression> getExpressions()
Gets a list of PopupExpression objects defining the various Arcade expressions on the pop-up.- Returns:
- a list of PopupExpression objects
- Since:
- 100.3.0
-
isAllowEdit
public boolean isAllowEdit()
Checks if the pop-up allows the associatedGeoElement
's attributes to be edited.- Returns:
- true if editing the geoelement's attributes is allowed
- Since:
- 100.0.0
- See Also:
setAllowEdit(boolean)
-
setAllowEdit
public void setAllowEdit(boolean allowEdit)
Sets whether or not the pop-up allows the associated geoelement's attributes to be edited.- Parameters:
allowEdit
- true to allow editing the geoelement's attributes- Since:
- 100.0.0
- See Also:
isAllowEdit()
-
isAllowEditGeometry
public boolean isAllowEditGeometry()
Checks if the pop-up allows the associated geoelement's geometry to be edited.- Returns:
- true if editing the geoelement's geometry is allowed
- Since:
- 100.0.0
- See Also:
setAllowEditGeometry(boolean)
-
setAllowEditGeometry
public void setAllowEditGeometry(boolean allowEditGeometry)
Sets whether or not the pop-up allows the associated geoelement's geometry to be edited.- Parameters:
allowEditGeometry
- true to allow editing the geoelement's geometry- Since:
- 100.0.0
- See Also:
isAllowEditGeometry()
-
isAllowDelete
public boolean isAllowDelete()
Checks if the pop-up allows the geoelement to be deleted.- Returns:
- true if deleting the geoelement is allowed
- Since:
- 100.0.0
- See Also:
setAllowDelete(boolean)
-
setAllowDelete
public void setAllowDelete(boolean allowDelete)
Sets whether or not the pop-up allows the geoelement to be deleted.- Parameters:
allowDelete
- true to allow deleting the geoelement- Since:
- 100.0.0
- See Also:
isAllowDelete()
-
getRelatedFeaturesDefinition
public PopupRelatedFeaturesDefinition getRelatedFeaturesDefinition()
Gets the related features definition for this pop-up definition.- Returns:
- the pop-up related features definition
- Since:
- 100.1.0
- See Also:
setRelatedFeaturesDefinition(PopupRelatedFeaturesDefinition)
-
setRelatedFeaturesDefinition
public void setRelatedFeaturesDefinition(PopupRelatedFeaturesDefinition popupRelatedFeaturesDefinition)
Sets the related features definition for this pop-up definition.A definition that dictates whether related features should be displayed in the pop-up and how they should be sorted.
- Parameters:
popupRelatedFeaturesDefinition
- the pop-up related features definition to set, can be null- Since:
- 100.1.0
- See Also:
getRelatedFeaturesDefinition()
-
getElements
public List<PopupElement> getElements()
Gets a mutable list ofPopupElement
that represent an ordered list of pop-up elements.The order of the
List
is the order that elements are shown in the pop-up window.For backward compatibility with a webmap or webscene created by clients that don't support the popup elements, a few popup elements are created to match the legacy popup style when reading a popup definition without popup elements:
- a
TextPopupElement
ifPopupDefinition.getDescription()
is not empty - a
FieldsPopupElement
ifPopupDefinition.getDescription()
is empty - a
MediaPopupElement
ifPopupDefinition.getMedia()
is not empty - an
AttachmentsPopupElement
ifPopupDefinition.isShowAttachments()
is true
- Returns:
- a mutable list of
PopupElement
that represent an ordered list of pop-up elements - Since:
- 100.14.0
- a
-
-