java.lang.Object
de.hybris.platform.integrationbackoffice.widgets.modeling.utility.EditorUtils

public final class EditorUtils extends Object
  • Method Details

    • createComboItem

      public static org.zkoss.zul.Comboitem createComboItem(String label, Object value)
      Creates a combobox item
      Parameters:
      label - Label of item
      value - Value of item
      Returns:
      Combobox item
    • createTreeItem

      public static org.zkoss.zul.Treeitem createTreeItem(TreeNodeData value, boolean expanded)
      Creates a tree item. Qualifier of the root node will be NULL.
      Parameters:
      value - Value of tree item
      expanded - Whether node is expanded by default
      Returns:
      Tree item
    • createListItem

      public static org.zkoss.zul.Listitem createListItem(AbstractListItemDTO dto, boolean isComplex, boolean hasSubtypes, List<String> labels, boolean inEditMode, ReadService readService)
      Creates a list item
      Parameters:
      dto - DTO containing properties to populate list item
      isComplex - If attribute it a complex type
      hasSubtypes - If attribute has subtypes
      labels - Menuitem labels
      inEditMode - If in edit mode
      Returns:
      A list item
    • createMenuPopup

      public static org.zkoss.zul.Menupopup createMenuPopup(List<String> labels)
      Create menu popup
      Parameters:
      labels - Labels for menu items
      Returns:
      Menu popup
    • renameTreeitem

      public static org.zkoss.zul.Treeitem renameTreeitem(org.zkoss.zul.Treeitem treeitem, AbstractListItemDTO dto)
      Renames a tree item
      Parameters:
      treeitem - Item to be renamed
      dto - DTO containing relevant rename information
      Returns:
      Newly renamed tree item
    • findInTreechildren

      public static org.zkoss.zul.Treeitem findInTreechildren(String qualifier, org.zkoss.zul.Treechildren treechildren)
      Find a matching Treeitem in a given parent Treeitem's Treechildren by qualifier.
      Parameters:
      qualifier - the qualifier to match
      treechildren - the Treechildren to search
      Returns:
      a matching Treeitem, null if not found
    • updateDTOs

      @Deprecated(since="2205", forRemoval=true) public List<AbstractListItemDTO> updateDTOs(List<AbstractListItemDTO> oldDTOs, List<AbstractListItemDTO> newDTOs)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Please use the ListItemAttributeDTOUpdater instead
      Updates attributes of a list of DTOs by getting the attributes of another list of DTOs
      Parameters:
      oldDTOs - a list of DTOs with attributes to update
      newDTOs - a list of DTOs containing updated attributes
      Returns:
      a list of DTOs with updated attributes
    • getListItemStructureType

      public static ListItemStructureType getListItemStructureType(ReadService readService, AttributeDescriptorModel attribute)
      Determines the structure type of the given AttributeDescriptorModel
      Parameters:
      readService - the ReadService to read from the type system
      attribute - the AttributeDescriptorModel to evaluate
      Returns:
      ListItemStructureType enum representing the structure type of the AttributeDescriptorModel
    • markRowsWithDuplicateNames

      public static boolean markRowsWithDuplicateNames(Collection<org.zkoss.zul.Listitem> items, Map<String,List<AbstractListItemDTO>> duplicateEntries)
      Modifies the sClass of the list items to show highlights on duplicate items.
      Parameters:
      items - List of items to iterate over
      duplicateEntries - Map containing duplicate entries to match with item.
    • isClassificationAttributePresent

      public static boolean isClassificationAttributePresent(ClassAttributeAssignmentModel classAttributeAssignmentModel, List<AbstractListItemDTO> dtos)
      Determines whether or not a classification exists in the list of DTOs to avoid creating a duplicate of the exact same entry.
      Parameters:
      classAttributeAssignmentModel - Classification being checked
      dtos - List of existing DTOs to search for a potential match of type
      Returns:
      Whether or not a match is present
    • determineAttributeStatus

      public static ListItemAttributeStatus determineAttributeStatus(ListItemAttributeDTO dto, ReadService readService)
      Determines the attribute status
      Parameters:
      dto - Attribute DTO to be evaluated
      readService - ReadService instance
      Returns:
      Status of attribute