Skip to content

Commit

Permalink
#818 | Added navigation to the items.xml Ordering Attribute from th…
Browse files Browse the repository at this point in the history
…e generated classes
  • Loading branch information
mlytvyn authored Dec 3, 2023
1 parent 29a40b0 commit 1316d58
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Features
- Rely on `intelliLang` plugin to inject `FlexibleSearch` and `Polyglot Query` languages into the Java code [#817](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/817)
- Added navigation to the `items.xml` Ordering Attribute from the generated classes [#818](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/818)

### `Polyglot Query` enhancements
- Added possibility to preview preformatted Polyglot Queries and copy them to Clipboard [#810](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/810)
Expand Down
1 change: 1 addition & 0 deletions resources/i18n/HybrisBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ hybris.editor.gutter.ts.model.item.relationEnd.popup.title=Choose Relation End
hybris.editor.gutter.ts.model.item.relationEnd.tooltip.text=Navigate to the [y] Relation End declaration
hybris.editor.gutter.ts.model.item.attribute.popup.title=Choose Attribute
hybris.editor.gutter.ts.model.item.attribute.tooltip.text=Navigate to the [y] Attribute declaration(s)
hybris.editor.gutter.ts.model.item.orderingAttribute.tooltip.text=Navigate to the [y] Ordering Attribute declaration(s)
hybris.editor.gutter.ts.model.item.interceptors.name=Model - Item interceptors
hybris.editor.gutter.ts.model.item.name=Model - Item declaration(s)
hybris.editor.gutter.ts.model.item.popup.title=Choose Item
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA.
* Copyright (C) 2019 EPAM Systems <[email protected]>
* Copyright (C) 2019-2023 EPAM Systems <[email protected]> and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Expand Down Expand Up @@ -46,10 +46,28 @@ class ModelItemAttributeFieldLineMarkerProvider : AbstractModelAttributeLineMark

getPsiElementItemLineMarkerInfo(meta, name, nameIdentifier)
?: getPsiElementRelationLineMarkerInfo(name, nameIdentifier)
?: getPsiElementOrderingAttributeRelationLineMarkerInfo(meta, name, nameIdentifier)
}
?.let { listOf(it) }
?: emptyList()

private fun getPsiElementOrderingAttributeRelationLineMarkerInfo(
meta: TSGlobalMetaItem,
name: String,
nameIdentifier: PsiIdentifier
) = meta.allOrderingAttributes[name]
?.retrieveDom()
?.qualifier
?.xmlAttributeValue
?.let {
NavigationGutterIconBuilder
.create(HybrisIcons.TS_ORDERING_ATTRIBUTE)
.setTargets(it)
.setTooltipText(message("hybris.editor.gutter.ts.model.item.orderingAttribute.tooltip.text"))
.setAlignment(GutterIconRenderer.Alignment.LEFT)
.createLineMarkerInfo(nameIdentifier)
}

private fun getPsiElementRelationLineMarkerInfo(
name: String,
nameIdentifier: PsiIdentifier
Expand Down

0 comments on commit 1316d58

Please sign in to comment.