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

New UI Tool Window Icons #688

Merged
merged 1 commit into from
Sep 4, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

### Other
- Added VCS issue navigation for IntelliJ [#665](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/665)
- New UI Tool Window Icons ([sdk docs](https://plugins.jetbrains.com/docs/intellij/work-with-icons-and-images.html#new-ui-tool-window-icons)) [#688](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/688)

## [2023.2.7]

Expand Down
2 changes: 1 addition & 1 deletion resources/META-INF/plugin-internal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
key="hybris.settings.project.remote_instances.title"
provider="com.intellij.idea.plugin.hybris.settings.HybrisProjectRemoteInstancesSettingsConfigurableProvider"/>

<toolWindow id="SAP Commerce" icon="/icons/toolWindowHybrisIcon.svg" anchor="bottom"
<toolWindow id="SAP Commerce" icon="/icons/toolWindow.svg" anchor="bottom"
factoryClass="com.intellij.idea.plugin.hybris.toolwindow.HybrisToolWindowFactory"/>

<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.project.configurators.impl.DummySpringConfigurator"/>
Expand Down
10 changes: 10 additions & 0 deletions resources/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions resources/icons/toolWindow@20x20_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@

package com.intellij.idea.plugin.hybris.system.extensioninfo.codeInsight.lookup

import com.intellij.codeInsight.completion.PrioritizedLookupElement
import com.intellij.codeInsight.lookup.LookupElementBuilder
import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons
import com.intellij.idea.plugin.hybris.facet.ExtensionDescriptor
import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorType

object EiSLookupElementFactory {

fun build(it: ExtensionDescriptor) = LookupElementBuilder.create(it.name)
.withTailText(tail(it), true)
.withTypeText(it.type.name, true)
fun build(ed: ExtensionDescriptor) = LookupElementBuilder.create(ed.name)
.withTailText(tail(ed), true)
.withTypeText(ed.type.name, true)
.withIcon(
when (it.type) {
when (ed.type) {
ModuleDescriptorType.CCV2 -> HybrisIcons.EXTENSION_CLOUD
ModuleDescriptorType.CUSTOM -> HybrisIcons.EXTENSION_CUSTOM
ModuleDescriptorType.EXT -> HybrisIcons.EXTENSION_EXT
Expand All @@ -38,6 +39,18 @@ object EiSLookupElementFactory {
else -> null
}
)
.let {
PrioritizedLookupElement.withPriority(
it,
when (ed.type) {
ModuleDescriptorType.CUSTOM -> 5.0
ModuleDescriptorType.CCV2 -> 4.0
ModuleDescriptorType.OOTB -> 3.0
ModuleDescriptorType.EXT -> 2.0
else -> 1.0
}
)
}

private fun tail(extensionDescriptor: ExtensionDescriptor): String? {
val tail = listOfNotNull(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ import com.intellij.openapi.project.Project
class TemplateExtensionNameCompletionProvider : ExtensionNameCompletionProvider() {

override fun getExtensionDescriptors(parameters: CompletionParameters, project: Project) = HybrisProjectSettingsComponent.getInstance(project)
.getAvailableExtensions()
.values
.filter { it.extGenTemplateExtension }
.toList()
.getAvailableExtensions()
.values
.filter { it.extGenTemplateExtension }
.toList()

companion object {
val instance: CompletionProvider<CompletionParameters> =
ApplicationManager.getApplication().getService(TemplateExtensionNameCompletionProvider::class.java)
val instance: CompletionProvider<CompletionParameters> = ApplicationManager.getApplication().getService(TemplateExtensionNameCompletionProvider::class.java)
}
}