Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added groups icons in the Structure view #865

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
// }
}