Skip to content

Commit

Permalink
#865 | Added groups icons in the Structure view
Browse files Browse the repository at this point in the history
  • Loading branch information
mlytvyn authored Dec 23, 2023
1 parent 01bcd6b commit 8d495c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- Add JDK Export Properties to JUnit Tests to run Integration Tests [#864](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/864)
- Load Properties from Files and Environment [#864](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/864)

### `items.xml` enhancements
- Added groups icons in the Structure view [#865](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/865)

## [2023.3.2]

### `Project Import` enhancements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,10 @@ class TSStructureTreeElement(

private fun resolveLocationString(dom: CollectionType) = dom.type.value.toString() + (dom.elementType.stringValue?.let { " of $it" } ?: "")

private fun resolveLocationString(dom: Description): String? {
val xmlElement = dom.xmlElement
if (xmlElement is XmlTag) {
return xmlElement.value.trimmedText
}
return null
}
private fun resolveLocationString(dom: Description) = dom.xmlElement
?.let { it as? XmlTag }
?.value
?.trimmedText

private fun resolveLocationString(dom: Deployment) = listOfNotNull(
dom.table.stringValue,
Expand Down Expand Up @@ -159,6 +156,13 @@ class TSStructureTreeElement(

override fun getIcon(open: Boolean) = when (element) {
is Description -> AllIcons.Windows.Help
is AtomicTypes -> HybrisIcons.TS_GROUP_ATOMIC
is CollectionTypes -> HybrisIcons.TS_GROUP_COLLECTION
is MapTypes -> HybrisIcons.TS_GROUP_MAP
is Relations -> HybrisIcons.TS_GROUP_RELATION
is ItemTypes -> HybrisIcons.TS_GROUP_ITEM
is TypeGroup -> HybrisIcons.TS_GROUP_ITEM
is EnumTypes -> HybrisIcons.TS_GROUP_ENUM
is AtomicType -> HybrisIcons.TS_ATOMIC
is EnumType -> HybrisIcons.TS_ENUM
is EnumValue -> HybrisIcons.TS_ENUM_VALUE
Expand All @@ -174,15 +178,4 @@ class TSStructureTreeElement(
else -> null
}

// : Icon? {
// val dom = element
// // TODO: add icons
// if (dom is Attribute) {
// val value = resolveValue(dom.type)
// if (StringUtils.startsWith(value, TS_ATTRIBUTE_LOCALIZED_PREFIX)) {
// return HybrisIcons.LOCALIZED
// }
// }
// return null
// }
}

0 comments on commit 8d495c3

Please sign in to comment.