Class PopupDefinition

java.lang.Object
com.esri.arcgisruntime.mapping.popup.PopupDefinition

public final class PopupDefinition extends Object
A pop-up definition for a GeoElement. 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:
  • Constructor Details Link icon

    • PopupDefinition Link icon

      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 Link icon

      public PopupDefinition(GeoElement geoElement)
      Creates a new popup definition from a GeoElement.

      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 a Feature or Graphic
      Throws:
      IllegalArgumentException - if the geoElement is null
      Since:
      100.0.0
      See Also:
    • PopupDefinition Link icon

      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 Details Link icon

    • getDescription Link icon

      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 Link icon

      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:
    • getTitle Link icon

      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 Link icon

      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:
    • isShowAttachments Link icon

      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 Link icon

      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:
    • isShowEditSummary Link icon

      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 Link icon

      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:
    • getFields Link icon

      public List<PopupField> getFields()
      Gets a list of PopupField 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 Link icon

      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 Link icon

      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 Link icon

      public boolean isAllowEdit()
      Checks if the pop-up allows the associated GeoElement's attributes to be edited.
      Returns:
      true if editing the geoelement's attributes is allowed
      Since:
      100.0.0
      See Also:
    • setAllowEdit Link icon

      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:
    • isAllowEditGeometry Link icon

      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 Link icon

      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:
    • isAllowDelete Link icon

      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 Link icon

      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:
    • getRelatedFeaturesDefinition Link icon

      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 Link icon

      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:
    • getElements Link icon

      public List<PopupElement> getElements()
      Gets a mutable list of PopupElement 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:

      Vice versa, if the user updates the popup elements, the legacy popup style is updated during the PopupDefinition serialization, in order to match as much as possible the popup elements, so that older clients can display a popup that looks similar.
      Returns:
      a mutable list of PopupElement that represent an ordered list of pop-up elements
      Since:
      100.14.0