Class EditorUtils
java.lang.Object
de.hybris.platform.integrationbackoffice.widgets.modeling.utility.EditorUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.zkoss.zul.ComboitemcreateComboItem(String label, Object value) Creates a combobox itemstatic org.zkoss.zul.ListitemcreateListItem(AbstractListItemDTO dto, boolean isComplex, boolean hasSubtypes, List<String> labels, boolean inEditMode, ReadService readService) Creates a list itemstatic org.zkoss.zul.MenupopupcreateMenuPopup(List<String> labels) Create menu popupstatic org.zkoss.zul.TreeitemcreateTreeItem(TreeNodeData value, boolean expanded) Creates a tree item.static ListItemAttributeStatusdetermineAttributeStatus(ListItemAttributeDTO dto, ReadService readService) Determines the attribute statusstatic org.zkoss.zul.TreeitemfindInTreechildren(String qualifier, org.zkoss.zul.Treechildren treechildren) Find a matching Treeitem in a given parent Treeitem's Treechildren by qualifier.static ListItemStructureTypegetListItemStructureType(ReadService readService, AttributeDescriptorModel attribute) Determines the structure type of the given AttributeDescriptorModelstatic booleanisClassificationAttributePresent(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.static booleanmarkRowsWithDuplicateNames(Collection<org.zkoss.zul.Listitem> items, Map<String, List<AbstractListItemDTO>> duplicateEntries) Modifies the sClass of the list items to show highlights on duplicate items.static org.zkoss.zul.TreeitemrenameTreeitem(org.zkoss.zul.Treeitem treeitem, AbstractListItemDTO dto) Renames a tree itemupdateDTOs(List<AbstractListItemDTO> oldDTOs, List<AbstractListItemDTO> newDTOs) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
createComboItem
Creates a combobox item- Parameters:
label- Label of itemvalue- Value of item- Returns:
- Combobox item
-
createTreeItem
Creates a tree item. Qualifier of the root node will be NULL.- Parameters:
value- Value of tree itemexpanded- 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 itemisComplex- If attribute it a complex typehasSubtypes- If attribute has subtypeslabels- Menuitem labelsinEditMode- If in edit mode- Returns:
- A list item
-
createMenuPopup
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 renameddto- 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 matchtreechildren- 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 theListItemAttributeDTOUpdaterinsteadUpdates attributes of a list of DTOs by getting the attributes of another list of DTOs- Parameters:
oldDTOs- a list of DTOs with attributes to updatenewDTOs- 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 systemattribute- 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 overduplicateEntries- 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 checkeddtos- 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 evaluatedreadService- ReadService instance- Returns:
- Status of attribute
-
ListItemAttributeDTOUpdaterinstead