diff --git a/CHANGELOG.md b/CHANGELOG.md index 888a17088..d5d752f69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,9 @@ ### `CCv2 CLI` enhancements - Added possibility to specify directory of the SAP CX CLI [#1048](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1048) -- Added possibility to save developer-specific SAP CX CLI token in the secure storage [#1049](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1049) -- Added possibility to save CCv2 subscriptions to be used with SAP CX CLI [#1050](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1050) +- Added possibility to set developer-specific SAP CX CLI token in the secure storage [#1049](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1049) +- Added possibility to set developer-specific and project-aware CCv2 subscription [#1058](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1058) +- Added possibility to set CCv2 subscriptions to be used with SAP CX CLI [#1050](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1050) - Show cloud icon for CCv2 subscription [#1051](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1051) - Fetch and show CCv2 environments details [#1055](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1055) - Fetch and show CCv2 builds details [#1057](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1057) diff --git a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-beanSystem.xml b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-beanSystem.xml index 64cfc28a4..b2a2486ac 100644 --- a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-beanSystem.xml +++ b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-beanSystem.xml @@ -35,7 +35,7 @@ + provider="com.intellij.idea.plugin.hybris.settings.options.ProjectBeanSystemConfigurableProvider"/> diff --git a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-businessProcess.xml b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-businessProcess.xml index 88272c227..f0a6496e2 100644 --- a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-businessProcess.xml +++ b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-businessProcess.xml @@ -26,6 +26,6 @@ + provider="com.intellij.idea.plugin.hybris.settings.options.ProjectBusinessProcessConfigurableProvider"/> diff --git a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-cockpitng.xml b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-cockpitng.xml index c10bcca7b..e664e00b5 100644 --- a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-cockpitng.xml +++ b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-cockpitng.xml @@ -38,7 +38,7 @@ + provider="com.intellij.idea.plugin.hybris.settings.options.ProjectCngSettingsConfigurableProvider"/> diff --git a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-diagram.xml b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-diagram.xml index 33ae897c9..99f8803c8 100644 --- a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-diagram.xml +++ b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-diagram.xml @@ -44,10 +44,6 @@ - - diff --git a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-impex.xml b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-impex.xml index d276c49d1..e4fd0c863 100644 --- a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-impex.xml +++ b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-impex.xml @@ -58,7 +58,7 @@ + provider="com.intellij.idea.plugin.hybris.settings.options.ProjectImpExSettingsConfigurableProvider"/> diff --git a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-typeSystem.xml b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-typeSystem.xml index f2988506e..2dfbd0dfb 100644 --- a/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-typeSystem.xml +++ b/resources/META-INF/dependencies/com.intellij.idea.plugin.sap.commerce-typeSystem.xml @@ -54,7 +54,7 @@ + provider="com.intellij.idea.plugin.hybris.settings.options.ProjectTypeSystemConfigurableProvider"/> diff --git a/resources/META-INF/plugin-internal.xml b/resources/META-INF/plugin-internal.xml index 2d6a0ecf1..a67c2211b 100644 --- a/resources/META-INF/plugin-internal.xml +++ b/resources/META-INF/plugin-internal.xml @@ -53,22 +53,22 @@ + provider="com.intellij.idea.plugin.hybris.settings.options.ApplicationSettingsConfigurableProvider"/> + provider="com.intellij.idea.plugin.hybris.settings.options.ApplicationCCv2SettingsConfigurableProvider"/> + provider="com.intellij.idea.plugin.hybris.settings.options.ApplicationProjectImportSettingsConfigurableProvider"/> + provider="com.intellij.idea.plugin.hybris.settings.options.ProjectSettingsConfigurableProvider"/> + provider="com.intellij.idea.plugin.hybris.settings.options.ProjectRemoteInstancesSettingsConfigurableProvider"/> diff --git a/resources/i18n/HybrisBundle.properties b/resources/i18n/HybrisBundle.properties index a839c0d6f..4313ae313 100644 --- a/resources/i18n/HybrisBundle.properties +++ b/resources/i18n/HybrisBundle.properties @@ -79,7 +79,7 @@ hybris.project.view.external.module.tooltip=Group non-hybris modules (gradle, ma hybris.import.label.select.hybris.project.icon.file=Select Custom Project .svg Icon File (Optional). hybris.import.label.select.hybris.src.file=Select Source Code Zip File or Directory (Optional). -hybris.import.label.select.hybris.distribution.directory=Select SAP Commerce Installation Directory +hybris.import.label.select.hybris.distribution.directory=Select SAP CX Installation Directory hybris.import.label.select.custom.extensions.directory=Select Custom Extensions Directory hybris.import.label.select.config.extensions.directory=Select Config Directory hybris.import.label.select.dbdriver.extensions.directory=Select DB Drivers Directory @@ -154,8 +154,8 @@ hybris.import.wizard.source.code.path.label=SAP Commerce Source Code (Optional) hybris.import.wizard.source.code.path.tooltip=SAP Commerce source code directory or *.zip file hybris.import.wizard.project.icon.label=Custom Intellij Project Icon (Optional) hybris.import.wizard.project.icon.tooltip=Intellij IDEA Project Icon (*.svg file) -hybris.import.wizard.javadoc.url.label=SAP Commerce javadoc url (optional): -hybris.import.wizard.javadoc.url.tooltip=Url of SAP Commerce javadoc (for instance https://help.sap.com/docs/SAP_COMMERCE/c5613bd3cc9942efb74d017b40eb0892/179bbc9b35274d7ca784e46b3beb40b2.html). +hybris.import.wizard.javadoc.url.label=SAP CX javadoc url (optional): +hybris.import.wizard.javadoc.url.tooltip=Url of SAP CX javadoc (for instance https://help.sap.com/docs/SAP_COMMERCE/c5613bd3cc9942efb74d017b40eb0892/179bbc9b35274d7ca784e46b3beb40b2.html). hybris.import.wizard.project.name.label=Project Name hybris.import.wizard.store.idea.modules.file.in.label=Store IDEA Module Files In hybris.import.wizard.store.idea.modules.file.in.tooltip=A directory where all IDEA module files will be stored. @@ -170,12 +170,12 @@ hybris.import.wizard.dbdriver.directory.override.filechooser=Overriding DB drive hybris.import.wizard.dbdriver.directory.override.label=DB driver Directory Override hybris.import.wizard.dbdriver.directory.override.separator.label=The DB driver directory that contains DB driver jar files (used to execute Integration test from IDE) hybris.import.wizard.hybris.distribution.directory.and.custom.directory.separator.label=If your custom directory is in bin/ext-* directory or is outside the project root directory you can override it below -hybris.import.wizard.hybris.distribution.directory.label=SAP Commerce installation directory: +hybris.import.wizard.hybris.distribution.directory.label=SAP CX installation directory: hybris.import.wizard.hybris.distribution.directory.tooltip=It's the root directory where your SAP Commerce is located. By default, the name of the directory is "hybris". hybris.import.wizard.custom.extensions.directory.label=Custom Extensions Directory hybris.import.wizard.custom.extensions.directory.tooltip=It's the directory where you keep all you custom directories. By default, it is "bin/custom". This directory can contain subdirectories. -hybris.import.wizard.validation.hybris.distribution.directory.empty="SAP Commerce Installation Directory" parameter can not be empty. -hybris.import.wizard.validation.hybris.distribution.directory.does.not.exist=SAP Commerce installation directory does not exist or is not a directory. +hybris.import.wizard.validation.hybris.distribution.directory.empty="SAP CX Installation Directory" parameter can not be empty. +hybris.import.wizard.validation.hybris.distribution.directory.does.not.exist=SAP CX installation directory does not exist or is not a directory. hybris.import.wizard.validation.custom.extensions.directory.empty="Custom Extensions Directory" parameter can not be empty. hybris.import.wizard.validation.custom.extensions.directory.does.not.exist=Custom extensions directory does not exist or is not a directory. hybris.import.wizard.validation.config.directory.does.not.exist=Config directory does not exist or is not a directory. @@ -581,7 +581,6 @@ hybris.settings.project.refresh.title=Project Refresh Settings hybris.settings.project.details.title=Project Details hybris.settings.project.details.platform_version.title=Platform version: hybris.settings.project.diagram.title=Diagram Settings -hybris.settings.project.diagram.ts.title=Type System Diagram hybris.settings.project.common.title=Common Settings hybris.settings.project.build.title=Build Settings hybris.settings.project.bs.title=Bean System diff --git a/src/com/intellij/idea/plugin/hybris/actions/ActionUtils.kt b/src/com/intellij/idea/plugin/hybris/actions/ActionUtils.kt index 27f448de5..83a2407b1 100644 --- a/src/com/intellij/idea/plugin/hybris/actions/ActionUtils.kt +++ b/src/com/intellij/idea/plugin/hybris/actions/ActionUtils.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.actions -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys import com.intellij.openapi.actionSystem.DataContext @@ -33,5 +33,5 @@ object ActionUtils { ?.let { isHybrisContext(it) } ?: false - fun isHybrisContext(project: Project) = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + fun isHybrisContext(project: Project) = ProjectSettingsComponent.getInstance(project).isHybrisProject() } diff --git a/src/com/intellij/idea/plugin/hybris/actions/HacChooseConnectionAction.kt b/src/com/intellij/idea/plugin/hybris/actions/HacChooseConnectionAction.kt index 40c26676b..bdab2d78d 100644 --- a/src/com/intellij/idea/plugin/hybris/actions/HacChooseConnectionAction.kt +++ b/src/com/intellij/idea/plugin/hybris/actions/HacChooseConnectionAction.kt @@ -18,8 +18,8 @@ package com.intellij.idea.plugin.hybris.actions import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisProjectRemoteInstancesSettingsConfigurableProvider -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.options.ProjectRemoteInstancesSettingsConfigurableProvider import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionType import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionUtil import com.intellij.idea.plugin.hybris.toolwindow.RemoteHacConnectionDialog @@ -126,12 +126,12 @@ class HacChooseConnectionAction : ActionGroup() { override fun getIcon(): Icon = HybrisIcons.SETTINGS } - open class ConnectionItem(val settings: HybrisRemoteConnectionSettings) : ListItem() { + open class ConnectionItem(val settings: RemoteConnectionSettings) : ListItem() { override fun getText() = settings.toString() override fun getIcon(): Icon = HybrisIcons.Y_REMOTE } - class ActiveConnectionItem(settings: HybrisRemoteConnectionSettings) : ConnectionItem(settings) { + class ActiveConnectionItem(settings: RemoteConnectionSettings) : ConnectionItem(settings) { override fun getIcon(): Icon = HybrisIcons.Y_REMOTE_GREEN } @@ -159,7 +159,7 @@ class HacChooseConnectionAction : ActionGroup() { RemoteHacConnectionDialog(project, owner, settings).showAndGet() } is ConnectionSettingsItem -> ShowSettingsUtil.getInstance() - .showSettingsDialog(project, HybrisProjectRemoteInstancesSettingsConfigurableProvider.SettingsConfigurable::class.java) + .showSettingsDialog(project, ProjectRemoteInstancesSettingsConfigurableProvider.SettingsConfigurable::class.java) is ConnectionItem -> RemoteConnectionUtil.setActiveRemoteConnectionSettings(project, selectedValue.settings) } diff --git a/src/com/intellij/idea/plugin/hybris/ant/ui/AntUpdateMavenDependenciesNotificationProvider.kt b/src/com/intellij/idea/plugin/hybris/ant/ui/AntUpdateMavenDependenciesNotificationProvider.kt index 988a824bd..1108ff08e 100644 --- a/src/com/intellij/idea/plugin/hybris/ant/ui/AntUpdateMavenDependenciesNotificationProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/ant/ui/AntUpdateMavenDependenciesNotificationProvider.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.ant.ui import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.lang.ant.config.AntBuildFileBase import com.intellij.lang.ant.config.AntConfiguration import com.intellij.lang.ant.config.execution.ExecutionHandler @@ -38,7 +38,7 @@ import javax.swing.JComponent class AntUpdateMavenDependenciesNotificationProvider : EditorNotificationProvider { override fun collectNotificationData(project: Project, file: VirtualFile): Function? { - val settings = HybrisProjectSettingsComponent.getInstance(project) + val settings = ProjectSettingsComponent.getInstance(project) if (!settings.isHybrisProject()) return null if (file.name != HybrisConstants.EXTERNAL_DEPENDENCIES_XML) return null diff --git a/src/com/intellij/idea/plugin/hybris/codeInsight/completion/provider/ExtensionNameCompletionProvider.kt b/src/com/intellij/idea/plugin/hybris/codeInsight/completion/provider/ExtensionNameCompletionProvider.kt index 1773a3585..5029158b9 100644 --- a/src/com/intellij/idea/plugin/hybris/codeInsight/completion/provider/ExtensionNameCompletionProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/codeInsight/completion/provider/ExtensionNameCompletionProvider.kt @@ -22,7 +22,7 @@ import com.intellij.codeInsight.completion.CompletionParameters import com.intellij.codeInsight.completion.CompletionProvider import com.intellij.codeInsight.completion.CompletionResultSet import com.intellij.idea.plugin.hybris.facet.ExtensionDescriptor -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.extensioninfo.codeInsight.lookup.EiSLookupElementFactory import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.project.Project @@ -37,7 +37,7 @@ open class ExtensionNameCompletionProvider : CompletionProvider = HybrisProjectSettingsComponent.getInstance(project) + open fun getExtensionDescriptors(parameters: CompletionParameters, project: Project): Collection = ProjectSettingsComponent.getInstance(project) .getAvailableExtensions() .values diff --git a/src/com/intellij/idea/plugin/hybris/codeInsight/completion/provider/RequiredExtensionsNameCompletionProvider.kt b/src/com/intellij/idea/plugin/hybris/codeInsight/completion/provider/RequiredExtensionsNameCompletionProvider.kt index 34731c412..955065c95 100644 --- a/src/com/intellij/idea/plugin/hybris/codeInsight/completion/provider/RequiredExtensionsNameCompletionProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/codeInsight/completion/provider/RequiredExtensionsNameCompletionProvider.kt @@ -21,7 +21,7 @@ package com.intellij.idea.plugin.hybris.codeInsight.completion.provider import com.intellij.codeInsight.completion.CompletionParameters import com.intellij.codeInsight.completion.CompletionProvider import com.intellij.idea.plugin.hybris.facet.ExtensionDescriptor -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.extensioninfo.model.ExtensionInfo import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.Service @@ -45,7 +45,7 @@ class RequiredExtensionsNameCompletionProvider : ExtensionNameCompletionProvider ?.filter { it.isNotBlank() } ?.map { it.lowercase() } ?: emptyList() - return HybrisProjectSettingsComponent.getInstance(project) + return ProjectSettingsComponent.getInstance(project) .getAvailableExtensions() .entries .filterNot { currentNames.contains(it.key) } diff --git a/src/com/intellij/idea/plugin/hybris/codeInsight/daemon/AbstractExtensionLineMarkerProvider.kt b/src/com/intellij/idea/plugin/hybris/codeInsight/daemon/AbstractExtensionLineMarkerProvider.kt index c49449095..8e92f2d10 100644 --- a/src/com/intellij/idea/plugin/hybris/codeInsight/daemon/AbstractExtensionLineMarkerProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/codeInsight/daemon/AbstractExtensionLineMarkerProvider.kt @@ -23,7 +23,7 @@ import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons import com.intellij.idea.plugin.hybris.common.yExtensionName import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorType -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.extensioninfo.EiSModelAccess import com.intellij.openapi.editor.markup.GutterIconRenderer import com.intellij.openapi.project.modules @@ -49,7 +49,7 @@ abstract class AbstractExtensionLineMarkerProvider : AbstractHybrisLineMarkerPro .find { it.tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN } ?: return emptyList() if (PsiTreeUtil.getParentOfType(psi, XmlTag::class.java)?.localName != getParentTagName()) return emptyList() - val descriptor = HybrisProjectSettingsComponent.getInstance(psi.project).getAvailableExtensions()[psi.value] + val descriptor = ProjectSettingsComponent.getInstance(psi.project).getAvailableExtensions()[psi.value] ?: return emptyList() val extensionInfoName = psi.project.modules .find { it.yExtensionName() == psi.value } diff --git a/src/com/intellij/idea/plugin/hybris/codeInsight/daemon/AbstractHybrisLineMarkerProvider.kt b/src/com/intellij/idea/plugin/hybris/codeInsight/daemon/AbstractHybrisLineMarkerProvider.kt index 0802900d4..12d7fcc5c 100644 --- a/src/com/intellij/idea/plugin/hybris/codeInsight/daemon/AbstractHybrisLineMarkerProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/codeInsight/daemon/AbstractHybrisLineMarkerProvider.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.codeInsight.daemon import com.intellij.codeInsight.daemon.LineMarkerInfo import com.intellij.codeInsight.daemon.LineMarkerProviderDescriptor -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.psi.PsiElement import com.intellij.psi.PsiFile @@ -44,7 +44,7 @@ abstract class AbstractHybrisLineMarkerProvider : LineMarkerProv protected open fun canProcess(elements: MutableList): Boolean { val psiFile = elements.firstOrNull()?.containingFile ?: return false - if (!HybrisProjectSettingsComponent.getInstance(psiFile.project).isHybrisProject()) return false + if (!ProjectSettingsComponent.getInstance(psiFile.project).isHybrisProject()) return false return canProcess(psiFile) } } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/codeInsight/hints/DynamicAttributeDeclarativeInlayProvider.kt b/src/com/intellij/idea/plugin/hybris/codeInsight/hints/DynamicAttributeDeclarativeInlayProvider.kt index 2c49d682b..58ff3e768 100644 --- a/src/com/intellij/idea/plugin/hybris/codeInsight/hints/DynamicAttributeDeclarativeInlayProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/codeInsight/hints/DynamicAttributeDeclarativeInlayProvider.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.codeInsight.hints import com.intellij.codeInsight.hints.declarative.InlayHintsProvider -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.editor.Editor import com.intellij.psi.PsiFile @@ -28,6 +28,6 @@ class DynamicAttributeDeclarativeInlayProvider : InlayHintsProvider { DynamicAttributeDeclarativeInlayHintsCollector() } - override fun createCollector(file: PsiFile, editor: Editor) = if (HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject()) collector + override fun createCollector(file: PsiFile, editor: Editor) = if (ProjectSettingsComponent.getInstance(file.project).isHybrisProject()) collector else null } diff --git a/src/com/intellij/idea/plugin/hybris/codeInspection/rule/AbstractInspection.kt b/src/com/intellij/idea/plugin/hybris/codeInspection/rule/AbstractInspection.kt index 948c0d1f5..074f09826 100644 --- a/src/com/intellij/idea/plugin/hybris/codeInspection/rule/AbstractInspection.kt +++ b/src/com/intellij/idea/plugin/hybris/codeInspection/rule/AbstractInspection.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.codeInspection.rule import com.intellij.codeInsight.daemon.HighlightDisplayKey import com.intellij.codeInspection.ex.InspectionProfileWrapper -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.lang.annotation.HighlightSeverity import com.intellij.openapi.project.Project import com.intellij.openapi.util.TextRange @@ -40,7 +40,7 @@ abstract class AbstractInspection(domClass: Class) : DomEleme override fun checkFileElement(domFileElement: DomFileElement, holder: DomElementAnnotationHolder) { val file = domFileElement.file val project = file.project - if (!HybrisProjectSettingsComponent.getInstance(project).isHybrisProject()) return + if (!ProjectSettingsComponent.getInstance(project).isHybrisProject()) return if (!canProcess(project, file)) return val helper = DomElementAnnotationsManager.getInstance(project).highlightingHelper diff --git a/src/com/intellij/idea/plugin/hybris/codeInspection/rule/extensioninfo/EiUnknownExtensionDefinition.kt b/src/com/intellij/idea/plugin/hybris/codeInspection/rule/extensioninfo/EiUnknownExtensionDefinition.kt index 24e1a436b..96ebd23fe 100644 --- a/src/com/intellij/idea/plugin/hybris/codeInspection/rule/extensioninfo/EiUnknownExtensionDefinition.kt +++ b/src/com/intellij/idea/plugin/hybris/codeInspection/rule/extensioninfo/EiUnknownExtensionDefinition.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.codeInspection.rule.extensioninfo import com.intellij.idea.plugin.hybris.codeInspection.fix.xml.XmlDeleteTagQuickFix import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.extensioninfo.model.ExtensionInfo import com.intellij.idea.plugin.hybris.system.extensioninfo.model.RequiresExtension import com.intellij.lang.annotation.HighlightSeverity @@ -49,7 +49,7 @@ class EiUnknownExtensionDefinition : AbstractEiInspection() { project: Project ) { val extensionName = dom.name.stringValue ?: return - val hybrisProjectSettings = HybrisProjectSettingsComponent.getInstance(project) + val hybrisProjectSettings = ProjectSettingsComponent.getInstance(project) val found = hybrisProjectSettings.getAvailableExtensions().keys .firstOrNull { extensionName.equals(it, true) } diff --git a/src/com/intellij/idea/plugin/hybris/codeInspection/rule/localextensions/LeUnknownExtensionDefinition.kt b/src/com/intellij/idea/plugin/hybris/codeInspection/rule/localextensions/LeUnknownExtensionDefinition.kt index 6294d9532..f89fd2606 100644 --- a/src/com/intellij/idea/plugin/hybris/codeInspection/rule/localextensions/LeUnknownExtensionDefinition.kt +++ b/src/com/intellij/idea/plugin/hybris/codeInspection/rule/localextensions/LeUnknownExtensionDefinition.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.codeInspection.rule.localextensions import com.intellij.idea.plugin.hybris.codeInspection.fix.xml.XmlDeleteTagQuickFix import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.localextensions.model.Extension import com.intellij.idea.plugin.hybris.system.localextensions.model.Hybrisconfig import com.intellij.lang.annotation.HighlightSeverity @@ -49,7 +49,7 @@ class LeUnknownExtensionDefinition : AbstractLeInspection() { project: Project ) { val extensionName = dom.name.stringValue ?: return - val hybrisProjectSettings = HybrisProjectSettingsComponent.getInstance(project) + val hybrisProjectSettings = ProjectSettingsComponent.getInstance(project) val found = hybrisProjectSettings.getAvailableExtensions().keys .firstOrNull { extensionName.equals(it, true) } diff --git a/src/com/intellij/idea/plugin/hybris/codeInspection/rule/manifest/ManifestCommerceExtensionInspection.kt b/src/com/intellij/idea/plugin/hybris/codeInspection/rule/manifest/ManifestCommerceExtensionInspection.kt index 012bfc4a2..ae13cce4a 100644 --- a/src/com/intellij/idea/plugin/hybris/codeInspection/rule/manifest/ManifestCommerceExtensionInspection.kt +++ b/src/com/intellij/idea/plugin/hybris/codeInspection/rule/manifest/ManifestCommerceExtensionInspection.kt @@ -22,7 +22,7 @@ import com.intellij.codeInspection.LocalInspectionTool import com.intellij.codeInspection.LocalInspectionToolSession import com.intellij.codeInspection.ProblemsHolder import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.manifest.jsonSchema.providers.ManifestCommerceJsonSchemaFileProvider import com.intellij.json.psi.* import com.intellij.psi.PsiElement @@ -43,7 +43,7 @@ class ManifestCommerceExtensionInspection : LocalInspectionTool() { override fun visitStringLiteral(o: JsonStringLiteral) { val parent = o.parent - if (isApplicable(parent, o) && !HybrisProjectSettingsComponent.getInstance(o.project).getAvailableExtensions().contains(o.value)) { + if (isApplicable(parent, o) && !ProjectSettingsComponent.getInstance(o.project).getAvailableExtensions().contains(o.value)) { holder.registerProblem( o, HybrisI18NBundleUtils.message("hybris.inspections.fix.manifest.ManifestUnknownExtensionInspection.message", o.value) diff --git a/src/com/intellij/idea/plugin/hybris/codeInspection/rule/manifest/ManifestCommerceTemplateExtensionInspection.kt b/src/com/intellij/idea/plugin/hybris/codeInspection/rule/manifest/ManifestCommerceTemplateExtensionInspection.kt index 006f0b40f..4cb71a44b 100644 --- a/src/com/intellij/idea/plugin/hybris/codeInspection/rule/manifest/ManifestCommerceTemplateExtensionInspection.kt +++ b/src/com/intellij/idea/plugin/hybris/codeInspection/rule/manifest/ManifestCommerceTemplateExtensionInspection.kt @@ -22,7 +22,7 @@ import com.intellij.codeInspection.LocalInspectionTool import com.intellij.codeInspection.LocalInspectionToolSession import com.intellij.codeInspection.ProblemsHolder import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.manifest.jsonSchema.providers.ManifestCommerceJsonSchemaFileProvider import com.intellij.json.psi.JsonElementVisitor import com.intellij.json.psi.JsonProperty @@ -46,7 +46,7 @@ class ManifestCommerceTemplateExtensionInspection : LocalInspectionTool() { override fun visitStringLiteral(o: JsonStringLiteral) { val parent = o.parent - if (isApplicable(parent, o) && !HybrisProjectSettingsComponent.getInstance(o.project).getAvailableExtensions().contains(o.value)) { + if (isApplicable(parent, o) && !ProjectSettingsComponent.getInstance(o.project).getAvailableExtensions().contains(o.value)) { holder.registerProblem( o, HybrisI18NBundleUtils.message("hybris.inspections.fix.manifest.ManifestUnknownTemplateExtensionInspection.message", o.value) diff --git a/src/com/intellij/idea/plugin/hybris/common/services/CommonIdeaService.kt b/src/com/intellij/idea/plugin/hybris/common/services/CommonIdeaService.kt index 22236c8ca..afa2a1deb 100644 --- a/src/com/intellij/idea/plugin/hybris/common/services/CommonIdeaService.kt +++ b/src/com/intellij/idea/plugin/hybris/common/services/CommonIdeaService.kt @@ -21,7 +21,7 @@ import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.yExtensionName import com.intellij.idea.plugin.hybris.project.descriptors.HybrisProjectDescriptor import com.intellij.idea.plugin.hybris.project.descriptors.impl.PlatformModuleDescriptor -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionType import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionUtil import com.intellij.openapi.application.ApplicationManager @@ -86,7 +86,7 @@ class CommonIdeaService { } } - private fun fixSslRemoteConnectionSettings(connectionSettings: Collection) { + private fun fixSslRemoteConnectionSettings(connectionSettings: Collection) { connectionSettings.forEach { it.isSsl = it.generatedURL.startsWith(HybrisConstants.HTTPS_PROTOCOL) it.hostIP = it.hostIP?.replace(regex, "") diff --git a/src/com/intellij/idea/plugin/hybris/common/utils/HybrisIcons.kt b/src/com/intellij/idea/plugin/hybris/common/utils/HybrisIcons.kt index a0a3a3362..876267f6a 100644 --- a/src/com/intellij/idea/plugin/hybris/common/utils/HybrisIcons.kt +++ b/src/com/intellij/idea/plugin/hybris/common/utils/HybrisIcons.kt @@ -223,6 +223,7 @@ object HybrisIcons { val CCV2_DEPLOYMENTS = AllIcons.Nodes.Deploy val CCV2_BACKUPS = AllIcons.Nodes.Undeploy val CCV2_ENDPOINTS = AllIcons.General.Web + val CCV2_BRANCH = AllIcons.Vcs.Branch val CONNECTION_ADD = AllIcons.General.Add val CONNECTION_EDIT = AllIcons.Actions.Edit diff --git a/src/com/intellij/idea/plugin/hybris/diagram/module/node/ModuleDepDiagramRefresher.kt b/src/com/intellij/idea/plugin/hybris/diagram/module/node/ModuleDepDiagramRefresher.kt index 2af11fc4d..e46b82792 100644 --- a/src/com/intellij/idea/plugin/hybris/diagram/module/node/ModuleDepDiagramRefresher.kt +++ b/src/com/intellij/idea/plugin/hybris/diagram/module/node/ModuleDepDiagramRefresher.kt @@ -21,7 +21,7 @@ package com.intellij.idea.plugin.hybris.diagram.module.node import com.intellij.idea.plugin.hybris.diagram.module.ModuleDepDiagramVisibilityManager import com.intellij.idea.plugin.hybris.diagram.module.node.graph.ModuleDepGraphFactory import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorType -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleManager import com.intellij.openapi.roots.ModuleRootManager @@ -46,7 +46,7 @@ object ModuleDepDiagramRefresher { private fun modulesToShow(model: ModuleDepDiagramDataModel): Collection { val visibilityLevel = model.visibilityManager.currentVisibilityLevel val allModules = ModuleManager.getInstance(model.project).modules - val projectSettings = HybrisProjectSettingsComponent.getInstance(model.project) + val projectSettings = ProjectSettingsComponent.getInstance(model.project) if (ModuleDepDiagramVisibilityManager.ALL_MODULES == visibilityLevel) { return allModules diff --git a/src/com/intellij/idea/plugin/hybris/diagram/module/node/graph/ModuleDepGraphFactory.kt b/src/com/intellij/idea/plugin/hybris/diagram/module/node/graph/ModuleDepGraphFactory.kt index 37337d059..36708f076 100644 --- a/src/com/intellij/idea/plugin/hybris/diagram/module/node/graph/ModuleDepGraphFactory.kt +++ b/src/com/intellij/idea/plugin/hybris/diagram/module/node/graph/ModuleDepGraphFactory.kt @@ -19,12 +19,12 @@ package com.intellij.idea.plugin.hybris.diagram.module.node.graph import com.intellij.idea.plugin.hybris.common.yExtensionName -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.module.Module object ModuleDepGraphFactory { - fun buildNode(module: Module) = with(HybrisProjectSettingsComponent.getInstance(module.project).getModuleSettings(module)) { + fun buildNode(module: Module) = with(ProjectSettingsComponent.getInstance(module.project).getModuleSettings(module)) { val properties = mutableListOf() if (description != null) properties.add(ModuleDepGraphFieldDescription(description!!)) diff --git a/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/actions/ExcludeTypeNameDiagramAction.kt b/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/actions/ExcludeTypeNameDiagramAction.kt index 71aa4fdbb..5b8d76b01 100644 --- a/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/actions/ExcludeTypeNameDiagramAction.kt +++ b/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/actions/ExcludeTypeNameDiagramAction.kt @@ -21,7 +21,7 @@ import com.intellij.diagram.DiagramAction import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons import com.intellij.idea.plugin.hybris.diagram.typeSystem.node.TSDiagramNode -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.openapi.actionSystem.ActionManager import com.intellij.openapi.actionSystem.AnActionEvent @@ -38,7 +38,7 @@ class ExcludeTypeNameDiagramAction : DiagramAction( .map { it.graphNode.name } if (excludedTypeNames.isNotEmpty()) { - HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state + DeveloperSettingsComponent.getInstance(project).state .typeSystemDiagramSettings .excludedTypeNames .addAll(excludedTypeNames) diff --git a/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/actions/OpenSettingsDiagramAction.kt b/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/actions/OpenSettingsDiagramAction.kt index b94cf46a6..e30b36b94 100644 --- a/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/actions/OpenSettingsDiagramAction.kt +++ b/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/actions/OpenSettingsDiagramAction.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.diagram.typeSystem.actions import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisProjectDiagramTSSettingsConfigurableProvider +import com.intellij.idea.plugin.hybris.settings.options.ProjectTypeSystemConfigurableProvider import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.options.ShowSettingsUtil @@ -31,6 +31,6 @@ class OpenSettingsDiagramAction : AnAction( ) { override fun actionPerformed(e: AnActionEvent) { val project = e.project ?: return - ShowSettingsUtil.getInstance().showSettingsDialog(project, HybrisProjectDiagramTSSettingsConfigurableProvider.SettingsConfigurable::class.java) + ShowSettingsUtil.getInstance().showSettingsDialog(project, ProjectTypeSystemConfigurableProvider.SettingsConfigurable::class.java) } } diff --git a/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/node/TSDiagramRefresher.kt b/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/node/TSDiagramRefresher.kt index 795c5c759..1e49bbdcc 100644 --- a/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/node/TSDiagramRefresher.kt +++ b/src/com/intellij/idea/plugin/hybris/diagram/typeSystem/node/TSDiagramRefresher.kt @@ -24,23 +24,23 @@ import com.intellij.diagram.presentation.DiagramLineType import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.diagram.typeSystem.node.graph.* -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.TypeSystemDiagramSettings +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.idea.plugin.hybris.system.type.meta.TSMetaModelAccess import com.intellij.idea.plugin.hybris.system.type.meta.model.* import com.intellij.idea.plugin.hybris.system.type.model.Cardinality -import com.intellij.idea.plugin.hybris.system.type.settings.TSDiagramSettings import java.awt.Shape object TSDiagramRefresher { fun refresh(model: TSDiagramDataModel, nodesMap: MutableMap, edges: MutableCollection) { - val settings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(model.project).state.typeSystemDiagramSettings + val settings = DeveloperSettingsComponent.getInstance(model.project).state.typeSystemDiagramSettings refreshNodes(model, nodesMap, settings) refreshEdges(model, nodesMap, edges) } - private fun refreshNodes(model: TSDiagramDataModel, nodesMap: MutableMap, settings: TSDiagramSettings) { + private fun refreshNodes(model: TSDiagramDataModel, nodesMap: MutableMap, settings: TypeSystemDiagramSettings) { nodesMap.clear() collectNodesItems(model, nodesMap, settings) @@ -50,7 +50,7 @@ object TSDiagramRefresher { updatedCollapsedNodes(model, nodesMap, settings) } - private fun collectNodesItems(model: TSDiagramDataModel, nodesMap: MutableMap, settings: TSDiagramSettings) { + private fun collectNodesItems(model: TSDiagramDataModel, nodesMap: MutableMap, settings: TypeSystemDiagramSettings) { TSMetaModelAccess.getInstance(model.project).getAll() .asSequence() .filter { it.name != null } @@ -82,7 +82,7 @@ object TSDiagramRefresher { * Nested dependencies will not be created as we're not interested at this stage in the complete picture. * If All possible dependencies are needed, another Type-Specific filter can be introduced with Scope = "All" */ - private fun collectNodesDependencies(model: TSDiagramDataModel, nodesMap: MutableMap, settings: TSDiagramSettings) { + private fun collectNodesDependencies(model: TSDiagramDataModel, nodesMap: MutableMap, settings: TypeSystemDiagramSettings) { if (!model.isShowDependencies) return nodesMap.values @@ -121,7 +121,7 @@ object TSDiagramRefresher { * * Also, it is possible to specify STOP Types for extent names to limit down amount of created "shared" Edges */ - private fun collectNodesExtends(model: TSDiagramDataModel, nodesMap: MutableMap, settings: TSDiagramSettings) { + private fun collectNodesExtends(model: TSDiagramDataModel, nodesMap: MutableMap, settings: TypeSystemDiagramSettings) { nodesMap.values .flatMap { sourceNode -> val graphNode = sourceNode.graphNode as? TSGraphNodeClassifier ?: return@flatMap emptyList() @@ -141,7 +141,7 @@ object TSDiagramRefresher { .forEach { nodesMap[it.graphNode.name] = it } } - private fun updatedCollapsedNodes(model: TSDiagramDataModel, nodesMap: MutableMap, settings: TSDiagramSettings) { + private fun updatedCollapsedNodes(model: TSDiagramDataModel, nodesMap: MutableMap, settings: TypeSystemDiagramSettings) { if (settings.nodesCollapsedByDefault) { if (model.modificationCount == 0L) { model.collapseAllNodes() diff --git a/src/com/intellij/idea/plugin/hybris/execution/lineMarker/RefreshProjectRunLineMarkerContributor.kt b/src/com/intellij/idea/plugin/hybris/execution/lineMarker/RefreshProjectRunLineMarkerContributor.kt index cf85cc7b6..a5765168c 100644 --- a/src/com/intellij/idea/plugin/hybris/execution/lineMarker/RefreshProjectRunLineMarkerContributor.kt +++ b/src/com/intellij/idea/plugin/hybris/execution/lineMarker/RefreshProjectRunLineMarkerContributor.kt @@ -22,7 +22,7 @@ import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons import com.intellij.idea.plugin.hybris.common.yExtensionName import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorType -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.extensioninfo.model.Extension import com.intellij.idea.plugin.hybris.system.extensioninfo.model.ExtensionInfo import com.intellij.idea.plugin.hybris.system.localextensions.model.Extensions @@ -41,7 +41,7 @@ class RefreshProjectRunLineMarkerContributor : RunLineMarkerContributor() { val xmlAttributeValue = PsiTreeUtil.getParentOfType(element, XmlAttributeValue::class.java) ?: return null val xmlFile = element.containingFile as? XmlFile ?: return null if (xmlAttributeValue.value == HybrisConstants.EXTENSION_NAME_PLATFORM) return null - val descriptor = HybrisProjectSettingsComponent.getInstance(xmlFile.project).getAvailableExtensions()[xmlAttributeValue.value] + val descriptor = ProjectSettingsComponent.getInstance(xmlFile.project).getAvailableExtensions()[xmlAttributeValue.value] ?: return null if (descriptor.type != ModuleDescriptorType.OOTB && descriptor.type != ModuleDescriptorType.CUSTOM) return null val parentTagName = PsiTreeUtil.getParentOfType(xmlAttributeValue, XmlTag::class.java)?.localName diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/codeInsight/daemon/FlexibleSearchQueryLineMarkerProvider.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/codeInsight/daemon/FlexibleSearchQueryLineMarkerProvider.kt index 496577af0..ca511fd70 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/codeInsight/daemon/FlexibleSearchQueryLineMarkerProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/codeInsight/daemon/FlexibleSearchQueryLineMarkerProvider.kt @@ -26,7 +26,7 @@ import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons import com.intellij.idea.plugin.hybris.flexibleSearch.FxSUtils import com.intellij.idea.plugin.hybris.flexibleSearch.psi.FlexibleSearchElementFactory import com.intellij.idea.plugin.hybris.notifications.Notifications -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.notification.NotificationType import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent @@ -63,7 +63,7 @@ class FlexibleSearchQueryLineMarkerProvider : LineMarkerProviderDescriptor() { ): FlexibleSearchQueryLineMarkerInfo? { val parent = element.parent if (parent !is PsiVariable || parent.nameIdentifier == null) return null - if (!HybrisProjectSettingsComponent.getInstance(element.project).isHybrisProject()) return null + if (!ProjectSettingsComponent.getInstance(element.project).isHybrisProject()) return null val expression = expressionProvider.invoke() if (!FxSUtils.isFlexibleSearchQuery(expression)) return null diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSHybrisColumnCompletionProvider.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSHybrisColumnCompletionProvider.kt index 340c7dfa5..ed8f127f1 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSHybrisColumnCompletionProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSHybrisColumnCompletionProvider.kt @@ -25,14 +25,14 @@ import com.intellij.idea.plugin.hybris.flexibleSearch.FxSUtils import com.intellij.idea.plugin.hybris.flexibleSearch.codeInsight.lookup.FxSLookupElementFactory import com.intellij.idea.plugin.hybris.flexibleSearch.psi.FlexibleSearchColumnRefExpression import com.intellij.idea.plugin.hybris.flexibleSearch.psi.FlexibleSearchResultColumns -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.psi.util.PsiTreeUtil import com.intellij.psi.util.parentOfType import com.intellij.util.ProcessingContext class FxSHybrisColumnCompletionProvider : CompletionProvider() { override fun addCompletions(parameters: CompletionParameters, context: ProcessingContext, result: CompletionResultSet) { - val fxsSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(parameters.position.project).state.flexibleSearchSettings + val fxsSettings = DeveloperSettingsComponent.getInstance(parameters.position.project).state.flexibleSearchSettings val addComma = FxSUtils.shouldAddCommaAfterExpression(parameters.position, fxsSettings) val parent = parameters.position.parentOfType() diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSKeywordsCompletionProvider.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSKeywordsCompletionProvider.kt index 6a11ac071..b3994f7e3 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSKeywordsCompletionProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSKeywordsCompletionProvider.kt @@ -22,13 +22,13 @@ import com.intellij.codeInsight.completion.CompletionParameters import com.intellij.codeInsight.completion.CompletionProvider import com.intellij.codeInsight.completion.CompletionResultSet import com.intellij.idea.plugin.hybris.flexibleSearch.codeInsight.lookup.FxSLookupElementFactory -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.util.ProcessingContext class FxSKeywordsCompletionProvider(private val keywords: Set) : CompletionProvider() { override fun addCompletions(parameters: CompletionParameters, context: ProcessingContext, result: CompletionResultSet) { - val fxsSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(parameters.position.project).state.flexibleSearchSettings + val fxsSettings = DeveloperSettingsComponent.getInstance(parameters.position.project).state.flexibleSearchSettings result.addAllElements(FxSLookupElementFactory.buildKeywords(keywords, fxsSettings)) } } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSRootCompletionProvider.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSRootCompletionProvider.kt index f10baf811..08d96a451 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSRootCompletionProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSRootCompletionProvider.kt @@ -22,7 +22,7 @@ import com.intellij.codeInsight.completion.CompletionParameters import com.intellij.codeInsight.completion.CompletionProvider import com.intellij.codeInsight.completion.CompletionResultSet import com.intellij.idea.plugin.hybris.flexibleSearch.codeInsight.lookup.FxSLookupElementFactory -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.psi.PsiErrorElement import com.intellij.util.ProcessingContext @@ -32,7 +32,7 @@ class FxSRootCompletionProvider : CompletionProvider() { val psiErrorElement = parameters.position.parent as? PsiErrorElement ?: return - val fxsSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(parameters.position.project).state.flexibleSearchSettings + val fxsSettings = DeveloperSettingsComponent.getInstance(parameters.position.project).state.flexibleSearchSettings // FlexibleSearchTokenType.toString() when (psiErrorElement.errorDescription.substringBefore(">") + ">") { "" -> result.addAllElements( diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSTablesAliasCompletionProvider.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSTablesAliasCompletionProvider.kt index 9b346bbd7..761627139 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSTablesAliasCompletionProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/completion/provider/FxSTablesAliasCompletionProvider.kt @@ -23,13 +23,13 @@ import com.intellij.codeInsight.completion.CompletionProvider import com.intellij.codeInsight.completion.CompletionResultSet import com.intellij.idea.plugin.hybris.flexibleSearch.codeInsight.lookup.FxSLookupElementFactory import com.intellij.idea.plugin.hybris.flexibleSearch.psi.FlexibleSearchTableAliasName -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.util.ProcessingContext class FxSTablesAliasCompletionProvider : CompletionProvider() { override fun addCompletions(parameters: CompletionParameters, context: ProcessingContext, result: CompletionResultSet) { - val fxsSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(parameters.position.project).state.flexibleSearchSettings + val fxsSettings = DeveloperSettingsComponent.getInstance(parameters.position.project).state.flexibleSearchSettings if (!fxsSettings.completion.suggestTableAliasNames) return diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/injection/impl/FlexibleSearchToImpexInjectorProvider.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/injection/impl/FlexibleSearchToImpexInjectorProvider.kt index fc40d051a..b88ab5e50 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/injection/impl/FlexibleSearchToImpexInjectorProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/injection/impl/FlexibleSearchToImpexInjectorProvider.kt @@ -24,7 +24,7 @@ import com.intellij.idea.plugin.hybris.flexibleSearch.FxSUtils import com.intellij.idea.plugin.hybris.impex.ImpexLanguage import com.intellij.idea.plugin.hybris.impex.psi.* import com.intellij.idea.plugin.hybris.lang.injection.impl.AbstractLanguageInjectorProvider -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.lang.Language import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.Service @@ -115,7 +115,7 @@ class FlexibleSearchToImpexInjectorProvider : AbstractLanguageInjectorProvider(F ?.computeValue() ?: return injectSimple(injectionPlacesRegistrar, host, expression, quoteLength = quoteLength) - val alias = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(host.project) + val alias = DeveloperSettingsComponent.getInstance(host.project) .state .flexibleSearchSettings .fallbackToTableNameIfNoAliasProvided diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/lang/documentation/FlexibleSearchDocumentationTargetProvider.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/lang/documentation/FlexibleSearchDocumentationTargetProvider.kt index df432bd71..67f8292fe 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/lang/documentation/FlexibleSearchDocumentationTargetProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/lang/documentation/FlexibleSearchDocumentationTargetProvider.kt @@ -21,8 +21,8 @@ package com.intellij.idea.plugin.hybris.flexibleSearch.lang.documentation import com.intellij.idea.plugin.hybris.flexibleSearch.file.FlexibleSearchFile import com.intellij.idea.plugin.hybris.flexibleSearch.psi.FlexibleSearchDefinedTableName import com.intellij.idea.plugin.hybris.flexibleSearch.psi.FlexibleSearchTypes -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.platform.backend.documentation.DocumentationTarget import com.intellij.platform.backend.documentation.DocumentationTargetProvider import com.intellij.psi.PsiFile @@ -35,11 +35,11 @@ class FlexibleSearchDocumentationTargetProvider : DocumentationTargetProvider { if (file !is FlexibleSearchFile) return emptyList() val element = file.findElementAt(offset) ?: return emptyList() - val projectSettings = HybrisProjectSettingsComponent.getInstance(file.project) + val projectSettings = ProjectSettingsComponent.getInstance(file.project) if (!projectSettings.isHybrisProject()) return emptyList() - val developerSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(file.project).state + val developerSettings = DeveloperSettingsComponent.getInstance(file.project).state val documentationSettings = developerSettings.flexibleSearchSettings.documentation if (!documentationSettings.enabled) return emptyList() diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/lang/folding/FlexibleSearchFoldingBuilder.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/lang/folding/FlexibleSearchFoldingBuilder.kt index b7338e032..efd3a3d68 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/lang/folding/FlexibleSearchFoldingBuilder.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/lang/folding/FlexibleSearchFoldingBuilder.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.flexibleSearch.lang.folding import com.intellij.idea.plugin.hybris.flexibleSearch.file.FlexibleSearchFile import com.intellij.idea.plugin.hybris.flexibleSearch.psi.* -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.lang.ASTNode import com.intellij.lang.folding.FoldingBuilderEx import com.intellij.lang.folding.FoldingDescriptor @@ -40,7 +40,7 @@ class FlexibleSearchFoldingBuilder : FoldingBuilderEx(), DumbAware { private val filter = FlexibleSearchFoldingBlocksFilter() override fun buildFoldRegions(root: PsiElement, document: Document, quick: Boolean): Array { - val foldingSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(root.project).state.flexibleSearchSettings.folding + val foldingSettings = DeveloperSettingsComponent.getInstance(root.project).state.flexibleSearchSettings.folding if (!foldingSettings.enabled) return emptyArray() return CachedValuesManager.getCachedValue(root) { @@ -121,7 +121,7 @@ class FlexibleSearchFoldingBuilder : FoldingBuilderEx(), DumbAware { ?: FALLBACK_PLACEHOLDER private fun getColumnPlaceholderText(node: ASTNode, columnNameType: IElementType, tableAliasType: IElementType): String { - val fxsSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(node.psi.project).state.flexibleSearchSettings + val fxsSettings = DeveloperSettingsComponent.getInstance(node.psi.project).state.flexibleSearchSettings val columnName = node.findChildByType(columnNameType) ?.text ?.trim() diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/psi/reference/FxSColumnNameReference.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/psi/reference/FxSColumnNameReference.kt index 6bf376e7b..491847470 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/psi/reference/FxSColumnNameReference.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/psi/reference/FxSColumnNameReference.kt @@ -26,7 +26,7 @@ import com.intellij.idea.plugin.hybris.flexibleSearch.psi.* import com.intellij.idea.plugin.hybris.flexibleSearch.psi.reference.result.FxSColumnAliasNameResolveResult import com.intellij.idea.plugin.hybris.flexibleSearch.psi.reference.result.FxSYColumnNameResolveResult import com.intellij.idea.plugin.hybris.psi.util.PsiUtils -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.openapi.util.Key import com.intellij.openapi.util.TextRange import com.intellij.psi.PsiElement @@ -53,7 +53,7 @@ class FxSColumnNameReference(owner: FlexibleSearchColumnName) : PsiReferenceBase ?.resolve() ?.parent ?.let { fromClause -> - val fxsSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(element.project).state.flexibleSearchSettings + val fxsSettings = DeveloperSettingsComponent.getInstance(element.project).state.flexibleSearchSettings val addComma = FxSUtils.shouldAddCommaAfterExpression(element, fxsSettings) val aliases = findColumnAliasNames(fromClause) { true } @@ -122,7 +122,7 @@ class FxSColumnNameReference(owner: FlexibleSearchColumnName) : PsiReferenceBase .toList() private fun getAlternativeVariants(element: PsiElement): Array { - val fxsSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(element.project).state.flexibleSearchSettings + val fxsSettings = DeveloperSettingsComponent.getInstance(element.project).state.flexibleSearchSettings val addComma = FxSUtils.shouldAddCommaAfterExpression(element, fxsSettings) // only DOT allowed for non [y] columns diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/psi/reference/FxSYColumnReference.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/psi/reference/FxSYColumnReference.kt index de2f39774..5b7d95389 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/psi/reference/FxSYColumnReference.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/psi/reference/FxSYColumnReference.kt @@ -30,7 +30,7 @@ import com.intellij.idea.plugin.hybris.flexibleSearch.psi.FlexibleSearchTypes import com.intellij.idea.plugin.hybris.flexibleSearch.psi.FlexibleSearchYColumnName import com.intellij.idea.plugin.hybris.psi.util.PsiTreeUtilExt import com.intellij.idea.plugin.hybris.psi.util.PsiUtils -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.idea.plugin.hybris.system.type.codeInsight.completion.TSCompletionService import com.intellij.idea.plugin.hybris.system.type.meta.TSMetaModelAccess import com.intellij.idea.plugin.hybris.system.type.meta.model.TSMetaType @@ -115,7 +115,7 @@ class FxSYColumnReference(owner: FlexibleSearchYColumnName) : PsiReferenceBase.P If cursor placed at the end of the literal, in addition to table aliases, we will add allowed separators */ private fun getSuitablePrefixes(): Array { - val fxsSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(element.project).state.flexibleSearchSettings + val fxsSettings = DeveloperSettingsComponent.getInstance(element.project).state.flexibleSearchSettings val aliasText = element.text.replace(HybrisConstants.FXS_DUMMY_IDENTIFIER, "") val separators: Array = element.text.substringAfter(HybrisConstants.FXS_DUMMY_IDENTIFIER) @@ -139,7 +139,7 @@ class FxSYColumnReference(owner: FlexibleSearchYColumnName) : PsiReferenceBase.P fun isAliasedReference() = PsiTreeUtilExt .getPrevSiblingOfElementType(element, FlexibleSearchTypes.SELECTED_TABLE_NAME) != null - fun canFallbackToTableName() = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(element.project) + fun canFallbackToTableName() = DeveloperSettingsComponent.getInstance(element.project) .state .flexibleSearchSettings .fallbackToTableNameIfNoAliasProvided diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/settings/FlexibleSearchSettingsConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/settings/FlexibleSearchSettingsConfigurableProvider.kt index 8c562a1d6..35b674586 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/settings/FlexibleSearchSettingsConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/settings/FlexibleSearchSettingsConfigurableProvider.kt @@ -20,9 +20,9 @@ package com.intellij.idea.plugin.hybris.flexibleSearch.settings import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.flexibleSearch.ui.FxSReservedWordsCaseEditorNotificationProvider -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent import com.intellij.idea.plugin.hybris.settings.ReservedWordsCase +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.options.BoundSearchableConfigurable import com.intellij.openapi.options.ConfigurableProvider import com.intellij.openapi.project.Project @@ -36,14 +36,14 @@ import javax.swing.JCheckBox class FlexibleSearchSettingsConfigurableProvider(val project: Project) : ConfigurableProvider() { - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun canCreateConfigurable() = ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun createConfigurable() = SettingsConfigurable(project) class SettingsConfigurable(private val project: Project) : BoundSearchableConfigurable( message("hybris.settings.project.fxs.title"), "hybris.fxs.settings" ) { - private val state = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.flexibleSearchSettings + private val state = DeveloperSettingsComponent.getInstance(project).state.flexibleSearchSettings private lateinit var verifyCaseCheckBox: JCheckBox diff --git a/src/com/intellij/idea/plugin/hybris/flexibleSearch/ui/AbstractFxSEditorNotificationProvider.kt b/src/com/intellij/idea/plugin/hybris/flexibleSearch/ui/AbstractFxSEditorNotificationProvider.kt index 04ea849f9..267f9eeeb 100644 --- a/src/com/intellij/idea/plugin/hybris/flexibleSearch/ui/AbstractFxSEditorNotificationProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/flexibleSearch/ui/AbstractFxSEditorNotificationProvider.kt @@ -19,8 +19,8 @@ package com.intellij.idea.plugin.hybris.flexibleSearch.ui import com.intellij.idea.plugin.hybris.flexibleSearch.file.FlexibleSearchFileType import com.intellij.idea.plugin.hybris.flexibleSearch.settings.FlexibleSearchSettings -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.fileEditor.FileEditor import com.intellij.openapi.fileTypes.FileTypeRegistry import com.intellij.openapi.project.DumbAware @@ -37,11 +37,11 @@ import javax.swing.JComponent abstract class AbstractFxSEditorNotificationProvider : EditorNotificationProvider, DumbAware { override fun collectNotificationData(project: Project, file: VirtualFile): Function? { - val projectSettings = HybrisProjectSettingsComponent.getInstance(project) + val projectSettings = ProjectSettingsComponent.getInstance(project) if (!projectSettings.isHybrisProject()) return null if (!FileTypeRegistry.getInstance().isFileOfType(file, FlexibleSearchFileType)) return null - val developerSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state + val developerSettings = DeveloperSettingsComponent.getInstance(project).state val fxsSettings = developerSettings.flexibleSearchSettings if (!shouldCollect(fxsSettings)) return null diff --git a/src/com/intellij/idea/plugin/hybris/gotoClass/CustomGotoClassContributor.kt b/src/com/intellij/idea/plugin/hybris/gotoClass/CustomGotoClassContributor.kt index dcbb878fb..92106e18f 100644 --- a/src/com/intellij/idea/plugin/hybris/gotoClass/CustomGotoClassContributor.kt +++ b/src/com/intellij/idea/plugin/hybris/gotoClass/CustomGotoClassContributor.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.gotoClass import com.intellij.ide.util.gotoByName.DefaultClassNavigationContributor -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.navigation.GotoClassContributor import com.intellij.navigation.NavigationItem import com.intellij.openapi.project.Project @@ -71,5 +71,5 @@ class CustomGotoClassContributor : GotoClassContributor { } private fun shouldNotBeProcessed(includeNonProjectItems: Boolean, project: Project) = includeNonProjectItems - || !HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + || !ProjectSettingsComponent.getInstance(project).isHybrisProject() } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/groovy/file/GroovyFileToolbarInstaller.kt b/src/com/intellij/idea/plugin/hybris/groovy/file/GroovyFileToolbarInstaller.kt index b4535e3de..9439b19da 100644 --- a/src/com/intellij/idea/plugin/hybris/groovy/file/GroovyFileToolbarInstaller.kt +++ b/src/com/intellij/idea/plugin/hybris/groovy/file/GroovyFileToolbarInstaller.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.groovy.file import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.project.utils.PluginCommon -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.idea.plugin.hybris.startup.event.AbstractHybrisFileToolbarInstaller import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.editor.ex.EditorEx @@ -38,7 +38,7 @@ class GroovyFileToolbarInstaller : AbstractHybrisFileToolbarInstaller( } override fun isToolbarEnabled(project: Project, editor: EditorEx): Boolean { - val settings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state + val settings = DeveloperSettingsComponent.getInstance(project).state val file = editor.virtualFile // Checking special cases where toolbar might not be desired diff --git a/src/com/intellij/idea/plugin/hybris/groovy/settings/GroovySettingsConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/groovy/settings/GroovySettingsConfigurableProvider.kt index e2e056290..03e9ad6d1 100644 --- a/src/com/intellij/idea/plugin/hybris/groovy/settings/GroovySettingsConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/groovy/settings/GroovySettingsConfigurableProvider.kt @@ -21,8 +21,8 @@ package com.intellij.idea.plugin.hybris.groovy.settings import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.groovy.file.GroovyFileToolbarInstaller -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.options.BoundSearchableConfigurable import com.intellij.openapi.options.ConfigurableProvider import com.intellij.openapi.project.Project @@ -33,14 +33,14 @@ import javax.swing.JCheckBox class GroovySettingsConfigurableProvider(val project: Project) : ConfigurableProvider() { - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun canCreateConfigurable() = ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun createConfigurable() = SettingsConfigurable(project) class SettingsConfigurable(private val project: Project) : BoundSearchableConfigurable( message("hybris.settings.project.groovy.title"), "hybris.groovy.settings" ) { - private val developerSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.groovySettings + private val developerSettings = DeveloperSettingsComponent.getInstance(project).state.groovySettings private lateinit var enableActionToolbar: JCheckBox override fun createPanel() = panel { diff --git a/src/com/intellij/idea/plugin/hybris/impex/actions/ImpExOpenSettingsAction.kt b/src/com/intellij/idea/plugin/hybris/impex/actions/ImpExOpenSettingsAction.kt index 12ca2f106..91091696f 100644 --- a/src/com/intellij/idea/plugin/hybris/impex/actions/ImpExOpenSettingsAction.kt +++ b/src/com/intellij/idea/plugin/hybris/impex/actions/ImpExOpenSettingsAction.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.impex.actions import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.impex.settings.ImpexSettingsConfigurableProvider +import com.intellij.idea.plugin.hybris.settings.options.ProjectImpExSettingsConfigurableProvider import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.options.ShowSettingsUtil @@ -37,6 +37,6 @@ class ImpExOpenSettingsAction : AnAction() { override fun actionPerformed(e: AnActionEvent) { val project = e.project ?: return - ShowSettingsUtil.getInstance().showSettingsDialog(project, ImpexSettingsConfigurableProvider.SettingsConfigurable::class.java) + ShowSettingsUtil.getInstance().showSettingsDialog(project, ProjectImpExSettingsConfigurableProvider.SettingsConfigurable::class.java) } } diff --git a/src/com/intellij/idea/plugin/hybris/impex/codeInsight/hints/ImpExDefaultValueDeclarativeInlayProvider.kt b/src/com/intellij/idea/plugin/hybris/impex/codeInsight/hints/ImpExDefaultValueDeclarativeInlayProvider.kt index 787d82774..42d240f5c 100644 --- a/src/com/intellij/idea/plugin/hybris/impex/codeInsight/hints/ImpExDefaultValueDeclarativeInlayProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/impex/codeInsight/hints/ImpExDefaultValueDeclarativeInlayProvider.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.impex.codeInsight.hints import com.intellij.codeInsight.hints.declarative.InlayHintsProvider -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.editor.Editor import com.intellij.psi.PsiFile @@ -28,6 +28,6 @@ class ImpExDefaultValueDeclarativeInlayProvider : InlayHintsProvider { ImpExDefaultValueDeclarativeInlayHintsCollector() } - override fun createCollector(file: PsiFile, editor: Editor) = if (HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject()) collector + override fun createCollector(file: PsiFile, editor: Editor) = if (ProjectSettingsComponent.getInstance(file.project).isHybrisProject()) collector else null } diff --git a/src/com/intellij/idea/plugin/hybris/impex/codeInsight/lookup/ImpExLookupElementFactory.kt b/src/com/intellij/idea/plugin/hybris/impex/codeInsight/lookup/ImpExLookupElementFactory.kt index 4fe08ce9d..0805b0e64 100644 --- a/src/com/intellij/idea/plugin/hybris/impex/codeInsight/lookup/ImpExLookupElementFactory.kt +++ b/src/com/intellij/idea/plugin/hybris/impex/codeInsight/lookup/ImpExLookupElementFactory.kt @@ -25,7 +25,7 @@ import com.intellij.idea.plugin.hybris.impex.constants.modifier.AttributeModifie import com.intellij.idea.plugin.hybris.impex.constants.modifier.TypeModifier import com.intellij.idea.plugin.hybris.impex.psi.ImpexAttribute import com.intellij.idea.plugin.hybris.impex.psi.ImpexTypes -import com.intellij.idea.plugin.hybris.impex.settings.ImpexCompletionSettings +import com.intellij.idea.plugin.hybris.settings.ImpexCompletionSettings import com.intellij.psi.PsiElement import com.intellij.psi.impl.source.tree.LeafPsiElement import com.intellij.psi.util.childrenOfType diff --git a/src/com/intellij/idea/plugin/hybris/impex/completion/provider/ImpexHeaderAttributeModifierNameCompletionProvider.kt b/src/com/intellij/idea/plugin/hybris/impex/completion/provider/ImpexHeaderAttributeModifierNameCompletionProvider.kt index e5cad9ecb..af1c8f3dd 100644 --- a/src/com/intellij/idea/plugin/hybris/impex/completion/provider/ImpexHeaderAttributeModifierNameCompletionProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/impex/completion/provider/ImpexHeaderAttributeModifierNameCompletionProvider.kt @@ -23,7 +23,7 @@ import com.intellij.codeInsight.completion.CompletionProvider import com.intellij.codeInsight.completion.CompletionResultSet import com.intellij.idea.plugin.hybris.impex.codeInsight.lookup.ImpExLookupElementFactory import com.intellij.idea.plugin.hybris.impex.constants.modifier.AttributeModifier -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.Service import com.intellij.util.ProcessingContext @@ -37,7 +37,7 @@ class ImpexHeaderAttributeModifierNameCompletionProvider : CompletionProvider override fun buildFoldRegions(psi: PsiElement, document: Document, quick: Boolean): Array { - val foldingEnabled = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(psi.project).getState() + val foldingEnabled = DeveloperSettingsComponent.getInstance(psi.project).getState() .impexSettings .folding .enabled diff --git a/src/com/intellij/idea/plugin/hybris/impex/lang/folding/ImpExPsiElementFilterFactory.java b/src/com/intellij/idea/plugin/hybris/impex/lang/folding/ImpExPsiElementFilterFactory.java index 15f99c15c..ceaed90c3 100644 --- a/src/com/intellij/idea/plugin/hybris/impex/lang/folding/ImpExPsiElementFilterFactory.java +++ b/src/com/intellij/idea/plugin/hybris/impex/lang/folding/ImpExPsiElementFilterFactory.java @@ -20,7 +20,7 @@ import com.intellij.idea.plugin.hybris.impex.lang.folding.util.ImpExSimpleFoldingBlocksFilter; import com.intellij.idea.plugin.hybris.impex.lang.folding.util.ImpExSmartFoldingBlocksFilter; -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent; +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.Project; import com.intellij.psi.util.PsiElementFilter; @@ -39,7 +39,7 @@ public static PsiElementFilter getPsiElementFilter(final @NotNull Project projec } private static boolean isUseSmartFolding(final @NotNull Project project) { - return HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).getState() + return DeveloperSettingsComponent.getInstance(project).getState() .getImpexSettings() .getFolding() .getUseSmartFolding(); diff --git a/src/com/intellij/idea/plugin/hybris/impex/lang/folding/ImpexFoldingPlaceholderBuilderFactory.kt b/src/com/intellij/idea/plugin/hybris/impex/lang/folding/ImpexFoldingPlaceholderBuilderFactory.kt index ec76b1b2e..5f1334165 100644 --- a/src/com/intellij/idea/plugin/hybris/impex/lang/folding/ImpexFoldingPlaceholderBuilderFactory.kt +++ b/src/com/intellij/idea/plugin/hybris/impex/lang/folding/ImpexFoldingPlaceholderBuilderFactory.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.impex.lang.folding import com.intellij.idea.plugin.hybris.impex.lang.folding.util.ImpExSimpleFoldingPlaceholderBuilder import com.intellij.idea.plugin.hybris.impex.lang.folding.util.ImpExSmartFoldingPlaceholderBuilder -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.openapi.project.Project object ImpexFoldingPlaceholderBuilderFactory { @@ -27,7 +27,7 @@ object ImpexFoldingPlaceholderBuilderFactory { fun getPlaceholderBuilder(project: Project) = if (isUseSmartFolding(project)) ImpExSmartFoldingPlaceholderBuilder.getInstance() else ImpExSimpleFoldingPlaceholderBuilder.getInstance() - private fun isUseSmartFolding(project: Project) = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).getState() + private fun isUseSmartFolding(project: Project) = DeveloperSettingsComponent.getInstance(project).getState() .impexSettings .folding .useSmartFolding diff --git a/src/com/intellij/idea/plugin/hybris/jsp/JspPropertyFoldingBuilder.java b/src/com/intellij/idea/plugin/hybris/jsp/JspPropertyFoldingBuilder.java index c08add6c3..9b59e4d85 100644 --- a/src/com/intellij/idea/plugin/hybris/jsp/JspPropertyFoldingBuilder.java +++ b/src/com/intellij/idea/plugin/hybris/jsp/JspPropertyFoldingBuilder.java @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.jsp; -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent; +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent; import com.intellij.lang.ASTNode; import com.intellij.lang.folding.FoldingBuilderEx; import com.intellij.lang.folding.FoldingDescriptor; @@ -119,7 +119,7 @@ public boolean isCollapsedByDefault(@NotNull final ASTNode node) { } private boolean isFoldingEnabled(final @NotNull Project project) { - return HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).getState() + return DeveloperSettingsComponent.getInstance(project).getState() .getImpexSettings() .getFolding() .getEnabled(); diff --git a/src/com/intellij/idea/plugin/hybris/lang/folding/AbstractXmlFoldingBuilderEx.kt b/src/com/intellij/idea/plugin/hybris/lang/folding/AbstractXmlFoldingBuilderEx.kt index d2f1d3c77..01fe85073 100644 --- a/src/com/intellij/idea/plugin/hybris/lang/folding/AbstractXmlFoldingBuilderEx.kt +++ b/src/com/intellij/idea/plugin/hybris/lang/folding/AbstractXmlFoldingBuilderEx.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.lang.folding import com.intellij.idea.plugin.hybris.settings.FoldingSettings -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.lang.folding.FoldingBuilderEx import com.intellij.lang.folding.FoldingDescriptor import com.intellij.openapi.editor.Document @@ -45,7 +45,7 @@ abstract class AbstractXmlFoldingBuilderEx( private val cachedFoldingSettings: Key = Key.create("hybris_folding_settings_" + clazz.simpleName) override fun buildFoldRegions(root: PsiElement, document: Document, quick: Boolean): Array { - if (!HybrisProjectSettingsComponent.getInstance(root.project).isHybrisProject()) return emptyArray() + if (!ProjectSettingsComponent.getInstance(root.project).isHybrisProject()) return emptyArray() if (root !is XmlFile) return emptyArray() DomManager.getDomManager(root.project).getFileElement(root, clazz) ?: return emptyArray() diff --git a/src/com/intellij/idea/plugin/hybris/polyglotQuery/codeInsight/daemon/PolyglotQueryLineMarkerProvider.kt b/src/com/intellij/idea/plugin/hybris/polyglotQuery/codeInsight/daemon/PolyglotQueryLineMarkerProvider.kt index 1432756bd..0ae2104bc 100644 --- a/src/com/intellij/idea/plugin/hybris/polyglotQuery/codeInsight/daemon/PolyglotQueryLineMarkerProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/polyglotQuery/codeInsight/daemon/PolyglotQueryLineMarkerProvider.kt @@ -26,7 +26,7 @@ import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons import com.intellij.idea.plugin.hybris.notifications.Notifications import com.intellij.idea.plugin.hybris.polyglotQuery.PolyglotQueryUtils import com.intellij.idea.plugin.hybris.polyglotQuery.psi.PolyglotElementFactory -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.notification.NotificationType import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent @@ -62,7 +62,7 @@ class PolyglotQueryLineMarkerProvider : LineMarkerProviderDescriptor() { ): PolyglotQueryLineMarkerInfo? { val parent = element.parent if (parent !is PsiVariable || parent.nameIdentifier == null) return null - if (!HybrisProjectSettingsComponent.getInstance(element.project).isHybrisProject()) return null + if (!ProjectSettingsComponent.getInstance(element.project).isHybrisProject()) return null val expression = expressionProvider.invoke() if (!PolyglotQueryUtils.isPolyglotQuery(expression)) return null diff --git a/src/com/intellij/idea/plugin/hybris/polyglotQuery/lang/folding/PolyglotQueryFoldingBuilder.kt b/src/com/intellij/idea/plugin/hybris/polyglotQuery/lang/folding/PolyglotQueryFoldingBuilder.kt index 986baf5bd..12c5df0e1 100644 --- a/src/com/intellij/idea/plugin/hybris/polyglotQuery/lang/folding/PolyglotQueryFoldingBuilder.kt +++ b/src/com/intellij/idea/plugin/hybris/polyglotQuery/lang/folding/PolyglotQueryFoldingBuilder.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.polyglotQuery.lang.folding import com.intellij.idea.plugin.hybris.polyglotQuery.psi.PolyglotQueryTypes -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.lang.ASTNode import com.intellij.lang.folding.FoldingBuilderEx import com.intellij.lang.folding.FoldingDescriptor @@ -37,7 +37,7 @@ class PolyglotQueryFoldingBuilder : FoldingBuilderEx(), DumbAware { private val filter = PolyglotQueryFoldingBlocksFilter() override fun buildFoldRegions(root: PsiElement, document: Document, quick: Boolean): Array { - val foldingSetting = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(root.project).state.polyglotQuerySettings.folding + val foldingSetting = DeveloperSettingsComponent.getInstance(root.project).state.polyglotQuerySettings.folding if (!foldingSetting.enabled) return emptyArray() @@ -77,7 +77,7 @@ class PolyglotQueryFoldingBuilder : FoldingBuilderEx(), DumbAware { ?.trim() ?: "?" - if (HybrisDeveloperSpecificProjectSettingsComponent.getInstance(node.psi.project).state.polyglotQuerySettings.folding.showLanguage) { + if (DeveloperSettingsComponent.getInstance(node.psi.project).state.polyglotQuerySettings.folding.showLanguage) { val language = node.findChildByType(PolyglotQueryTypes.LOCALIZED) ?.let { it.findChildByType(PolyglotQueryTypes.LOCALIZED_NAME) diff --git a/src/com/intellij/idea/plugin/hybris/polyglotQuery/settings/PolyglotQuerySettingsConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/polyglotQuery/settings/PolyglotQuerySettingsConfigurableProvider.kt index 1655667eb..1f19f4da5 100644 --- a/src/com/intellij/idea/plugin/hybris/polyglotQuery/settings/PolyglotQuerySettingsConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/polyglotQuery/settings/PolyglotQuerySettingsConfigurableProvider.kt @@ -20,9 +20,9 @@ package com.intellij.idea.plugin.hybris.polyglotQuery.settings import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.polyglotQuery.ui.PolyglotQueryEditorNotificationProvider -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent import com.intellij.idea.plugin.hybris.settings.ReservedWordsCase +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.options.BoundSearchableConfigurable import com.intellij.openapi.options.ConfigurableProvider import com.intellij.openapi.project.Project @@ -39,14 +39,14 @@ import javax.swing.JCheckBox class PolyglotQuerySettingsConfigurableProvider(val project: Project) : ConfigurableProvider() { - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun canCreateConfigurable() = ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun createConfigurable() = SettingsConfigurable(project) class SettingsConfigurable(private val project: Project) : BoundSearchableConfigurable( message("hybris.settings.project.pgq.title"), "hybris.pgq.settings" ) { - private val state = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.polyglotQuerySettings + private val state = DeveloperSettingsComponent.getInstance(project).state.polyglotQuerySettings private lateinit var verifyCaseCheckBox: JCheckBox private lateinit var foldingEnableCheckBox: JCheckBox diff --git a/src/com/intellij/idea/plugin/hybris/polyglotQuery/ui/PolyglotQueryEditorNotificationProvider.kt b/src/com/intellij/idea/plugin/hybris/polyglotQuery/ui/PolyglotQueryEditorNotificationProvider.kt index 96e42951f..15c2f6dd5 100644 --- a/src/com/intellij/idea/plugin/hybris/polyglotQuery/ui/PolyglotQueryEditorNotificationProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/polyglotQuery/ui/PolyglotQueryEditorNotificationProvider.kt @@ -22,9 +22,9 @@ import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.messag import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons import com.intellij.idea.plugin.hybris.polyglotQuery.file.PolyglotQueryFileType import com.intellij.idea.plugin.hybris.polyglotQuery.settings.PolyglotQuerySettings -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent import com.intellij.idea.plugin.hybris.settings.ReservedWordsCase +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.application.ModalityState import com.intellij.openapi.application.ReadAction import com.intellij.openapi.command.WriteCommandAction @@ -48,11 +48,11 @@ import javax.swing.JComponent class PolyglotQueryEditorNotificationProvider : EditorNotificationProvider, DumbAware { override fun collectNotificationData(project: Project, file: VirtualFile): Function? { - val projectSettings = HybrisProjectSettingsComponent.getInstance(project) + val projectSettings = ProjectSettingsComponent.getInstance(project) if (!projectSettings.isHybrisProject()) return null if (!FileTypeRegistry.getInstance().isFileOfType(file, PolyglotQueryFileType)) return null - val developerSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state + val developerSettings = DeveloperSettingsComponent.getInstance(project).state val pgqSettings = developerSettings.polyglotQuerySettings if (!pgqSettings.verifyCaseForReservedWords) return null diff --git a/src/com/intellij/idea/plugin/hybris/project/AbstractHybrisProjectImportBuilder.java b/src/com/intellij/idea/plugin/hybris/project/AbstractHybrisProjectImportBuilder.java index d8f5531b4..0ac919144 100644 --- a/src/com/intellij/idea/plugin/hybris/project/AbstractHybrisProjectImportBuilder.java +++ b/src/com/intellij/idea/plugin/hybris/project/AbstractHybrisProjectImportBuilder.java @@ -18,9 +18,9 @@ package com.intellij.idea.plugin.hybris.project; -import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptor; import com.intellij.idea.plugin.hybris.project.descriptors.HybrisProjectDescriptor; -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettings; +import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptor; +import com.intellij.idea.plugin.hybris.settings.ProjectSettings; import com.intellij.projectImport.ProjectImportBuilder; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -37,7 +37,7 @@ public abstract class AbstractHybrisProjectImportBuilder extends ProjectImportBu public abstract void setAllModuleList(); - public abstract List getBestMatchingExtensionsToImport(@Nullable HybrisProjectSettings settings); + public abstract List getBestMatchingExtensionsToImport(@Nullable ProjectSettings settings); public abstract void setCoreStepModuleList(); diff --git a/src/com/intellij/idea/plugin/hybris/project/DefaultHybrisProjectImportBuilder.java b/src/com/intellij/idea/plugin/hybris/project/DefaultHybrisProjectImportBuilder.java index 04c22c9a5..02f346b3b 100644 --- a/src/com/intellij/idea/plugin/hybris/project/DefaultHybrisProjectImportBuilder.java +++ b/src/com/intellij/idea/plugin/hybris/project/DefaultHybrisProjectImportBuilder.java @@ -29,7 +29,7 @@ import com.intellij.idea.plugin.hybris.project.descriptors.impl.RootModuleDescriptor; import com.intellij.idea.plugin.hybris.project.tasks.ImportProjectProgressModalWindow; import com.intellij.idea.plugin.hybris.project.tasks.SearchModulesRootsTaskModalWindow; -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettings; +import com.intellij.idea.plugin.hybris.settings.ProjectSettings; import com.intellij.notification.NotificationType; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; @@ -231,7 +231,7 @@ public void setAllModuleList() { } @Override - public List getBestMatchingExtensionsToImport(final @Nullable HybrisProjectSettings settings) { + public List getBestMatchingExtensionsToImport(final @Nullable ProjectSettings settings) { final List allModules = this.getHybrisProjectDescriptor().getFoundModules(); final List moduleToImport = new ArrayList<>(); final Set moduleToCheck = new HashSet<>(); diff --git a/src/com/intellij/idea/plugin/hybris/project/actions/ProjectRefreshAction.java b/src/com/intellij/idea/plugin/hybris/project/actions/ProjectRefreshAction.java index 557634ab6..8d0e07ddb 100644 --- a/src/com/intellij/idea/plugin/hybris/project/actions/ProjectRefreshAction.java +++ b/src/com/intellij/idea/plugin/hybris/project/actions/ProjectRefreshAction.java @@ -32,8 +32,8 @@ import com.intellij.idea.plugin.hybris.project.HybrisProjectImportProvider; import com.intellij.idea.plugin.hybris.project.configurators.ConfiguratorFactory; import com.intellij.idea.plugin.hybris.project.wizard.RefreshSupport; -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettings; -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent; +import com.intellij.idea.plugin.hybris.settings.ProjectSettings; +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; @@ -115,7 +115,7 @@ public void update(final AnActionEvent e) { return; } presentation.setIcon(HybrisIcons.INSTANCE.getY_LOGO_BLUE()); - presentation.setVisible(HybrisProjectSettingsComponent.getInstance(project).isHybrisProject()); + presentation.setVisible(ProjectSettingsComponent.getInstance(project).isHybrisProject()); } @Override @@ -130,7 +130,7 @@ public boolean displayTextInToolbar() { private static void removeOldProjectData(@NotNull final Project project) { final var moduleModel = ModuleManager.getInstance(project).getModifiableModel(); - final var projectSettings = HybrisProjectSettingsComponent.getInstance(project).getState(); + final var projectSettings = ProjectSettingsComponent.getInstance(project).getState(); final var removeExternalModulesOnRefresh = projectSettings.getRemoveExternalModulesOnRefresh(); for (Module module : moduleModel.getModules()) { @@ -161,7 +161,7 @@ private static void clearAntProjectData(final @NotNull Project project, final Co antConfigurator.clearAntSettings(project); } - private static void clearGradleProjectData(final @NotNull Project project, final ConfiguratorFactory configuratorFactory, final HybrisProjectSettings projectSettings) { + private static void clearGradleProjectData(final @NotNull Project project, final ConfiguratorFactory configuratorFactory, final ProjectSettings projectSettings) { if (!projectSettings.getRemoveExternalModulesOnRefresh()) return; final var gradleConfigurator = configuratorFactory.getGradleConfigurator(); @@ -175,7 +175,7 @@ private AddModuleWizard getWizard(final Project project) throws ConfigurationExc final String projectName = project.getName(); final Sdk jdk = ProjectRootManager.getInstance(project).getProjectSdk(); final String compilerOutputUrl = CompilerProjectExtension.getInstance(project).getCompilerOutputUrl(); - final HybrisProjectSettings settings = HybrisProjectSettingsComponent.getInstance(project).getState(); + final ProjectSettings settings = ProjectSettingsComponent.getInstance(project).getState(); final AddModuleWizard wizard = new AddModuleWizard(null, project.getBasePath(), provider) { diff --git a/src/com/intellij/idea/plugin/hybris/project/compile/ProjectAfterCompilerTask.kt b/src/com/intellij/idea/plugin/hybris/project/compile/ProjectAfterCompilerTask.kt index efb6c38a8..0c72f6901 100644 --- a/src/com/intellij/idea/plugin/hybris/project/compile/ProjectAfterCompilerTask.kt +++ b/src/com/intellij/idea/plugin/hybris/project/compile/ProjectAfterCompilerTask.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.project.compile import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.root import com.intellij.idea.plugin.hybris.common.yExtensionName -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.compiler.CompileContext import com.intellij.openapi.compiler.CompileTask @@ -33,7 +33,7 @@ class ProjectAfterCompilerTask : CompileTask { val platformModule = modules.firstOrNull { it.yExtensionName() == HybrisConstants.EXTENSION_NAME_PLATFORM } ?: return@runReadAction true - val settings = HybrisProjectSettingsComponent.getInstance(context.project) + val settings = ProjectSettingsComponent.getInstance(context.project) if (!settings.isHybrisProject()) return@runReadAction true if (!settings.state.generateCodeOnRebuild) return@runReadAction true diff --git a/src/com/intellij/idea/plugin/hybris/project/compile/ProjectBeforeCompilerTask.kt b/src/com/intellij/idea/plugin/hybris/project/compile/ProjectBeforeCompilerTask.kt index 3164e1d63..3fa435dbc 100644 --- a/src/com/intellij/idea/plugin/hybris/project/compile/ProjectBeforeCompilerTask.kt +++ b/src/com/intellij/idea/plugin/hybris/project/compile/ProjectBeforeCompilerTask.kt @@ -25,8 +25,8 @@ import com.intellij.execution.process.ProcessEvent import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.root import com.intellij.idea.plugin.hybris.common.yExtensionName -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettings -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.ProjectSettings +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.compiler.* import com.intellij.openapi.module.Module import com.intellij.openapi.projectRoots.JavaSdk @@ -58,7 +58,7 @@ class ProjectBeforeCompilerTask : CompileTask { val platformModule = modules.firstOrNull { it.yExtensionName() == HybrisConstants.EXTENSION_NAME_PLATFORM } ?: return true - val settings = HybrisProjectSettingsComponent.getInstance(context.project) + val settings = ProjectSettingsComponent.getInstance(context.project) if (!settings.isHybrisProject()) return true if (!settings.state.generateCodeOnRebuild) { context.addMessage(CompilerMessageCategory.WARNING, "[y] Code generation is disabled, to enable it adjust SAP Commerce Project specific settings.", null, -1, -1) @@ -103,7 +103,7 @@ class ProjectBeforeCompilerTask : CompileTask { bootstrapDirectory: Path, coreModuleRoot: Path, vmExecutablePath: String, - settings: HybrisProjectSettings, + settings: ProjectSettings, ): Boolean { val pathToBeDeleted = bootstrapDirectory.resolve(HybrisConstants.GEN_SRC_DIRECTORY) cleanDirectory(context, pathToBeDeleted) diff --git a/src/com/intellij/idea/plugin/hybris/project/configurators/ContentRootConfigurator.kt b/src/com/intellij/idea/plugin/hybris/project/configurators/ContentRootConfigurator.kt index 136c52d0c..e38cf8810 100644 --- a/src/com/intellij/idea/plugin/hybris/project/configurators/ContentRootConfigurator.kt +++ b/src/com/intellij/idea/plugin/hybris/project/configurators/ContentRootConfigurator.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.project.configurators import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptor -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettings +import com.intellij.idea.plugin.hybris.settings.ApplicationSettings import com.intellij.openapi.progress.ProgressIndicator import com.intellij.openapi.roots.ModifiableRootModel @@ -29,7 +29,7 @@ interface ContentRootConfigurator { indicator: ProgressIndicator, modifiableRootModel: ModifiableRootModel, moduleDescriptor: ModuleDescriptor, - appSettings: HybrisApplicationSettings + appSettings: ApplicationSettings ) } diff --git a/src/com/intellij/idea/plugin/hybris/project/configurators/JRebelConfigurator.kt b/src/com/intellij/idea/plugin/hybris/project/configurators/JRebelConfigurator.kt index 0d4d0127d..4af5e2b57 100644 --- a/src/com/intellij/idea/plugin/hybris/project/configurators/JRebelConfigurator.kt +++ b/src/com/intellij/idea/plugin/hybris/project/configurators/JRebelConfigurator.kt @@ -23,7 +23,7 @@ import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptor import com.intellij.idea.plugin.hybris.project.descriptors.YSubModuleDescriptor import com.intellij.idea.plugin.hybris.project.descriptors.impl.YCustomRegularModuleDescriptor -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleManager @@ -56,7 +56,7 @@ class JRebelConfigurator { .mapNotNull { configure(it) } fun fixBackOfficeJRebelSupport(project: Project) { - val hybrisProjectSettings = HybrisProjectSettingsComponent.getInstance(project).state + val hybrisProjectSettings = ProjectSettingsComponent.getInstance(project).state val compilingXml = File( FileUtilRt.toSystemDependentName( project.basePath + "/" + hybrisProjectSettings.hybrisDirectory diff --git a/src/com/intellij/idea/plugin/hybris/project/configurators/LoadedConfigurator.kt b/src/com/intellij/idea/plugin/hybris/project/configurators/LoadedConfigurator.kt index 7a08926f0..1115feec8 100644 --- a/src/com/intellij/idea/plugin/hybris/project/configurators/LoadedConfigurator.kt +++ b/src/com/intellij/idea/plugin/hybris/project/configurators/LoadedConfigurator.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.project.configurators import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptor import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorImportStatus -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.Service import com.intellij.openapi.project.Project @@ -38,7 +38,7 @@ class LoadedConfigurator { .toMutableSet() ApplicationManager.getApplication().invokeAndWait { - HybrisProjectSettingsComponent.getInstance(project).state.unusedExtensions = unusedModuleNames + ProjectSettingsComponent.getInstance(project).state.unusedExtensions = unusedModuleNames } } diff --git a/src/com/intellij/idea/plugin/hybris/project/configurators/SearchScopeConfigurator.kt b/src/com/intellij/idea/plugin/hybris/project/configurators/SearchScopeConfigurator.kt index c934ec062..1d45f73fb 100644 --- a/src/com/intellij/idea/plugin/hybris/project/configurators/SearchScopeConfigurator.kt +++ b/src/com/intellij/idea/plugin/hybris/project/configurators/SearchScopeConfigurator.kt @@ -18,7 +18,7 @@ */ package com.intellij.idea.plugin.hybris.project.configurators -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettings +import com.intellij.idea.plugin.hybris.settings.ApplicationSettings import com.intellij.openapi.module.ModifiableModuleModel import com.intellij.openapi.progress.ProgressIndicator import com.intellij.openapi.project.Project @@ -28,7 +28,7 @@ interface SearchScopeConfigurator { fun configure( indicator: ProgressIndicator, project: Project, - applicationSettings: HybrisApplicationSettings, + applicationSettings: ApplicationSettings, model: ModifiableModuleModel ) diff --git a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultContentRootConfigurator.java b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultContentRootConfigurator.java index 02d9924ba..0ceb65fc5 100644 --- a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultContentRootConfigurator.java +++ b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultContentRootConfigurator.java @@ -24,7 +24,7 @@ import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptor; import com.intellij.idea.plugin.hybris.project.descriptors.YSubModuleDescriptor; import com.intellij.idea.plugin.hybris.project.descriptors.impl.*; -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettings; +import com.intellij.idea.plugin.hybris.settings.ApplicationSettings; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.roots.ContentEntry; import com.intellij.openapi.roots.ModifiableRootModel; @@ -62,7 +62,7 @@ public void configure( @NotNull final ProgressIndicator indicator, @NotNull final ModifiableRootModel modifiableRootModel, @NotNull final ModuleDescriptor moduleDescriptor, - @NotNull final HybrisApplicationSettings appSettings + @NotNull final ApplicationSettings appSettings ) { indicator.setText2(message("hybris.project.import.module.content")); final var contentEntry = modifiableRootModel.addContentEntry(VfsUtil.pathToUrl( @@ -96,7 +96,7 @@ protected void configureCommonRoots( @NotNull final ModuleDescriptor moduleDescriptor, @NotNull final ContentEntry contentEntry, @NotNull final List dirsToIgnore, - @NotNull final HybrisApplicationSettings appSettings + @NotNull final ApplicationSettings appSettings ) { final var rootProjectDescriptor = moduleDescriptor.getRootProjectDescriptor(); final var customModuleDescriptor = isCustomModuleDescriptor(moduleDescriptor); @@ -128,7 +128,7 @@ protected void configureResourceDirectory( @NotNull final ContentEntry contentEntry, @NotNull final ModuleDescriptor moduleDescriptor, @NotNull final List dirsToIgnore, - @NotNull final HybrisApplicationSettings appSettings + @NotNull final ApplicationSettings appSettings ) { final var resourcesDirectory = new File(moduleDescriptor.getModuleRootDirectory(), RESOURCES_DIRECTORY); @@ -180,7 +180,7 @@ private static void excludeDirectory(@NotNull final ContentEntry contentEntry, @ protected void configureWebRoots( @NotNull final YWebSubModuleDescriptor moduleDescriptor, @NotNull final ContentEntry contentEntry, - @NotNull final HybrisApplicationSettings appSettings + @NotNull final ApplicationSettings appSettings ) { configureWebModuleRoots(moduleDescriptor, contentEntry); @@ -195,7 +195,7 @@ protected void configureWebRoots( private static void configureExternalModuleRoot( final @NotNull YWebSubModuleDescriptor moduleDescriptor, final @NotNull ContentEntry contentEntry, - final @NotNull HybrisApplicationSettings appSettings, + final @NotNull ApplicationSettings appSettings, final String sourceRoot, final JavaSourceRootType type ) { @@ -228,7 +228,7 @@ protected void configurePlatformRoots( @NotNull final PlatformModuleDescriptor moduleDescriptor, @NotNull final ContentEntry contentEntry, final List dirsToIgnore, - final HybrisApplicationSettings appSettings + final ApplicationSettings appSettings ) { final var rootDirectory = moduleDescriptor.getModuleRootDirectory(); final var platformBootstrapDirectory = new File(rootDirectory, PLATFORM_BOOTSTRAP_DIRECTORY); @@ -272,7 +272,7 @@ private static void addSourceRoots( @NotNull final ContentEntry contentEntry, @NotNull final File dir, @NotNull final List dirsToIgnore, - @NotNull final HybrisApplicationSettings appSettings, + @NotNull final ApplicationSettings appSettings, final List directories, final JavaSourceRootType scope ) { @@ -291,7 +291,7 @@ protected static

void addSourceFolderIfNotIgnored( @NotNull final File testSrcDir, @NotNull final JpsModuleSourceRootType

rootType, @NotNull final List dirsToIgnore, - @NotNull final HybrisApplicationSettings appSettings + @NotNull final ApplicationSettings appSettings ) { addSourceFolderIfNotIgnored( contentEntry, @@ -311,7 +311,7 @@ private static

void addSourceFolderIfNotIgnored( @NotNull final JpsModuleSourceRootType

rootType, @NotNull final P properties, @NotNull final List dirsToIgnore, - @NotNull final HybrisApplicationSettings applicationSettings + @NotNull final ApplicationSettings applicationSettings ) { if (dirsToIgnore.stream().noneMatch(it -> FileUtil.isAncestor(it, srcDir, false))) { final boolean ignoreEmpty = applicationSettings.getIgnoreNonExistingSourceDirectories(); diff --git a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultGroupModuleConfigurator.java b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultGroupModuleConfigurator.java index f5f540ea0..6b05c3660 100644 --- a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultGroupModuleConfigurator.java +++ b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultGroupModuleConfigurator.java @@ -26,7 +26,7 @@ import com.intellij.idea.plugin.hybris.project.descriptors.YSubModuleDescriptor; import com.intellij.idea.plugin.hybris.project.descriptors.impl.*; import com.intellij.idea.plugin.hybris.project.utils.FileUtils; -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent; +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.progress.ProgressIndicator; import org.apache.commons.lang3.ArrayUtils; @@ -49,7 +49,7 @@ public void process( @NotNull final List modulesChosenForImport ) { indicator.setText2(message("hybris.project.import.module.groups")); - final var applicationSettings = HybrisApplicationSettingsComponent.getInstance().getState(); + final var applicationSettings = ApplicationSettingsComponent.getInstance().getState(); if (!applicationSettings.getGroupModules()) { return; } @@ -65,13 +65,13 @@ public void process( }); final var groups = Map.of( - "groupCustom", HybrisApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupCustom()), - "groupNonHybris", HybrisApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupNonHybris()), - "groupOtherCustom", HybrisApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupOtherCustom()), - "groupHybris", HybrisApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupHybris()), - "groupOtherHybris", HybrisApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupOtherHybris()), - "groupPlatform", HybrisApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupPlatform()), - "groupCCv2", HybrisApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupCCv2()) + "groupCustom", ApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupCustom()), + "groupNonHybris", ApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupNonHybris()), + "groupOtherCustom", ApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupOtherCustom()), + "groupHybris", ApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupHybris()), + "groupOtherHybris", ApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupOtherHybris()), + "groupPlatform", ApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupPlatform()), + "groupCCv2", ApplicationSettingsComponent.toIdeaGroup(applicationSettings.getGroupCCv2()) ); modulesChosenForImport.forEach(it -> { final @Nullable String[] groupNames = getGroupName(it, requiredYModuleDescriptorList, groups); @@ -157,7 +157,7 @@ private String[] getGroupPathOverride(final File groupFile, final ModuleDescript if (rawGroupText == null) { rawGroupText = properties.getProperty(moduleName + '.' + GROUP_OVERRIDE_KEY); } - return HybrisApplicationSettingsComponent.toIdeaGroup(rawGroupText); + return ApplicationSettingsComponent.toIdeaGroup(rawGroupText); } private String[] getGroupPath(@NotNull final ModuleDescriptor moduleDescriptor, final Set requiredYModuleDescriptorList, final Map groups) { diff --git a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultSearchScopeConfigurator.java b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultSearchScopeConfigurator.java index 6bcb4b061..71a765405 100644 --- a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultSearchScopeConfigurator.java +++ b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultSearchScopeConfigurator.java @@ -24,7 +24,7 @@ import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils; import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons; import com.intellij.idea.plugin.hybris.project.configurators.SearchScopeConfigurator; -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettings; +import com.intellij.idea.plugin.hybris.settings.ApplicationSettings; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.module.ModifiableModuleModel; import com.intellij.openapi.progress.ProgressIndicator; @@ -49,7 +49,7 @@ public class DefaultSearchScopeConfigurator implements SearchScopeConfigurator { public void configure( final @NotNull ProgressIndicator indicator, final @NotNull Project project, - final @NotNull HybrisApplicationSettings applicationSettings, + final @NotNull ApplicationSettings applicationSettings, final @NotNull ModifiableModuleModel model ) { indicator.setText(message("hybris.project.import.search.scope")); @@ -113,7 +113,7 @@ public void configure( } @NotNull - public static PackageSet createCustomTsImpexBeansFilesPattern(final @NotNull HybrisApplicationSettings appSettings) { + public static PackageSet createCustomTsImpexBeansFilesPattern(final @NotNull ApplicationSettings appSettings) { final String customGroupName = appSettings.getGroupCustom(); final FilePatternPackageSet tsFilePatternPackageSet = new FilePatternPackageSet( customGroupName + '*', diff --git a/src/com/intellij/idea/plugin/hybris/project/descriptors/DefaultHybrisProjectDescriptor.java b/src/com/intellij/idea/plugin/hybris/project/descriptors/DefaultHybrisProjectDescriptor.java index 61bb8f7e3..ccff51002 100644 --- a/src/com/intellij/idea/plugin/hybris/project/descriptors/DefaultHybrisProjectDescriptor.java +++ b/src/com/intellij/idea/plugin/hybris/project/descriptors/DefaultHybrisProjectDescriptor.java @@ -31,8 +31,8 @@ import com.intellij.idea.plugin.hybris.project.settings.jaxb.localextensions.ScanType; import com.intellij.idea.plugin.hybris.project.tasks.TaskProgressProcessor; import com.intellij.idea.plugin.hybris.project.utils.FileUtils; -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent; -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent; +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent; +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.Module; @@ -389,7 +389,7 @@ protected void scanDirectoryForHybrisModules( this.foundModules.clear(); - final var settings = HybrisApplicationSettingsComponent.getInstance().getState(); + final var settings = ApplicationSettingsComponent.getInstance().getState(); final Map> moduleRootMap = newModuleRootMap(); final var excludedFromScanning = getExcludedFromScanningDirectories(); @@ -848,11 +848,11 @@ public void setProject(@Nullable final Project project) { return; } // the project may not be hybris based project. - final HybrisProjectSettingsComponent hybrisProjectSettings = HybrisProjectSettingsComponent.getInstance(project); - if (hybrisProjectSettings == null) { + final ProjectSettingsComponent projectSettingsComponent = ProjectSettingsComponent.getInstance(project); + if (projectSettingsComponent == null) { return; } - if (hybrisProjectSettings.isHybrisProject()) { + if (projectSettingsComponent.isHybrisProject()) { setHybrisProject(project); } } diff --git a/src/com/intellij/idea/plugin/hybris/project/descriptors/YModuleLibDescriptorUtil.kt b/src/com/intellij/idea/plugin/hybris/project/descriptors/YModuleLibDescriptorUtil.kt index 8d18c6be5..b1fe11959 100644 --- a/src/com/intellij/idea/plugin/hybris/project/descriptors/YModuleLibDescriptorUtil.kt +++ b/src/com/intellij/idea/plugin/hybris/project/descriptors/YModuleLibDescriptorUtil.kt @@ -21,7 +21,7 @@ package com.intellij.idea.plugin.hybris.project.descriptors import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.LibraryDescriptorType import com.intellij.idea.plugin.hybris.project.descriptors.impl.* -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent import com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProvider import com.intellij.openapi.roots.DependencyScope import com.intellij.openapi.roots.OrderRootType @@ -398,7 +398,7 @@ object YModuleLibDescriptorUtil { private fun getDbDriversDirectory(descriptor: PlatformModuleDescriptor) = descriptor.rootProjectDescriptor.externalDbDriversDirectory ?: File(descriptor.moduleRootDirectory, HybrisConstants.PLATFORM_DB_DRIVER) - private fun getStandardSourceJarDirectory(descriptor: YModuleDescriptor) = if (HybrisApplicationSettingsComponent.getInstance().state.withStandardProvidedSources) { + private fun getStandardSourceJarDirectory(descriptor: YModuleDescriptor) = if (ApplicationSettingsComponent.getInstance().state.withStandardProvidedSources) { val rootDescriptor = if (descriptor is YSubModuleDescriptor) descriptor.owner else descriptor diff --git a/src/com/intellij/idea/plugin/hybris/project/indexing/HybrisDirectoryIndexExcludePolicy.kt b/src/com/intellij/idea/plugin/hybris/project/indexing/HybrisDirectoryIndexExcludePolicy.kt index 59e40279c..2370950df 100644 --- a/src/com/intellij/idea/plugin/hybris/project/indexing/HybrisDirectoryIndexExcludePolicy.kt +++ b/src/com/intellij/idea/plugin/hybris/project/indexing/HybrisDirectoryIndexExcludePolicy.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.project.indexing -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent import com.intellij.openapi.project.Project import com.intellij.openapi.roots.ModuleRootModel import com.intellij.openapi.roots.impl.DirectoryIndexExcludePolicy @@ -49,7 +49,7 @@ class HybrisDirectoryIndexExcludePolicy(val project: Project) : DirectoryIndexEx } private fun getExcludedFromIndexList(): List { - return HybrisApplicationSettingsComponent.getInstance() + return ApplicationSettingsComponent.getInstance() .state .excludedFromIndexList } diff --git a/src/com/intellij/idea/plugin/hybris/project/providers/HybrisWritingAccessProvider.kt b/src/com/intellij/idea/plugin/hybris/project/providers/HybrisWritingAccessProvider.kt index 375ae6ff5..186686a62 100644 --- a/src/com/intellij/idea/plugin/hybris/project/providers/HybrisWritingAccessProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/project/providers/HybrisWritingAccessProvider.kt @@ -18,14 +18,14 @@ */ package com.intellij.idea.plugin.hybris.project.providers -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.project.Project import com.intellij.openapi.vfs.VirtualFile import com.intellij.openapi.vfs.WritingAccessProvider class HybrisWritingAccessProvider(myProject: Project) : WritingAccessProvider() { - private val ootbReadOnlyMode = HybrisProjectSettingsComponent.getInstance(myProject).state.importOotbModulesInReadOnlyMode + private val ootbReadOnlyMode = ProjectSettingsComponent.getInstance(myProject).state.importOotbModulesInReadOnlyMode override fun requestWriting(files: Collection) = files .filter { isFileReadOnly(it) } diff --git a/src/com/intellij/idea/plugin/hybris/project/tasks/ImportProjectProgressModalWindow.java b/src/com/intellij/idea/plugin/hybris/project/tasks/ImportProjectProgressModalWindow.java index 14250ac31..3734c0f27 100644 --- a/src/com/intellij/idea/plugin/hybris/project/tasks/ImportProjectProgressModalWindow.java +++ b/src/com/intellij/idea/plugin/hybris/project/tasks/ImportProjectProgressModalWindow.java @@ -40,10 +40,10 @@ import com.intellij.idea.plugin.hybris.project.descriptors.YSubModuleDescriptor; import com.intellij.idea.plugin.hybris.project.descriptors.impl.*; import com.intellij.idea.plugin.hybris.project.utils.PluginCommon; -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettings; -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent; -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettings; -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent; +import com.intellij.idea.plugin.hybris.settings.ApplicationSettings; +import com.intellij.idea.plugin.hybris.settings.ProjectSettings; +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent; +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent; import com.intellij.javaee.application.facet.JavaeeApplicationFacet; import com.intellij.javaee.web.facet.WebFacet; import com.intellij.lang.Language; @@ -142,9 +142,9 @@ public synchronized void run(@NotNull final ProgressIndicator indicator) { .collect(Collectors.toMap(YModuleDescriptor::getName, Function.identity())); final var allModuleDescriptors = allModules.stream() .collect(Collectors.toMap(ModuleDescriptor::getName, Function.identity())); - final var appSettings = HybrisApplicationSettingsComponent.getInstance().getState(); + final var appSettings = ApplicationSettingsComponent.getInstance().getState(); - final var projectSettingsComponent = HybrisProjectSettingsComponent.getInstance(project); + final var projectSettingsComponent = ProjectSettingsComponent.getInstance(project); final var projectSettings = projectSettingsComponent.getState(); final var modulesFilesDirectory = hybrisProjectDescriptor.getModulesFilesDirectory(); @@ -271,7 +271,7 @@ private void processUltimateEdition(final @NotNull ProgressIndicator indicator) private Module createJavaModule(final @NotNull ProgressIndicator indicator, final Map allYModules, final ModifiableModuleModel rootProjectModifiableModel, - final ModuleDescriptor moduleDescriptor, final @NotNull HybrisApplicationSettings appSettings + final ModuleDescriptor moduleDescriptor, final @NotNull ApplicationSettings appSettings ) { indicator.setText(message("hybris.project.import.module.import", moduleDescriptor.getName())); indicator.setText2(message("hybris.project.import.module.settings")); @@ -398,14 +398,14 @@ private void updateProjectDictionary( hybrisDictionary.addToDictionary(moduleNames); } - private void initializeHybrisProjectSettings(@NotNull final Project project, final @NotNull HybrisProjectSettings hybrisProjectSettings) { - hybrisProjectSettings.setHybrisProject(true); + private void initializeHybrisProjectSettings(@NotNull final Project project, final @NotNull ProjectSettings projectSettings) { + projectSettings.setHybrisProject(true); final IdeaPluginDescriptor plugin = PluginManagerCore.getPlugin(PluginId.getId(HybrisConstants.PLUGIN_ID)); if (plugin == null) return; final String version = plugin.getVersion(); - hybrisProjectSettings.setImportedByVersion(version); + projectSettings.setImportedByVersion(version); } private void selectSdk(@NotNull final Project project) { @@ -427,7 +427,7 @@ private void selectSdk(@NotNull final Project project) { } } - private void saveCustomDirectoryLocation(final Project project, final HybrisProjectSettings hybrisProjectSettings) { + private void saveCustomDirectoryLocation(final Project project, final ProjectSettings projectSettings) { final File customDirectory = hybrisProjectDescriptor.getExternalExtensionsDirectory(); final File hybrisDirectory = hybrisProjectDescriptor.getHybrisDistributionDirectory(); final VirtualFile projectDir = ProjectUtil.guessProjectDir(project); @@ -438,36 +438,36 @@ private void saveCustomDirectoryLocation(final Project project, final HybrisProj final Path projectPath = Paths.get(baseDirectory.getAbsolutePath()); final Path hybrisPath = Paths.get(hybrisDirectory.getAbsolutePath()); final Path relativeHybrisPath = projectPath.relativize(hybrisPath); - hybrisProjectSettings.setHybrisDirectory(relativeHybrisPath.toString()); + projectSettings.setHybrisDirectory(relativeHybrisPath.toString()); if (customDirectory != null) { final Path customPath = Paths.get(customDirectory.getAbsolutePath()); final Path relativeCustomPath = hybrisPath.relativize(customPath); - hybrisProjectSettings.setCustomDirectory(relativeCustomPath.toString()); + projectSettings.setCustomDirectory(relativeCustomPath.toString()); } } - private void saveImportedSettings(@NotNull final HybrisProjectSettings hybrisProjectSettings, - @NotNull final HybrisApplicationSettings appSettings, - @NotNull final HybrisProjectSettingsComponent hybrisSettingsComponent) { - hybrisProjectSettings.setImportOotbModulesInReadOnlyMode(hybrisProjectDescriptor.isImportOotbModulesInReadOnlyMode()); + private void saveImportedSettings(@NotNull final ProjectSettings projectSettings, + @NotNull final ApplicationSettings appSettings, + @NotNull final ProjectSettingsComponent hybrisSettingsComponent) { + projectSettings.setImportOotbModulesInReadOnlyMode(hybrisProjectDescriptor.isImportOotbModulesInReadOnlyMode()); final File extDir = hybrisProjectDescriptor.getExternalExtensionsDirectory(); if (extDir != null && extDir.isDirectory()) { - hybrisProjectSettings.setExternalExtensionsDirectory(FileUtil.toSystemIndependentName(extDir.getPath())); + projectSettings.setExternalExtensionsDirectory(FileUtil.toSystemIndependentName(extDir.getPath())); } File configDir = hybrisProjectDescriptor.getExternalConfigDirectory(); if (configDir != null && configDir.isDirectory()) { - hybrisProjectSettings.setExternalConfigDirectory(FileUtil.toSystemIndependentName(configDir.getPath())); + projectSettings.setExternalConfigDirectory(FileUtil.toSystemIndependentName(configDir.getPath())); } final ConfigModuleDescriptor configModule = hybrisProjectDescriptor.getConfigHybrisModuleDescriptor(); if (configModule != null) { configDir = configModule.getModuleRootDirectory(); if (configDir.isDirectory()) { - hybrisProjectSettings.setConfigDirectory(FileUtil.toSystemIndependentName(configDir.getPath())); + projectSettings.setConfigDirectory(FileUtil.toSystemIndependentName(configDir.getPath())); } } final File dbDriversDir = hybrisProjectDescriptor.getExternalDbDriversDirectory(); if (dbDriversDir != null && dbDriversDir.isDirectory()) { - hybrisProjectSettings.setExternalDbDriversDirectory(FileUtil.toSystemIndependentName(dbDriversDir.getPath())); + projectSettings.setExternalDbDriversDirectory(FileUtil.toSystemIndependentName(dbDriversDir.getPath())); appSettings.setExternalDbDriversDirectory(FileUtil.toSystemIndependentName(dbDriversDir.getPath())); } else { appSettings.setExternalDbDriversDirectory(""); @@ -479,7 +479,7 @@ private void saveImportedSettings(@NotNull final HybrisProjectSettings hybrisPro final File sourceCodeFile = hybrisProjectDescriptor.getSourceCodeFile(); if (sourceCodeFile != null && sourceCodeFile.exists()) { - hybrisProjectSettings.setSourceCodeFile(FileUtil.toSystemIndependentName(sourceCodeFile.getPath())); + projectSettings.setSourceCodeFile(FileUtil.toSystemIndependentName(sourceCodeFile.getPath())); final boolean directory = sourceCodeFile.isDirectory(); appSettings.setSourceCodeDirectory(FileUtil.toSystemIndependentName( directory ? sourceCodeFile.getPath() : sourceCodeFile.getParent())); @@ -487,12 +487,12 @@ private void saveImportedSettings(@NotNull final HybrisProjectSettings hybrisPro } final File modulesFilesDirectory = hybrisProjectDescriptor.getModulesFilesDirectory(); if (modulesFilesDirectory != null && modulesFilesDirectory.isDirectory()) { - hybrisProjectSettings.setIdeModulesFilesDirectory(FileUtil.toSystemIndependentName(modulesFilesDirectory.getPath())); + projectSettings.setIdeModulesFilesDirectory(FileUtil.toSystemIndependentName(modulesFilesDirectory.getPath())); } - hybrisProjectSettings.setFollowSymlink(hybrisProjectDescriptor.isFollowSymlink()); - hybrisProjectSettings.setScanThroughExternalModule(hybrisProjectDescriptor.isScanThroughExternalModule()); - hybrisProjectSettings.setModulesOnBlackList(createModulesOnBlackList()); - hybrisProjectSettings.setHybrisVersion(hybrisProjectDescriptor.getHybrisVersion()); + projectSettings.setFollowSymlink(hybrisProjectDescriptor.isFollowSymlink()); + projectSettings.setScanThroughExternalModule(hybrisProjectDescriptor.isScanThroughExternalModule()); + projectSettings.setModulesOnBlackList(createModulesOnBlackList()); + projectSettings.setHybrisVersion(hybrisProjectDescriptor.getHybrisVersion()); final var sapCLIDirectory = hybrisProjectDescriptor.getSAPCLIDirectory(); @@ -503,7 +503,7 @@ private void saveImportedSettings(@NotNull final HybrisProjectSettings hybrisPro final var credentialAttributes = new CredentialAttributes(HybrisConstants.SECURE_STORAGE_SERVICE_NAME_SAP_CX_CCV2_TOKEN); PasswordSafe.getInstance().setPassword(credentialAttributes, hybrisProjectDescriptor.getSAPCLIToken()); - hybrisProjectSettings.setJavadocUrl(hybrisProjectDescriptor.getJavadocUrl()); + projectSettings.setJavadocUrl(hybrisProjectDescriptor.getJavadocUrl()); final var completeSetOfHybrisModules = hybrisProjectDescriptor.getFoundModules().stream() .filter(e -> !(e instanceof MavenModuleDescriptor) && !(e instanceof EclipseModuleDescriptor) @@ -516,10 +516,10 @@ private void saveImportedSettings(@NotNull final HybrisProjectSettings hybrisPro .map(YModuleDescriptor.class::cast) .collect(Collectors.toSet()); hybrisSettingsComponent.setAvailableExtensions(completeSetOfHybrisModules); - hybrisProjectSettings.setCompleteSetOfAvailableExtensionsInHybris(completeSetOfHybrisModules.stream() + projectSettings.setCompleteSetOfAvailableExtensionsInHybris(completeSetOfHybrisModules.stream() .map(ModuleDescriptor::getName) .collect(Collectors.toSet())); - hybrisProjectSettings.setExcludeTestSources(hybrisProjectDescriptor.isExcludeTestSources()); + projectSettings.setExcludeTestSources(hybrisProjectDescriptor.isExcludeTestSources()); } private Set createModulesOnBlackList() { diff --git a/src/com/intellij/idea/plugin/hybris/project/utils/HybrisRootUtil.java b/src/com/intellij/idea/plugin/hybris/project/utils/HybrisRootUtil.java index 4d550f296..128258219 100644 --- a/src/com/intellij/idea/plugin/hybris/project/utils/HybrisRootUtil.java +++ b/src/com/intellij/idea/plugin/hybris/project/utils/HybrisRootUtil.java @@ -20,7 +20,7 @@ import com.intellij.idea.plugin.hybris.common.HybrisConstants; import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorType; -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent; +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.project.Project; @@ -38,7 +38,7 @@ private HybrisRootUtil() { @Nullable public static VirtualFile findPlatformRootDirectory(@NotNull final Project project) { - final var settingsComponent = HybrisProjectSettingsComponent.getInstance(project); + final var settingsComponent = ProjectSettingsComponent.getInstance(project); final Module platformModule = Arrays.stream(ModuleManager.getInstance(project).getModules()) .filter(module -> settingsComponent.getModuleSettings(module).getType() == ModuleDescriptorType.PLATFORM) diff --git a/src/com/intellij/idea/plugin/hybris/project/utils/ModuleUtils.kt b/src/com/intellij/idea/plugin/hybris/project/utils/ModuleUtils.kt index c6af75afe..154af715d 100644 --- a/src/com/intellij/idea/plugin/hybris/project/utils/ModuleUtils.kt +++ b/src/com/intellij/idea/plugin/hybris/project/utils/ModuleUtils.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.project.utils import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorType -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.module.ModuleUtilCore import com.intellij.psi.PsiElement @@ -27,7 +27,7 @@ object ModuleUtils { fun isHybrisModule(psi: PsiElement): Boolean { val module = ModuleUtilCore.findModuleForPsiElement(psi) ?: return false - val descriptorType = HybrisProjectSettingsComponent.getInstance(psi.project) + val descriptorType = ProjectSettingsComponent.getInstance(psi.project) .getModuleSettings(module).type return descriptorType == ModuleDescriptorType.PLATFORM || descriptorType == ModuleDescriptorType.EXT diff --git a/src/com/intellij/idea/plugin/hybris/project/view/ExternalProjectViewNode.kt b/src/com/intellij/idea/plugin/hybris/project/view/ExternalProjectViewNode.kt index d6c13a683..740a27097 100644 --- a/src/com/intellij/idea/plugin/hybris/project/view/ExternalProjectViewNode.kt +++ b/src/com/intellij/idea/plugin/hybris/project/view/ExternalProjectViewNode.kt @@ -22,7 +22,7 @@ import com.intellij.ide.projectView.* import com.intellij.ide.util.treeView.AbstractTreeNode import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent import com.intellij.openapi.project.Project import com.intellij.openapi.vfs.VirtualFile import com.intellij.ui.SimpleTextAttributes @@ -43,7 +43,7 @@ class ExternalProjectViewNode( public override fun update(presentation: PresentationData) { with(presentation) { setIcon(HybrisIcons.MODULE_EXTERNAL_GROUP) - val groupNameExternalModules = HybrisApplicationSettingsComponent.getInstance().state.groupNameExternalModules + val groupNameExternalModules = ApplicationSettingsComponent.getInstance().state.groupNameExternalModules .takeIf { it.isNotBlank() } ?: message("hybris.project.view.external.module.directory.name") addText(groupNameExternalModules, SimpleTextAttributes.REGULAR_ATTRIBUTES) diff --git a/src/com/intellij/idea/plugin/hybris/project/view/HybrisProjectView.kt b/src/com/intellij/idea/plugin/hybris/project/view/HybrisProjectView.kt index 3c1124d3f..36057c07b 100644 --- a/src/com/intellij/idea/plugin/hybris/project/view/HybrisProjectView.kt +++ b/src/com/intellij/idea/plugin/hybris/project/view/HybrisProjectView.kt @@ -27,8 +27,8 @@ import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons import com.intellij.idea.plugin.hybris.common.yExtensionName import com.intellij.idea.plugin.hybris.facet.YFacet import com.intellij.idea.plugin.hybris.project.services.HybrisProjectService -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.project.DumbAware import com.intellij.openapi.project.Project @@ -40,16 +40,15 @@ import java.io.File open class HybrisProjectView(val project: Project) : TreeStructureProvider, DumbAware { - private val hybrisProjectSettingsComponent = HybrisProjectSettingsComponent.getInstance(project) - private val hybrisProject = hybrisProjectSettingsComponent.state.hybrisProject - private val hybrisApplicationSettings = HybrisApplicationSettingsComponent.getInstance().state - private val commerceGroupName = HybrisApplicationSettingsComponent.toIdeaGroup(hybrisApplicationSettings.groupHybris) + private val hybrisProject = ProjectSettingsComponent.getInstance(project).state.hybrisProject + private val hybrisApplicationSettings = ApplicationSettingsComponent.getInstance().state + private val commerceGroupName = ApplicationSettingsComponent.toIdeaGroup(hybrisApplicationSettings.groupHybris) ?.firstOrNull() - private val platformGroupName = HybrisApplicationSettingsComponent.toIdeaGroup(hybrisApplicationSettings.groupPlatform) + private val platformGroupName = ApplicationSettingsComponent.toIdeaGroup(hybrisApplicationSettings.groupPlatform) ?.firstOrNull() - private val ccv2GroupName = HybrisApplicationSettingsComponent.toIdeaGroup(hybrisApplicationSettings.groupCCv2) + private val ccv2GroupName = ApplicationSettingsComponent.toIdeaGroup(hybrisApplicationSettings.groupCCv2) ?.firstOrNull() - private val customGroupName = HybrisApplicationSettingsComponent.toIdeaGroup(hybrisApplicationSettings.groupCustom) + private val customGroupName = ApplicationSettingsComponent.toIdeaGroup(hybrisApplicationSettings.groupCustom) ?.firstOrNull() private val groupToIcon = mapOf( customGroupName to HybrisIcons.MODULE_CUSTOM_GROUP, @@ -230,7 +229,7 @@ open class HybrisProjectView(val project: Project) : TreeStructureProvider, Dumb children: Collection>, settings: ViewSettings? ): Collection> { - val junkFileNames = HybrisApplicationSettingsComponent.getInstance().state.junkDirectoryList + val junkFileNames = ApplicationSettingsComponent.getInstance().state.junkDirectoryList .takeIf { it.isNotEmpty() } ?: return children diff --git a/src/com/intellij/idea/plugin/hybris/project/view/HybrisProjectViewNodeDecorator.kt b/src/com/intellij/idea/plugin/hybris/project/view/HybrisProjectViewNodeDecorator.kt index 466a1929e..2813c5b76 100644 --- a/src/com/intellij/idea/plugin/hybris/project/view/HybrisProjectViewNodeDecorator.kt +++ b/src/com/intellij/idea/plugin/hybris/project/view/HybrisProjectViewNodeDecorator.kt @@ -27,7 +27,7 @@ import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons import com.intellij.idea.plugin.hybris.common.yExtensionName import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorType import com.intellij.idea.plugin.hybris.project.utils.PluginCommon -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.roots.ProjectRootManager class HybrisProjectViewNodeDecorator : ProjectViewNodeDecorator { @@ -42,7 +42,7 @@ class HybrisProjectViewNodeDecorator : ProjectViewNodeDecorator { private fun decorateModule(node: PsiDirectoryNode, data: PresentationData) { val vf = node.virtualFile ?: return val module = ProjectRootManager.getInstance(node.project).fileIndex.getModuleForFile(vf) ?: return - val projectSettings = HybrisProjectSettingsComponent.getInstance(module.project) + val projectSettings = ProjectSettingsComponent.getInstance(module.project) if (!projectSettings.state.showFullModuleName) { data.coloredText diff --git a/src/com/intellij/idea/plugin/hybris/project/view/impl/HybrisProjectViewDirectoryHelper.kt b/src/com/intellij/idea/plugin/hybris/project/view/impl/HybrisProjectViewDirectoryHelper.kt index a67273bfc..d584840d3 100644 --- a/src/com/intellij/idea/plugin/hybris/project/view/impl/HybrisProjectViewDirectoryHelper.kt +++ b/src/com/intellij/idea/plugin/hybris/project/view/impl/HybrisProjectViewDirectoryHelper.kt @@ -22,7 +22,7 @@ import com.intellij.ide.projectView.impl.JavaProjectViewDirectoryHelper import com.intellij.ide.projectView.impl.nodes.ProjectViewDirectoryHelper import com.intellij.ide.projectView.impl.nodes.PsiFileSystemItemFilter import com.intellij.idea.plugin.hybris.common.HybrisConstants -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.project.Project import com.intellij.openapi.roots.ProjectFileIndex import com.intellij.openapi.roots.ProjectRootManager @@ -69,7 +69,7 @@ class HybrisProjectViewDirectoryHelper(project: Project) : ProjectViewDirectoryH override fun getTopLevelRoots(): MutableList { val topLevelContentRoots = super.getTopLevelRoots() - if (HybrisProjectSettingsComponent.getInstance(project).isHybrisProject()) { + if (ProjectSettingsComponent.getInstance(project).isHybrisProject()) { val prm = ProjectRootManager.getInstance(project) for (root in prm.contentRoots) { diff --git a/src/com/intellij/idea/plugin/hybris/project/wizard/OpenSupport.kt b/src/com/intellij/idea/plugin/hybris/project/wizard/OpenSupport.kt index c339d5f03..2ead83dd1 100644 --- a/src/com/intellij/idea/plugin/hybris/project/wizard/OpenSupport.kt +++ b/src/com/intellij/idea/plugin/hybris/project/wizard/OpenSupport.kt @@ -18,10 +18,10 @@ */ package com.intellij.idea.plugin.hybris.project.wizard -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettings +import com.intellij.idea.plugin.hybris.settings.ProjectSettings import com.intellij.openapi.options.ConfigurationException interface OpenSupport { @Throws(ConfigurationException::class) - fun open(settings: HybrisProjectSettings) + fun open(settings: ProjectSettings) } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/project/wizard/ProjectImportWizardRootStep.kt b/src/com/intellij/idea/plugin/hybris/project/wizard/ProjectImportWizardRootStep.kt index 394e534a2..12681f63f 100644 --- a/src/com/intellij/idea/plugin/hybris/project/wizard/ProjectImportWizardRootStep.kt +++ b/src/com/intellij/idea/plugin/hybris/project/wizard/ProjectImportWizardRootStep.kt @@ -24,8 +24,8 @@ import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.messag import com.intellij.idea.plugin.hybris.project.AbstractHybrisProjectImportBuilder import com.intellij.idea.plugin.hybris.project.tasks.SearchHybrisDistributionDirectoryTaskModalWindow import com.intellij.idea.plugin.hybris.project.utils.FileUtils -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettings +import com.intellij.idea.plugin.hybris.settings.ProjectSettings +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent import com.intellij.idea.plugin.hybris.ui.CRUDListPanel import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory @@ -331,7 +331,7 @@ class ProjectImportWizardRootStep(context: WizardContext) : ProjectImportWizardS horizontalScrollBarPolicy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER preferredSize = Dimension(preferredSize.width, JBUIScale.scale(600)) - val appSettings = HybrisApplicationSettingsComponent.getInstance() + val appSettings = ApplicationSettingsComponent.getInstance() sapCLIDirChooser.text = appSettings.state.sapCLIDirectory ?: "" appSettings.loadSAPCLIToken { @@ -395,7 +395,7 @@ class ProjectImportWizardRootStep(context: WizardContext) : ProjectImportWizardS } override fun updateStep() { - val appSettings = HybrisApplicationSettingsComponent.getInstance().state + val appSettings = ApplicationSettingsComponent.getInstance().state storeModuleFilesInChooser.text = File( builder.fileToImport, HybrisConstants.DEFAULT_DIRECTORY_NAME_FOR_IDEA_MODULE_FILES ).absolutePath @@ -490,12 +490,12 @@ class ProjectImportWizardRootStep(context: WizardContext) : ProjectImportWizardS } } - override fun open(settings: HybrisProjectSettings) { + override fun open(settings: ProjectSettings) { updateStep() updateDataModel() } - override fun refresh(settings: HybrisProjectSettings) { + override fun refresh(settings: ProjectSettings) { val context = context() context.cleanup() @@ -519,7 +519,7 @@ class ProjectImportWizardRootStep(context: WizardContext) : ProjectImportWizardS this.isScanThroughExternalModule = settings.scanThroughExternalModule this.isUseFakeOutputPathForCustomExtensions = settings.useFakeOutputPathForCustomExtensions - val appSettings = HybrisApplicationSettingsComponent.getInstance() + val appSettings = ApplicationSettingsComponent.getInstance() val appSettingsState = appSettings.state this.isIgnoreNonExistingSourceDirectories = appSettingsState.ignoreNonExistingSourceDirectories this.isWithStandardProvidedSources = appSettingsState.withStandardProvidedSources diff --git a/src/com/intellij/idea/plugin/hybris/project/wizard/RefreshSupport.kt b/src/com/intellij/idea/plugin/hybris/project/wizard/RefreshSupport.kt index 2f92ed547..ff1a7f307 100644 --- a/src/com/intellij/idea/plugin/hybris/project/wizard/RefreshSupport.kt +++ b/src/com/intellij/idea/plugin/hybris/project/wizard/RefreshSupport.kt @@ -18,10 +18,10 @@ */ package com.intellij.idea.plugin.hybris.project.wizard -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettings +import com.intellij.idea.plugin.hybris.settings.ProjectSettings import com.intellij.openapi.options.ConfigurationException interface RefreshSupport { @Throws(ConfigurationException::class) - fun refresh(settings: HybrisProjectSettings) + fun refresh(settings: ProjectSettings) } diff --git a/src/com/intellij/idea/plugin/hybris/project/wizard/SelectHybrisModulesToImportStep.kt b/src/com/intellij/idea/plugin/hybris/project/wizard/SelectHybrisModulesToImportStep.kt index ebfe2177f..5bc5202db 100644 --- a/src/com/intellij/idea/plugin/hybris/project/wizard/SelectHybrisModulesToImportStep.kt +++ b/src/com/intellij/idea/plugin/hybris/project/wizard/SelectHybrisModulesToImportStep.kt @@ -26,7 +26,7 @@ import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorImpor import com.intellij.idea.plugin.hybris.project.descriptors.YModuleDescriptor import com.intellij.idea.plugin.hybris.project.descriptors.YSubModuleDescriptor import com.intellij.idea.plugin.hybris.project.descriptors.impl.* -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettings +import com.intellij.idea.plugin.hybris.settings.ProjectSettings import com.intellij.openapi.options.ConfigurationException import com.intellij.ui.table.JBTable import org.apache.commons.lang3.BooleanUtils @@ -121,11 +121,11 @@ class SelectHybrisModulesToImportStep(wizard: WizardContext) : AbstractSelectMod context.setHybrisModulesToImport(allElements) } - override fun open(settings: HybrisProjectSettings) { + override fun open(settings: ProjectSettings) { refresh(settings) } - override fun refresh(settings: HybrisProjectSettings) { + override fun refresh(settings: ProjectSettings) { try { val filteredModuleToImport = context.getBestMatchingExtensionsToImport(settings) context.setList(filteredModuleToImport) diff --git a/src/com/intellij/idea/plugin/hybris/psi/util/PsiUtils.java b/src/com/intellij/idea/plugin/hybris/psi/util/PsiUtils.java index 42d02ce1b..6e65f6ff3 100644 --- a/src/com/intellij/idea/plugin/hybris/psi/util/PsiUtils.java +++ b/src/com/intellij/idea/plugin/hybris/psi/util/PsiUtils.java @@ -20,7 +20,7 @@ import com.intellij.idea.plugin.hybris.common.HybrisConstants; import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorType; -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent; +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleUtilCore; import com.intellij.openapi.project.Project; @@ -59,7 +59,7 @@ public static boolean isCustomExtensionFile(@NotNull final VirtualFile file, @No if (null == module) { return false; } - final var settingsComponent = HybrisProjectSettingsComponent.getInstance(project); + final var settingsComponent = ProjectSettingsComponent.getInstance(project); final var descriptorType = settingsComponent.getModuleSettings(module).getType(); if (descriptorType == ModuleDescriptorType.NONE) { @@ -74,7 +74,7 @@ public static boolean isCustomExtensionFile(@NotNull final VirtualFile file, @No private static boolean shouldCheckFilesWithoutHybrisSettings(@NotNull final Project project) { // at least it needs to have a hybris flag - return HybrisProjectSettingsComponent.getInstance(project).isHybrisProject(); + return ProjectSettingsComponent.getInstance(project).isHybrisProject(); } private static ModuleDescriptorType estimateIsCustomExtension(@NotNull final VirtualFile file) { diff --git a/src/com/intellij/idea/plugin/hybris/runConfigurations/HybrisJUnitExtension.kt b/src/com/intellij/idea/plugin/hybris/runConfigurations/HybrisJUnitExtension.kt index 951ea45a4..3eef9e71d 100644 --- a/src/com/intellij/idea/plugin/hybris/runConfigurations/HybrisJUnitExtension.kt +++ b/src/com/intellij/idea/plugin/hybris/runConfigurations/HybrisJUnitExtension.kt @@ -29,7 +29,7 @@ import com.intellij.idea.plugin.hybris.common.HybrisConstants.HYBRIS_DATA_DIRECT import com.intellij.idea.plugin.hybris.common.HybrisConstants.PROPERTY_STANDALONE_JDKMODULESEXPORTS import com.intellij.idea.plugin.hybris.project.utils.HybrisRootUtil import com.intellij.idea.plugin.hybris.properties.PropertyService -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.util.io.FileUtil import java.io.File import java.util.* @@ -40,7 +40,7 @@ private val PATTERN = Pattern.compile("\"") class HybrisJUnitExtension : RunConfigurationExtension() { override fun isApplicableFor(configuration: RunConfigurationBase<*>) = if (configuration !is JUnitConfiguration) false - else HybrisProjectSettingsComponent.getInstance(configuration.getProject()).isHybrisProject() + else ProjectSettingsComponent.getInstance(configuration.getProject()).isHybrisProject() override fun ?> updateJavaParameters(configuration: T & Any, params: JavaParameters, runnerSettings: RunnerSettings?) { if (runnerSettings != null || !isApplicableFor(configuration)) return @@ -57,7 +57,7 @@ class HybrisJUnitExtension : RunConfigurationExtension() { } if (!params.env.containsKey(ENV_HYBRIS_DATA_DIR)) { - val settings = HybrisProjectSettingsComponent.getInstance(project).state + val settings = ProjectSettingsComponent.getInstance(project).state val hybrisDataDirPath = FileUtil.toCanonicalPath( "${project.basePath}/${settings.hybrisDirectory}/$HYBRIS_DATA_DIRECTORY" ) diff --git a/src/com/intellij/idea/plugin/hybris/runConfigurations/LocalSapCXRunProfileState.kt b/src/com/intellij/idea/plugin/hybris/runConfigurations/LocalSapCXRunProfileState.kt index 85666a237..b76ff6cd4 100644 --- a/src/com/intellij/idea/plugin/hybris/runConfigurations/LocalSapCXRunProfileState.kt +++ b/src/com/intellij/idea/plugin/hybris/runConfigurations/LocalSapCXRunProfileState.kt @@ -27,7 +27,7 @@ import com.intellij.execution.process.ProcessHandlerFactory import com.intellij.execution.process.ProcessTerminatedListener import com.intellij.execution.runners.ExecutionEnvironment import com.intellij.idea.plugin.hybris.common.HybrisConstants -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.project.Project import org.apache.commons.lang3.SystemUtils import java.nio.file.Paths @@ -40,7 +40,7 @@ class LocalSapCXRunProfileState( private fun getScriptPath(): String { val basePath = project.basePath ?: "" - val settings = HybrisProjectSettingsComponent.getInstance(project).state + val settings = ProjectSettingsComponent.getInstance(project).state val hybrisDirectory = settings.hybrisDirectory ?: "" val script = if (SystemUtils.IS_OS_WINDOWS) HybrisConstants.HYBRIS_SERVER_BASH_SCRIPT_NAME else HybrisConstants.HYBRIS_SERVER_SHELL_SCRIPT_NAME @@ -49,7 +49,7 @@ class LocalSapCXRunProfileState( private fun getWorkDirectory(): String { val basePath = project.basePath ?: "" - val settings = HybrisProjectSettingsComponent.getInstance(project).state + val settings = ProjectSettingsComponent.getInstance(project).state val hybrisDirectory = settings.hybrisDirectory ?: "" return Paths.get(basePath, hybrisDirectory, HybrisConstants.PLATFORM_MODULE_PREFIX).toString() diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisApplicationSettings.kt b/src/com/intellij/idea/plugin/hybris/settings/ApplicationSettings.kt similarity index 92% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisApplicationSettings.kt rename to src/com/intellij/idea/plugin/hybris/settings/ApplicationSettings.kt index d9e3e6537..906d109d4 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisApplicationSettings.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/ApplicationSettings.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -19,8 +19,10 @@ package com.intellij.idea.plugin.hybris.settings import com.intellij.idea.plugin.hybris.common.HybrisConstants +import com.intellij.util.xmlb.annotations.Tag -data class HybrisApplicationSettings( +@Tag("HybrisApplicationSettings") +data class ApplicationSettings( var groupModules: Boolean = true, var groupExternalModules: Boolean = true, diff --git a/src/com/intellij/idea/plugin/hybris/system/bean/settings/BeanSystemSettings.kt b/src/com/intellij/idea/plugin/hybris/settings/BeanSystemSettings.kt similarity index 82% rename from src/com/intellij/idea/plugin/hybris/system/bean/settings/BeanSystemSettings.kt rename to src/com/intellij/idea/plugin/hybris/settings/BeanSystemSettings.kt index 387dbc87d..d071bfae6 100644 --- a/src/com/intellij/idea/plugin/hybris/system/bean/settings/BeanSystemSettings.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/BeanSystemSettings.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.system.bean.settings - -import com.intellij.idea.plugin.hybris.settings.FoldingSettings +package com.intellij.idea.plugin.hybris.settings data class BeanSystemSettings( var folding: BeanSystemFoldingSettings = BeanSystemFoldingSettings(), diff --git a/src/com/intellij/idea/plugin/hybris/system/businessProcess/settings/BpSettings.kt b/src/com/intellij/idea/plugin/hybris/settings/BpSettings.kt similarity index 82% rename from src/com/intellij/idea/plugin/hybris/system/businessProcess/settings/BpSettings.kt rename to src/com/intellij/idea/plugin/hybris/settings/BpSettings.kt index 65705093a..4b1058fd9 100644 --- a/src/com/intellij/idea/plugin/hybris/system/businessProcess/settings/BpSettings.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/BpSettings.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.system.businessProcess.settings - -import com.intellij.idea.plugin.hybris.settings.FoldingSettings +package com.intellij.idea.plugin.hybris.settings data class BpSettings( var folding: BpFoldingSettings = BpFoldingSettings(), diff --git a/src/com/intellij/idea/plugin/hybris/system/cockpitng/settings/CngSettings.kt b/src/com/intellij/idea/plugin/hybris/settings/CngSettings.kt similarity index 84% rename from src/com/intellij/idea/plugin/hybris/system/cockpitng/settings/CngSettings.kt rename to src/com/intellij/idea/plugin/hybris/settings/CngSettings.kt index db12d50dd..894a6bac9 100644 --- a/src/com/intellij/idea/plugin/hybris/system/cockpitng/settings/CngSettings.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/CngSettings.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.system.cockpitng.settings - -import com.intellij.idea.plugin.hybris.settings.FoldingSettings +package com.intellij.idea.plugin.hybris.settings data class CngSettings( var folding: CngFoldingSettings = CngFoldingSettings(), diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisDeveloperSpecificProjectSettings.kt b/src/com/intellij/idea/plugin/hybris/settings/DeveloperSettings.kt similarity index 71% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisDeveloperSpecificProjectSettings.kt rename to src/com/intellij/idea/plugin/hybris/settings/DeveloperSettings.kt index 6ecbb249c..e308b2401 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisDeveloperSpecificProjectSettings.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/DeveloperSettings.kt @@ -20,20 +20,17 @@ package com.intellij.idea.plugin.hybris.settings import com.intellij.idea.plugin.hybris.flexibleSearch.settings.FlexibleSearchSettings import com.intellij.idea.plugin.hybris.groovy.settings.GroovySettings -import com.intellij.idea.plugin.hybris.impex.settings.ImpexSettings import com.intellij.idea.plugin.hybris.polyglotQuery.settings.PolyglotQuerySettings -import com.intellij.idea.plugin.hybris.system.bean.settings.BeanSystemSettings -import com.intellij.idea.plugin.hybris.system.businessProcess.settings.BpSettings -import com.intellij.idea.plugin.hybris.system.cockpitng.settings.CngSettings -import com.intellij.idea.plugin.hybris.system.type.settings.TSDiagramSettings -import com.intellij.idea.plugin.hybris.system.type.settings.TypeSystemSettings import com.intellij.openapi.components.BaseState +import com.intellij.util.xmlb.annotations.Tag -class HybrisDeveloperSpecificProjectSettings : BaseState() { +@Tag("HybrisDeveloperSpecificProjectSettings") +class DeveloperSettings : BaseState() { var activeRemoteConnectionID by string(null) var activeSolrConnectionID by string(null) - var remoteConnectionSettingsList by list() - var typeSystemDiagramSettings by property(TSDiagramSettings()) { false } + var activeCCv2SubscriptionID by string(null) + var remoteConnectionSettingsList by list() + var typeSystemDiagramSettings by property(TypeSystemDiagramSettings()) { false } var beanSystemSettings by property(BeanSystemSettings()) { false } var typeSystemSettings by property(TypeSystemSettings()) { false } var cngSettings by property(CngSettings()) { false } @@ -42,5 +39,4 @@ class HybrisDeveloperSpecificProjectSettings : BaseState() { var polyglotQuerySettings by property(PolyglotQuerySettings()) { false } var impexSettings by property(ImpexSettings()) { false } var groovySettings by property(GroovySettings()) { false } - var activeCCv2Subscription by string(null) } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/settings/FoldingSettings.kt b/src/com/intellij/idea/plugin/hybris/settings/FoldingSettings.kt index 1bf35e8d8..b6964ee25 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/FoldingSettings.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/FoldingSettings.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectDiagramTSSettingsConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectDiagramTSSettingsConfigurableProvider.kt deleted file mode 100644 index ecd197535..000000000 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectDiagramTSSettingsConfigurableProvider.kt +++ /dev/null @@ -1,109 +0,0 @@ -/* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems 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 - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.intellij.idea.plugin.hybris.settings - -import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message -import com.intellij.idea.plugin.hybris.settings.components.TSDiagramSettingsExcludedTypeNameTable -import com.intellij.openapi.options.BoundSearchableConfigurable -import com.intellij.openapi.options.ConfigurableProvider -import com.intellij.openapi.project.Project -import com.intellij.ui.ToolbarDecorator -import com.intellij.ui.dsl.builder.Align -import com.intellij.ui.dsl.builder.bindSelected -import com.intellij.ui.dsl.builder.panel -import com.intellij.util.ui.JBUI -import java.awt.Dimension - -class HybrisProjectDiagramTSSettingsConfigurableProvider(val project: Project) : ConfigurableProvider() { - - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() - override fun createConfigurable() = SettingsConfigurable(project) - - class SettingsConfigurable(project: Project) : BoundSearchableConfigurable( - message("hybris.settings.project.diagram.ts.title"), "[y] SAP Commerce plugin Type System Diagram configuration." - ) { - - private val tsSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.typeSystemDiagramSettings - - private val excludedTypeNamesTable = TSDiagramSettingsExcludedTypeNameTable.getInstance(project) - private val excludedTypeNamesPane = ToolbarDecorator.createDecorator(excludedTypeNamesTable) - .disableUpDownActions() - .setPanelBorder(JBUI.Borders.empty()) - .createPanel() - - init { - excludedTypeNamesPane.minimumSize = Dimension(excludedTypeNamesPane.width, 400) - } - - override fun createPanel() = panel { - group("Common Settings") { - row { - checkBox("Nodes collapsed by default") - .bindSelected(tsSettings::nodesCollapsedByDefault) - } - - row { - checkBox("Show OOTB Map nodes") - .comment("One of the OOTB Map example is `localized:java.lang.String`") - .bindSelected(tsSettings::showOOTBMapNodes) - } - - row { - checkBox("Show custom Atomic nodes") - .bindSelected(tsSettings::showCustomAtomicNodes) - } - - row { - checkBox("Show custom Collection nodes") - .bindSelected(tsSettings::showCustomCollectionNodes) - } - - row { - checkBox("Show custom Enum nodes") - .bindSelected(tsSettings::showCustomEnumNodes) - } - - row { - checkBox("Show custom Map nodes") - .bindSelected(tsSettings::showCustomMapNodes) - } - - row { - checkBox("Show custom Relation nodes") - .comment("Relations with Deployment details are not affected by this flag") - .bindSelected(tsSettings::showCustomRelationNodes) - } - } - - group("Excluded Type Names", false) { - row { - cell(excludedTypeNamesPane) - .onApply { tsSettings.excludedTypeNames = getNewTypeNames() } - .onReset { excludedTypeNamesTable.updateModel(tsSettings) } - .onIsModified { tsSettings.excludedTypeNames != getNewTypeNames() } - .align(Align.FILL) - } - } - } - - private fun getNewTypeNames() = excludedTypeNamesTable.getItems() - .map { it.typeName } - .toMutableSet() - } -} diff --git a/src/com/intellij/idea/plugin/hybris/impex/settings/ImpexSettings.kt b/src/com/intellij/idea/plugin/hybris/settings/ImpExSettings.kt similarity index 90% rename from src/com/intellij/idea/plugin/hybris/impex/settings/ImpexSettings.kt rename to src/com/intellij/idea/plugin/hybris/settings/ImpExSettings.kt index f5e34584b..82c5f858a 100644 --- a/src/com/intellij/idea/plugin/hybris/impex/settings/ImpexSettings.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/ImpExSettings.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2023 EPAM Systems + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.impex.settings +package com.intellij.idea.plugin.hybris.settings import com.intellij.openapi.components.BaseState diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectSettings.kt b/src/com/intellij/idea/plugin/hybris/settings/ProjectSettings.kt similarity index 92% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisProjectSettings.kt rename to src/com/intellij/idea/plugin/hybris/settings/ProjectSettings.kt index c5cd055c5..4e111e619 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectSettings.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/ProjectSettings.kt @@ -1,5 +1,5 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellire IDEA. + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. * Copyright (C) 2019-2024 EPAM Systems and contributors * * This program is free software: you can redistribute it and/or modify @@ -20,9 +20,11 @@ package com.intellij.idea.plugin.hybris.settings import com.intellij.idea.plugin.hybris.facet.ExtensionDescriptor import com.intellij.openapi.components.BaseState +import com.intellij.util.xmlb.annotations.Tag import java.util.* -class HybrisProjectSettings : BaseState() { +@Tag("HybrisProjectSettings") +class ProjectSettings : BaseState() { var customDirectory by string(null) var hybrisDirectory by string(null) var configDirectory by string(null) @@ -49,7 +51,7 @@ class HybrisProjectSettings : BaseState() { var modulesOnBlackList by stringSet() var availableExtensions by property(TreeMap { a, b -> a.compareTo(b, true) }) { it.isEmpty() } var excludedFromScanning by stringSet() - var remoteConnectionSettingsList by list() + var remoteConnectionSettingsList by list() var useFakeOutputPathForCustomExtensions by property(false) var activeCCv2Subscription by string(null) } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisRemoteConnectionSettings.kt b/src/com/intellij/idea/plugin/hybris/settings/RemoteConnectionSettings.kt similarity index 90% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisRemoteConnectionSettings.kt rename to src/com/intellij/idea/plugin/hybris/settings/RemoteConnectionSettings.kt index 7a1c87d8c..6a27abb7d 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisRemoteConnectionSettings.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/RemoteConnectionSettings.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -27,9 +27,11 @@ import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionType import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionUtil import com.intellij.openapi.components.BaseState import com.intellij.util.xmlb.Accessor +import com.intellij.util.xmlb.annotations.Tag import com.intellij.util.xmlb.annotations.Transient -class HybrisRemoteConnectionSettings : BaseState(), Comparable { +@Tag("HybrisRemoteConnectionSettings") +class RemoteConnectionSettings : BaseState(), Comparable { var uuid by string(null) @Transient @@ -79,13 +81,13 @@ class HybrisRemoteConnectionSettings : BaseState(), Comparable + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 diff --git a/src/com/intellij/idea/plugin/hybris/system/type/settings/TSDiagramSettings.kt b/src/com/intellij/idea/plugin/hybris/settings/TypeSystemSettings.kt similarity index 65% rename from src/com/intellij/idea/plugin/hybris/system/type/settings/TSDiagramSettings.kt rename to src/com/intellij/idea/plugin/hybris/settings/TypeSystemSettings.kt index 2df1a1962..593127c9c 100644 --- a/src/com/intellij/idea/plugin/hybris/system/type/settings/TSDiagramSettings.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/TypeSystemSettings.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,11 +16,28 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.system.type.settings +package com.intellij.idea.plugin.hybris.settings import com.intellij.idea.plugin.hybris.common.HybrisConstants +import com.intellij.util.xmlb.annotations.Tag -data class TSDiagramSettings( +data class TypeSystemSettings( + var folding: TypeSystemFoldingSettings = TypeSystemFoldingSettings(), +) + +data class TypeSystemFoldingSettings( + override var enabled: Boolean = true, + var tablifyAtomics: Boolean = true, + var tablifyCollections: Boolean = true, + var tablifyMaps: Boolean = true, + var tablifyRelations: Boolean = true, + var tablifyItemAttributes: Boolean = true, + var tablifyItemIndexes: Boolean = true, + var tablifyItemCustomProperties: Boolean = true, +): FoldingSettings + +@Tag("TSDiagramSettings") +data class TypeSystemDiagramSettings( var nodesCollapsedByDefault: Boolean = true, var showOOTBMapNodes: Boolean = false, var showCustomAtomicNodes: Boolean = false, @@ -35,4 +52,4 @@ data class TSDiagramSettings( HybrisConstants.TS_TYPE_EXTENSIBLE_ITEM, HybrisConstants.TS_TYPE_CRON_JOB ) -) +) \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisApplicationSettingsComponent.kt b/src/com/intellij/idea/plugin/hybris/settings/components/ApplicationSettingsComponent.kt similarity index 85% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisApplicationSettingsComponent.kt rename to src/com/intellij/idea/plugin/hybris/settings/components/ApplicationSettingsComponent.kt index 129a464f5..fc43ce365 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisApplicationSettingsComponent.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/components/ApplicationSettingsComponent.kt @@ -1,7 +1,7 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. * Copyright (C) 2014-2016 Alexander Bartash - * Copyright (C) 2019-2023 EPAM Systems and contributors + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,12 +16,13 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.settings +package com.intellij.idea.plugin.hybris.settings.components import com.intellij.credentialStore.CredentialAttributes import com.intellij.ide.passwordSafe.PasswordSafe import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.HybrisConstants.STORAGE_HYBRIS_INTEGRATION_SETTINGS +import com.intellij.idea.plugin.hybris.settings.ApplicationSettings import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.* import com.intellij.openapi.progress.ProgressIndicator @@ -36,16 +37,16 @@ import org.apache.commons.lang3.StringUtils storages = [Storage(value = STORAGE_HYBRIS_INTEGRATION_SETTINGS, roamingType = RoamingType.DISABLED)] ) @Service -class HybrisApplicationSettingsComponent : PersistentStateComponent { +class ApplicationSettingsComponent : PersistentStateComponent { - private val hybrisApplicationSettings = HybrisApplicationSettings() + private val hybrisApplicationSettings = ApplicationSettings() val ccv2Token: String? get() = PasswordSafe.instance.get(CredentialAttributes(HybrisConstants.SECURE_STORAGE_SERVICE_NAME_SAP_CX_CCV2_TOKEN)) ?.getPasswordAsString() override fun getState() = this.hybrisApplicationSettings - override fun loadState(state: HybrisApplicationSettings) { + override fun loadState(state: ApplicationSettings) { XmlSerializerUtil.copyBean(state, this.hybrisApplicationSettings) } @@ -74,7 +75,7 @@ class HybrisApplicationSettingsComponent : PersistentStateComponent? { diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisDeveloperSpecificProjectSettingsComponent.kt b/src/com/intellij/idea/plugin/hybris/settings/components/DeveloperSettingsComponent.kt similarity index 65% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisDeveloperSpecificProjectSettingsComponent.kt rename to src/com/intellij/idea/plugin/hybris/settings/components/DeveloperSettingsComponent.kt index 14df85050..0a99a6849 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisDeveloperSpecificProjectSettingsComponent.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/components/DeveloperSettingsComponent.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -15,9 +15,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.settings +package com.intellij.idea.plugin.hybris.settings.components import com.intellij.idea.plugin.hybris.common.HybrisConstants.STORAGE_HYBRIS_DEVELOPER_SPECIFIC_PROJECT_SETTINGS +import com.intellij.idea.plugin.hybris.settings.DeveloperSettings import com.intellij.openapi.components.* import com.intellij.openapi.project.Project import com.intellij.util.xmlb.XmlSerializerUtil @@ -27,18 +28,18 @@ import com.intellij.util.xmlb.XmlSerializerUtil storages = [Storage(value = STORAGE_HYBRIS_DEVELOPER_SPECIFIC_PROJECT_SETTINGS, roamingType = RoamingType.DISABLED)] ) @Service(Service.Level.PROJECT) -class HybrisDeveloperSpecificProjectSettingsComponent(private val project: Project) : PersistentStateComponent { +class DeveloperSettingsComponent(private val project: Project) : PersistentStateComponent { - private val state = HybrisDeveloperSpecificProjectSettings() + private val state = DeveloperSettings() override fun getState() = state - override fun loadState(state: HybrisDeveloperSpecificProjectSettings) = XmlSerializerUtil.copyBean(state, this.state) + override fun loadState(state: DeveloperSettings) = XmlSerializerUtil.copyBean(state, this.state) - fun getActiveCCv2Subscription() = state.activeCCv2Subscription - ?.let { HybrisApplicationSettingsComponent.getInstance().getCCv2Subscription(it) } + fun getActiveCCv2Subscription() = state.activeCCv2SubscriptionID + ?.let { ApplicationSettingsComponent.getInstance().getCCv2Subscription(it) } companion object { @JvmStatic - fun getInstance(project: Project): HybrisDeveloperSpecificProjectSettingsComponent = project.getService(HybrisDeveloperSpecificProjectSettingsComponent::class.java) + fun getInstance(project: Project): DeveloperSettingsComponent = project.getService(DeveloperSettingsComponent::class.java) } } diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectSettingsComponent.kt b/src/com/intellij/idea/plugin/hybris/settings/components/ProjectSettingsComponent.kt similarity index 84% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisProjectSettingsComponent.kt rename to src/com/intellij/idea/plugin/hybris/settings/components/ProjectSettingsComponent.kt index eb46eb1f5..f8760c96e 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectSettingsComponent.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/components/ProjectSettingsComponent.kt @@ -1,7 +1,7 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. * Copyright (C) 2014-2016 Alexander Bartash - * Copyright (C) 2019-2023 EPAM Systems and contributors + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,7 +16,7 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.settings +package com.intellij.idea.plugin.hybris.settings.components import com.intellij.ide.plugins.PluginManagerCore import com.intellij.idea.plugin.hybris.common.HybrisConstants @@ -26,6 +26,7 @@ import com.intellij.idea.plugin.hybris.facet.ExtensionDescriptor import com.intellij.idea.plugin.hybris.facet.YFacet import com.intellij.idea.plugin.hybris.project.descriptors.ModuleDescriptorType import com.intellij.idea.plugin.hybris.project.descriptors.YModuleDescriptor +import com.intellij.idea.plugin.hybris.settings.ProjectSettings import com.intellij.openapi.components.* import com.intellij.openapi.extensions.PluginId import com.intellij.openapi.module.Module @@ -35,11 +36,11 @@ import com.intellij.util.xmlb.XmlSerializerUtil @State(name = "HybrisProjectSettings", storages = [Storage(STORAGE_HYBRIS_PROJECT_SETTINGS, roamingType = RoamingType.DISABLED)]) @Service(Service.Level.PROJECT) -class HybrisProjectSettingsComponent : PersistentStateComponent { - private val hybrisProjectSettings = HybrisProjectSettings() +class ProjectSettingsComponent : PersistentStateComponent { + private val hybrisProjectSettings = ProjectSettings() override fun getState() = hybrisProjectSettings - override fun loadState(state: HybrisProjectSettings) = XmlSerializerUtil.copyBean(state, hybrisProjectSettings) + override fun loadState(state: ProjectSettings) = XmlSerializerUtil.copyBean(state, hybrisProjectSettings) // TODO: improve this logic for initially non-hybris projects fun isHybrisProject() = state.hybrisProject @@ -83,10 +84,10 @@ class HybrisProjectSettingsComponent : PersistentStateComponent and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -15,9 +15,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.settings +package com.intellij.idea.plugin.hybris.settings.options import com.intellij.idea.plugin.hybris.common.equalsIgnoreOrder +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent import com.intellij.idea.plugin.hybris.tools.ccv2.strategies.CCv2Strategy import com.intellij.idea.plugin.hybris.ui.CCv2SubscriptionListPanel import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory @@ -27,7 +28,7 @@ import com.intellij.ui.components.JBPasswordField import com.intellij.ui.components.textFieldWithBrowseButton import com.intellij.ui.dsl.builder.* -class CCv2SettingsConfigurableProvider : ConfigurableProvider() { +class ApplicationCCv2SettingsConfigurableProvider : ConfigurableProvider() { override fun createConfigurable() = SettingsConfigurable() @@ -35,7 +36,7 @@ class CCv2SettingsConfigurableProvider : ConfigurableProvider() { "CCv2", "[y] SAP Commerce Cloud CCv2 configuration." ) { - private val appSettings = HybrisApplicationSettingsComponent.getInstance() + private val appSettings = ApplicationSettingsComponent.getInstance() private val state = appSettings.state private var originalSAPCLIToken: String? = "" private var originalCCv2Subscriptions = state.ccv2Subscriptions diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectImportApplicationSettingsConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/settings/options/ApplicationProjectImportSettingsConfigurableProvider.kt similarity index 94% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisProjectImportApplicationSettingsConfigurableProvider.kt rename to src/com/intellij/idea/plugin/hybris/settings/options/ApplicationProjectImportSettingsConfigurableProvider.kt index 8d1abd7dc..1841febd0 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectImportApplicationSettingsConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/options/ApplicationProjectImportSettingsConfigurableProvider.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -15,11 +15,12 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.settings +package com.intellij.idea.plugin.hybris.settings.options import com.intellij.idea.plugin.hybris.common.equalsIgnoreOrder import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent import com.intellij.idea.plugin.hybris.ui.CRUDListPanel import com.intellij.openapi.options.BoundSearchableConfigurable import com.intellij.openapi.options.ConfigurableProvider @@ -27,15 +28,15 @@ import com.intellij.ui.dsl.builder.* import com.intellij.ui.layout.selected import javax.swing.JCheckBox -class HybrisProjectImportApplicationSettingsConfigurableProvider : ConfigurableProvider() { +class ApplicationProjectImportSettingsConfigurableProvider : ConfigurableProvider() { override fun createConfigurable() = SettingsConfigurable() class SettingsConfigurable : BoundSearchableConfigurable( - message("hybris.settings.application.project_import.title"), "[y] SAP Commerce plugin project import configuration." + message("hybris.settings.application.project_import.title"), "[y] SAP CX project import configuration." ) { - private val state = HybrisApplicationSettingsComponent.getInstance().state + private val state = ApplicationSettingsComponent.getInstance().state private lateinit var groupModulesCheckBox: JCheckBox private lateinit var externalModulesCheckBox: JCheckBox diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisApplicationSettingsConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/settings/options/ApplicationSettingsConfigurableProvider.kt similarity index 87% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisApplicationSettingsConfigurableProvider.kt rename to src/com/intellij/idea/plugin/hybris/settings/options/ApplicationSettingsConfigurableProvider.kt index 33f91c583..bf223bab6 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisApplicationSettingsConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/options/ApplicationSettingsConfigurableProvider.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -15,23 +15,24 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.settings +package com.intellij.idea.plugin.hybris.settings.options import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent import com.intellij.openapi.options.BoundSearchableConfigurable import com.intellij.openapi.options.ConfigurableProvider import com.intellij.ui.dsl.builder.bindSelected import com.intellij.ui.dsl.builder.panel -class HybrisApplicationSettingsConfigurableProvider : ConfigurableProvider() { +class ApplicationSettingsConfigurableProvider : ConfigurableProvider() { override fun createConfigurable() = SettingsConfigurable() class SettingsConfigurable : BoundSearchableConfigurable( - "[y] SAP Commerce", "[y] SAP Commerce plugin configuration." + "[y] SAP Commerce", "[y] SAP CX configuration." ) { - private val state = HybrisApplicationSettingsComponent.getInstance().state + private val state = ApplicationSettingsComponent.getInstance().state override fun createPanel() = panel { row { diff --git a/src/com/intellij/idea/plugin/hybris/system/bean/settings/BeanSystemConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectBeanSystemConfigurableProvider.kt similarity index 73% rename from src/com/intellij/idea/plugin/hybris/system/bean/settings/BeanSystemConfigurableProvider.kt rename to src/com/intellij/idea/plugin/hybris/settings/options/ProjectBeanSystemConfigurableProvider.kt index b6dde2fb1..cf219931c 100644 --- a/src/com/intellij/idea/plugin/hybris/system/bean/settings/BeanSystemConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectBeanSystemConfigurableProvider.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.system.bean.settings +package com.intellij.idea.plugin.hybris.settings.options import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.options.BoundSearchableConfigurable import com.intellij.openapi.options.ConfigurableProvider import com.intellij.openapi.project.Project @@ -29,16 +29,16 @@ import com.intellij.ui.dsl.builder.panel import com.intellij.ui.layout.selected import javax.swing.JCheckBox -class BeanSystemConfigurableProvider(val project: Project) : ConfigurableProvider() { +class ProjectBeanSystemConfigurableProvider(val project: Project) : ConfigurableProvider() { - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun canCreateConfigurable() = ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun createConfigurable() = SettingsConfigurable(project) class SettingsConfigurable(project: Project) : BoundSearchableConfigurable( - message("hybris.settings.project.bs.title"), "[y] SAP Commerce plugin Bean System configuration." + message("hybris.settings.project.bs.title"), "[y] SAP CX Bean System configuration." ) { - private val settings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.beanSystemSettings + private val settings = DeveloperSettingsComponent.getInstance(project).state.beanSystemSettings private lateinit var foldingEnableCheckBox: JCheckBox diff --git a/src/com/intellij/idea/plugin/hybris/system/businessProcess/settings/BpConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectBusinessProcessConfigurableProvider.kt similarity index 76% rename from src/com/intellij/idea/plugin/hybris/system/businessProcess/settings/BpConfigurableProvider.kt rename to src/com/intellij/idea/plugin/hybris/settings/options/ProjectBusinessProcessConfigurableProvider.kt index 24d484892..424acf28d 100644 --- a/src/com/intellij/idea/plugin/hybris/system/businessProcess/settings/BpConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectBusinessProcessConfigurableProvider.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.system.businessProcess.settings +package com.intellij.idea.plugin.hybris.settings.options import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.options.BoundSearchableConfigurable import com.intellij.openapi.options.ConfigurableProvider import com.intellij.openapi.project.Project @@ -29,16 +29,16 @@ import com.intellij.ui.dsl.builder.panel import com.intellij.ui.layout.selected import javax.swing.JCheckBox -class BpConfigurableProvider(val project: Project) : ConfigurableProvider() { +class ProjectBusinessProcessConfigurableProvider(val project: Project) : ConfigurableProvider() { - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun canCreateConfigurable() = ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun createConfigurable() = SettingsConfigurable(project) class SettingsConfigurable(project: Project) : BoundSearchableConfigurable( - message("hybris.settings.project.bp.title"), "[y] SAP Commerce plugin Business Process configuration." + message("hybris.settings.project.bp.title"), "[y] SAP CX Business Process configuration." ) { - private val settings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.bpSettings + private val settings = DeveloperSettingsComponent.getInstance(project).state.bpSettings private lateinit var foldingEnableCheckBox: JCheckBox diff --git a/src/com/intellij/idea/plugin/hybris/system/cockpitng/settings/CngConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectCngSettingsConfigurableProvider.kt similarity index 81% rename from src/com/intellij/idea/plugin/hybris/system/cockpitng/settings/CngConfigurableProvider.kt rename to src/com/intellij/idea/plugin/hybris/settings/options/ProjectCngSettingsConfigurableProvider.kt index 48b3a18f5..fe20e21ad 100644 --- a/src/com/intellij/idea/plugin/hybris/system/cockpitng/settings/CngConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectCngSettingsConfigurableProvider.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.system.cockpitng.settings +package com.intellij.idea.plugin.hybris.settings.options import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.options.BoundSearchableConfigurable import com.intellij.openapi.options.ConfigurableProvider import com.intellij.openapi.project.Project @@ -29,16 +29,16 @@ import com.intellij.ui.dsl.builder.panel import com.intellij.ui.layout.selected import javax.swing.JCheckBox -class CngConfigurableProvider(val project: Project) : ConfigurableProvider() { +class ProjectCngSettingsConfigurableProvider(val project: Project) : ConfigurableProvider() { - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun canCreateConfigurable() = ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun createConfigurable() = SettingsConfigurable(project) class SettingsConfigurable(project: Project) : BoundSearchableConfigurable( - message("hybris.settings.project.cng.title"), "[y] SAP Commerce plugin Cockpit NG configuration." + message("hybris.settings.project.cng.title"), "[y] SAP CX Cockpit NG configuration." ) { - private val settings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.cngSettings + private val settings = DeveloperSettingsComponent.getInstance(project).state.cngSettings private lateinit var foldingEnableCheckBox: JCheckBox diff --git a/src/com/intellij/idea/plugin/hybris/impex/settings/ImpexSettingsConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectImpExSettingsConfigurableProvider.kt similarity index 90% rename from src/com/intellij/idea/plugin/hybris/impex/settings/ImpexSettingsConfigurableProvider.kt rename to src/com/intellij/idea/plugin/hybris/settings/options/ProjectImpExSettingsConfigurableProvider.kt index 16475edec..992304db1 100644 --- a/src/com/intellij/idea/plugin/hybris/impex/settings/ImpexSettingsConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectImpExSettingsConfigurableProvider.kt @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.impex.settings +package com.intellij.idea.plugin.hybris.settings.options import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.options.BoundSearchableConfigurable import com.intellij.openapi.options.ConfigurableProvider import com.intellij.openapi.project.Project @@ -29,16 +29,16 @@ import com.intellij.ui.dsl.builder.panel import com.intellij.ui.layout.selected import javax.swing.JCheckBox -class ImpexSettingsConfigurableProvider(val project: Project) : ConfigurableProvider() { +class ProjectImpExSettingsConfigurableProvider(val project: Project) : ConfigurableProvider() { - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun canCreateConfigurable() = ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun createConfigurable() = SettingsConfigurable(project) class SettingsConfigurable(project: Project) : BoundSearchableConfigurable( message("hybris.settings.project.impex.title"), "hybris.impex.settings" ) { - private val projectSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.impexSettings + private val projectSettings = DeveloperSettingsComponent.getInstance(project).state.impexSettings private lateinit var foldingEnableCheckBox: JCheckBox private lateinit var documentationEnableCheckBox: JCheckBox diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectRemoteInstancesSettingsConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectRemoteInstancesSettingsConfigurableProvider.kt similarity index 81% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisProjectRemoteInstancesSettingsConfigurableProvider.kt rename to src/com/intellij/idea/plugin/hybris/settings/options/ProjectRemoteInstancesSettingsConfigurableProvider.kt index 42b1d5ef1..b84dd9d82 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectRemoteInstancesSettingsConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectRemoteInstancesSettingsConfigurableProvider.kt @@ -1,6 +1,6 @@ /* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 @@ -16,10 +16,12 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.settings +package com.intellij.idea.plugin.hybris.settings.options import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionType import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionUtil import com.intellij.idea.plugin.hybris.ui.RemoteHacInstancesListPanel @@ -34,9 +36,9 @@ import com.intellij.ui.dsl.builder.RowLayout import com.intellij.ui.dsl.builder.panel import javax.swing.DefaultComboBoxModel -class HybrisProjectRemoteInstancesSettingsConfigurableProvider(val project: Project) : ConfigurableProvider(), Disposable { +class ProjectRemoteInstancesSettingsConfigurableProvider(val project: Project) : ConfigurableProvider(), Disposable { - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun canCreateConfigurable() = ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun createConfigurable() = SettingsConfigurable(project) class SettingsConfigurable(private val project: Project) : BoundSearchableConfigurable( @@ -48,14 +50,14 @@ class HybrisProjectRemoteInstancesSettingsConfigurableProvider(val project: Proj private val currentActiveHybrisConnection = RemoteConnectionUtil.getActiveRemoteConnectionSettings(project, RemoteConnectionType.Hybris) private val currentActiveSolrConnection = RemoteConnectionUtil.getActiveRemoteConnectionSettings(project, RemoteConnectionType.SOLR) - private val activeHacServerModel = DefaultComboBoxModel() - private val activeSolrServerModel = DefaultComboBoxModel() + private val activeHacServerModel = DefaultComboBoxModel() + private val activeSolrServerModel = DefaultComboBoxModel() private val hacInstances = RemoteHacInstancesListPanel(project) { _, data -> - if (!isReset) updateModel(activeHacServerModel, activeHacServerModel.selectedItem as HybrisRemoteConnectionSettings?, data) + if (!isReset) updateModel(activeHacServerModel, activeHacServerModel.selectedItem as RemoteConnectionSettings?, data) } private val solrInstances = RemoteSolrInstancesListPanel(project) { _, data -> - if (!isReset) updateModel(activeSolrServerModel, activeSolrServerModel.selectedItem as HybrisRemoteConnectionSettings?, data) + if (!isReset) updateModel(activeSolrServerModel, activeSolrServerModel.selectedItem as RemoteConnectionSettings?, data) } override fun createPanel() = panel { @@ -67,11 +69,11 @@ class HybrisProjectRemoteInstancesSettingsConfigurableProvider(val project: Proj ) .label(message("hybris.settings.project.remote_instances.hac.active.title")) .onApply { - (activeHacServerModel.selectedItem as HybrisRemoteConnectionSettings?) + (activeHacServerModel.selectedItem as RemoteConnectionSettings?) ?.let { settings -> RemoteConnectionUtil.setActiveRemoteConnectionSettings(project, settings) } } .onIsModified { - (activeHacServerModel.selectedItem as HybrisRemoteConnectionSettings?) + (activeHacServerModel.selectedItem as RemoteConnectionSettings?) ?.let { it.uuid != RemoteConnectionUtil.getActiveRemoteConnectionId(project, it.type) } ?: false } @@ -86,11 +88,11 @@ class HybrisProjectRemoteInstancesSettingsConfigurableProvider(val project: Proj ) .label(message("hybris.settings.project.remote_instances.solr.active.title")) .onApply { - (activeSolrServerModel.selectedItem as HybrisRemoteConnectionSettings?) + (activeSolrServerModel.selectedItem as RemoteConnectionSettings?) ?.let { settings -> RemoteConnectionUtil.setActiveRemoteConnectionSettings(project, settings) } } .onIsModified { - (activeSolrServerModel.selectedItem as HybrisRemoteConnectionSettings?) + (activeSolrServerModel.selectedItem as RemoteConnectionSettings?) ?.let { it.uuid != RemoteConnectionUtil.getActiveRemoteConnectionId(project, it.type) } ?: false } @@ -125,9 +127,9 @@ class HybrisProjectRemoteInstancesSettingsConfigurableProvider(val project: Proj } private fun updateModel( - model: DefaultComboBoxModel, - activeConnection: HybrisRemoteConnectionSettings?, - connectionSettings: Collection + model: DefaultComboBoxModel, + activeConnection: RemoteConnectionSettings?, + connectionSettings: Collection ) { model.removeAllElements() model.addAll(connectionSettings) diff --git a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectSettingsConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectSettingsConfigurableProvider.kt similarity index 77% rename from src/com/intellij/idea/plugin/hybris/settings/HybrisProjectSettingsConfigurableProvider.kt rename to src/com/intellij/idea/plugin/hybris/settings/options/ProjectSettingsConfigurableProvider.kt index 8daab87e2..56b13cd2b 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/HybrisProjectSettingsConfigurableProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectSettingsConfigurableProvider.kt @@ -16,10 +16,11 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.settings +package com.intellij.idea.plugin.hybris.settings.options import com.intellij.idea.plugin.hybris.common.equalsIgnoreOrder import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.ui.CRUDListPanel import com.intellij.openapi.options.BoundSearchableConfigurable import com.intellij.openapi.options.ConfigurableProvider @@ -28,16 +29,16 @@ import com.intellij.ui.dsl.builder.* import com.intellij.ui.layout.selected import javax.swing.JCheckBox -class HybrisProjectSettingsConfigurableProvider(val project: Project) : ConfigurableProvider() { +class ProjectSettingsConfigurableProvider(val project: Project) : ConfigurableProvider() { - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun canCreateConfigurable() = ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun createConfigurable() = SettingsConfigurable(project) class SettingsConfigurable(project: Project) : BoundSearchableConfigurable( message("hybris.settings.project.title"), "hybris.project.settings" ) { - private val state = HybrisProjectSettingsComponent.getInstance(project).state + private val projectSettings = ProjectSettingsComponent.getInstance(project).state private lateinit var generateCodeOnRebuildCheckBox: JCheckBox private val excludedFromScanning = CRUDListPanel( @@ -52,19 +53,19 @@ class HybrisProjectSettingsConfigurableProvider(val project: Project) : Configur row(message("hybris.settings.project.details.platform_version.title")) { textField() .enabled(false) - .text(state.hybrisVersion ?: "") + .text(projectSettings.hybrisVersion ?: "") .align(AlignX.FILL) }.layout(RowLayout.PARENT_GRID) row(message("hybris.import.wizard.hybris.distribution.directory.label")) { textField() .enabled(false) - .text(state.hybrisDirectory ?: "") + .text(projectSettings.hybrisDirectory ?: "") .align(AlignX.FILL) }.layout(RowLayout.PARENT_GRID) row(message("hybris.import.wizard.javadoc.url.label")) { textField() .enabled(false) - .text(state.javadocUrl ?: "") + .text(projectSettings.javadocUrl ?: "") .align(AlignX.FILL) }.layout(RowLayout.PARENT_GRID) } @@ -80,21 +81,21 @@ class HybrisProjectSettingsConfigurableProvider(val project: Project) : Configur As a final step, project compilation will continue. """.trimIndent() ) - .bindSelected(state::generateCodeOnRebuild) + .bindSelected(projectSettings::generateCodeOnRebuild) .component } row("Code generation timeout (in seconds):") { spinner(1..10000, 1) - .bindIntValue(state::generateCodeTimeoutSeconds) + .bindIntValue(projectSettings::generateCodeTimeoutSeconds) .enabledIf(generateCodeOnRebuildCheckBox.selected) } } group(message("hybris.settings.project.common.title")) { row { - checkBox("Show complete Module name in the Project View") + checkBox("Show full Module name in the Project View") .comment("If checked, complete module name will be represented as [Platform.core] instead of core.") - .bindSelected(state::showFullModuleName) + .bindSelected(projectSettings::showFullModuleName) } } @@ -102,33 +103,33 @@ class HybrisProjectSettingsConfigurableProvider(val project: Project) : Configur row { checkBox("Remove external modules") .comment("If checked, non SAP Commerce external modules will be removed during the project refresh.") - .bindSelected(state::removeExternalModulesOnRefresh) + .bindSelected(projectSettings::removeExternalModulesOnRefresh) } row { checkBox("Use fake output path for custom extensions") .comment("When enabled the ‘eclipsebin’ folder will be used as an output path for both custom and OOTB extensions.") - .bindSelected(state::useFakeOutputPathForCustomExtensions) + .bindSelected(projectSettings::useFakeOutputPathForCustomExtensions) } row { checkBox(message("hybris.import.wizard.import.ootb.modules.read.only.label")) .comment(message("hybris.import.wizard.import.ootb.modules.read.only.tooltip")) - .bindSelected(state::importOotbModulesInReadOnlyMode) + .bindSelected(projectSettings::importOotbModulesInReadOnlyMode) } row { checkBox(message("hybris.import.wizard.exclude.test.sources.label")) - .bindSelected(state::excludeTestSources) + .bindSelected(projectSettings::excludeTestSources) } row { checkBox(message("hybris.project.import.followSymlink")) - .bindSelected(state::followSymlink) + .bindSelected(projectSettings::followSymlink) } row { checkBox(message("hybris.project.import.scanExternalModules")) - .bindSelected(state::scanThroughExternalModule) + .bindSelected(projectSettings::scanThroughExternalModule) } row { checkBox(message("hybris.project.import.importCustomAntBuildFiles")) - .bindSelected(state::importCustomAntBuildFiles) + .bindSelected(projectSettings::importCustomAntBuildFiles) } } @@ -139,9 +140,9 @@ class HybrisProjectSettingsConfigurableProvider(val project: Project) : Configur row { cell(excludedFromScanning) .align(AlignX.FILL) - .onApply { state.excludedFromScanning = excludedFromScanning.data.toMutableSet() } - .onReset { excludedFromScanning.data = state.excludedFromScanning.toList() } - .onIsModified { excludedFromScanning.data.equalsIgnoreOrder(state.excludedFromScanning.toList()).not() } + .onApply { projectSettings.excludedFromScanning = excludedFromScanning.data.toMutableSet() } + .onReset { excludedFromScanning.data = projectSettings.excludedFromScanning.toList() } + .onIsModified { excludedFromScanning.data.equalsIgnoreOrder(projectSettings.excludedFromScanning.toList()).not() } } } } diff --git a/src/com/intellij/idea/plugin/hybris/settings/options/ProjectTypeSystemConfigurableProvider.kt b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectTypeSystemConfigurableProvider.kt new file mode 100644 index 000000000..fc37143f3 --- /dev/null +++ b/src/com/intellij/idea/plugin/hybris/settings/options/ProjectTypeSystemConfigurableProvider.kt @@ -0,0 +1,151 @@ +/* + * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. + * Copyright (C) 2019-2024 EPAM Systems 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 + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.intellij.idea.plugin.hybris.settings.options + +import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.ui.TSDiagramSettingsExcludedTypeNameTable +import com.intellij.openapi.options.BoundSearchableConfigurable +import com.intellij.openapi.options.ConfigurableProvider +import com.intellij.openapi.project.Project +import com.intellij.ui.ToolbarDecorator +import com.intellij.ui.dsl.builder.Align +import com.intellij.ui.dsl.builder.bindSelected +import com.intellij.ui.dsl.builder.panel +import com.intellij.ui.layout.selected +import com.intellij.util.ui.JBUI +import java.awt.Dimension +import javax.swing.JCheckBox + +class ProjectTypeSystemConfigurableProvider(val project: Project) : ConfigurableProvider() { + + override fun canCreateConfigurable() = ProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun createConfigurable() = SettingsConfigurable(project) + + class SettingsConfigurable(project: Project) : BoundSearchableConfigurable( + message("hybris.settings.project.ts.title"), "[y] SAP CX Type System configuration." + ) { + + private val tsSettings = DeveloperSettingsComponent.getInstance(project).state.typeSystemSettings + private val tsDiagramSettings = DeveloperSettingsComponent.getInstance(project).state.typeSystemDiagramSettings + + private val excludedTypeNamesTable = TSDiagramSettingsExcludedTypeNameTable.getInstance(project) + private val excludedTypeNamesPane = ToolbarDecorator.createDecorator(excludedTypeNamesTable) + .disableUpDownActions() + .setPanelBorder(JBUI.Borders.empty()) + .createPanel() + + init { + excludedTypeNamesPane.minimumSize = Dimension(excludedTypeNamesPane.width, 400) + } + + private lateinit var foldingEnableCheckBox: JCheckBox + + override fun createPanel() = panel { + group("Code Folding - items.xml") { + row { + foldingEnableCheckBox = checkBox("Enable code folding") + .bindSelected(tsSettings.folding::enabled) + .component + } + group("Table-Like Folding", true) { + row { + checkBox("Atomics") + .bindSelected(tsSettings.folding::tablifyAtomics) + .enabledIf(foldingEnableCheckBox.selected) + checkBox("Collections") + .bindSelected(tsSettings.folding::tablifyCollections) + .enabledIf(foldingEnableCheckBox.selected) + checkBox("Maps") + .bindSelected(tsSettings.folding::tablifyMaps) + .enabledIf(foldingEnableCheckBox.selected) + checkBox("Relations") + .bindSelected(tsSettings.folding::tablifyRelations) + .enabledIf(foldingEnableCheckBox.selected) + } + row { + checkBox("Item attributes") + .bindSelected(tsSettings.folding::tablifyItemAttributes) + .enabledIf(foldingEnableCheckBox.selected) + checkBox("Item indexes") + .bindSelected(tsSettings.folding::tablifyItemIndexes) + .enabledIf(foldingEnableCheckBox.selected) + checkBox("Item custom properties") + .bindSelected(tsSettings.folding::tablifyItemCustomProperties) + .enabledIf(foldingEnableCheckBox.selected) + } + } + } + + group("Diagram Settings") { + row { + checkBox("Collapse nodes by default") + .bindSelected(tsDiagramSettings::nodesCollapsedByDefault) + } + + row { + checkBox("Show OOTB Map nodes") + .comment("One of the OOTB Map example is `localized:java.lang.String`.") + .bindSelected(tsDiagramSettings::showOOTBMapNodes) + } + + row { + checkBox("Show custom Atomic nodes") + .bindSelected(tsDiagramSettings::showCustomAtomicNodes) + } + + row { + checkBox("Show custom Collection nodes") + .bindSelected(tsDiagramSettings::showCustomCollectionNodes) + } + + row { + checkBox("Show custom Enum nodes") + .bindSelected(tsDiagramSettings::showCustomEnumNodes) + } + + row { + checkBox("Show custom Map nodes") + .bindSelected(tsDiagramSettings::showCustomMapNodes) + } + + row { + checkBox("Show custom Relation nodes") + .comment("Relations with set Deployment will be always displayed.") + .bindSelected(tsDiagramSettings::showCustomRelationNodes) + } + } + + group("Diagram - Excluded Type Names", true) { + row { + cell(excludedTypeNamesPane) + .onApply { tsDiagramSettings.excludedTypeNames = getNewTypeNames() } + .onReset { excludedTypeNamesTable.updateModel(tsDiagramSettings) } + .onIsModified { tsDiagramSettings.excludedTypeNames != getNewTypeNames() } + .align(Align.FILL) + } + } + } + + private fun getNewTypeNames() = excludedTypeNamesTable.getItems() + .map { it.typeName } + .toMutableSet() + } +} \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/settings/components/TSDiagramSettingsExcludedTypeNameTable.kt b/src/com/intellij/idea/plugin/hybris/settings/ui/TSDiagramSettingsExcludedTypeNameTable.kt similarity index 90% rename from src/com/intellij/idea/plugin/hybris/settings/components/TSDiagramSettingsExcludedTypeNameTable.kt rename to src/com/intellij/idea/plugin/hybris/settings/ui/TSDiagramSettingsExcludedTypeNameTable.kt index 734c48aaa..c83050525 100644 --- a/src/com/intellij/idea/plugin/hybris/settings/components/TSDiagramSettingsExcludedTypeNameTable.kt +++ b/src/com/intellij/idea/plugin/hybris/settings/ui/TSDiagramSettingsExcludedTypeNameTable.kt @@ -16,9 +16,9 @@ * along with this program. If not, see . */ -package com.intellij.idea.plugin.hybris.settings.components +package com.intellij.idea.plugin.hybris.settings.ui -import com.intellij.idea.plugin.hybris.system.type.settings.TSDiagramSettings +import com.intellij.idea.plugin.hybris.settings.TypeSystemDiagramSettings import com.intellij.idea.plugin.hybris.toolwindow.components.AbstractTable import com.intellij.openapi.project.Project import com.intellij.util.ui.ListTableModel @@ -26,14 +26,14 @@ import java.io.Serial private const val COLUMN_NAME = "Name" -class TSDiagramSettingsExcludedTypeNameTable private constructor(project: Project) : AbstractTable(project) { +class TSDiagramSettingsExcludedTypeNameTable private constructor(project: Project) : AbstractTable(project) { override fun getSearchableColumnNames() = listOf(COLUMN_NAME) override fun select(item: TSTypeNameHolder) { } - override fun getItems(owner: TSDiagramSettings) = owner.excludedTypeNames + override fun getItems(owner: TypeSystemDiagramSettings) = owner.excludedTypeNames .map { TSTypeNameHolder(it) } .sortedBy { it.typeName } .toMutableList() diff --git a/src/com/intellij/idea/plugin/hybris/startup/HybrisIntelliLangStartupActivity.kt b/src/com/intellij/idea/plugin/hybris/startup/HybrisIntelliLangStartupActivity.kt index 32bf8cded..c0e3ae9e7 100644 --- a/src/com/intellij/idea/plugin/hybris/startup/HybrisIntelliLangStartupActivity.kt +++ b/src/com/intellij/idea/plugin/hybris/startup/HybrisIntelliLangStartupActivity.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.startup import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.flexibleSearch.FlexibleSearchLanguage import com.intellij.idea.plugin.hybris.polyglotQuery.PolyglotQueryLanguage -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.application.ModalityState import com.intellij.openapi.application.ReadAction import com.intellij.openapi.project.Project @@ -41,7 +41,7 @@ import org.intellij.plugins.intelliLang.inject.java.JavaLanguageInjectionSupport class HybrisIntelliLangStartupActivity : ProjectActivity { override suspend fun execute(project: Project) { - if (!HybrisProjectSettingsComponent.getInstance(project).isHybrisProject()) return + if (!ProjectSettingsComponent.getInstance(project).isHybrisProject()) return registerJavaInjections(project) } diff --git a/src/com/intellij/idea/plugin/hybris/startup/HybrisProjectImportStartupActivity.kt b/src/com/intellij/idea/plugin/hybris/startup/HybrisProjectImportStartupActivity.kt index 42ae4ad0f..be0593ca9 100644 --- a/src/com/intellij/idea/plugin/hybris/startup/HybrisProjectImportStartupActivity.kt +++ b/src/com/intellij/idea/plugin/hybris/startup/HybrisProjectImportStartupActivity.kt @@ -21,7 +21,7 @@ import com.intellij.ide.util.RunOnceUtil import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.services.CommonIdeaService import com.intellij.idea.plugin.hybris.project.configurators.PostImportConfigurator -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.toolwindow.HybrisToolWindowService import com.intellij.openapi.project.Project import com.intellij.openapi.startup.ProjectActivity @@ -30,7 +30,7 @@ import com.intellij.openapi.util.removeUserData class HybrisProjectImportStartupActivity : ProjectActivity { override suspend fun execute(project: Project) { - if (!HybrisProjectSettingsComponent.getInstance(project).isHybrisProject()) return + if (!ProjectSettingsComponent.getInstance(project).isHybrisProject()) return RunOnceUtil.runOnceForProject(project, "afterHybrisProjectImport") { project.getUserData(HybrisConstants.KEY_FINALIZE_PROJECT_IMPORT) diff --git a/src/com/intellij/idea/plugin/hybris/startup/HybrisProjectStructureStartupActivity.kt b/src/com/intellij/idea/plugin/hybris/startup/HybrisProjectStructureStartupActivity.kt index 69a7cf267..7c27327ff 100644 --- a/src/com/intellij/idea/plugin/hybris/startup/HybrisProjectStructureStartupActivity.kt +++ b/src/com/intellij/idea/plugin/hybris/startup/HybrisProjectStructureStartupActivity.kt @@ -25,7 +25,7 @@ import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils import com.intellij.idea.plugin.hybris.notifications.Notifications import com.intellij.idea.plugin.hybris.project.actions.ProjectRefreshAction import com.intellij.idea.plugin.hybris.project.configurators.ConfiguratorFactory -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.notification.NotificationType import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.extensions.PluginId @@ -40,7 +40,7 @@ class HybrisProjectStructureStartupActivity : ProjectActivity { if (project.isDisposed) return val commonIdeaService = CommonIdeaService.getInstance() - val settingsComponent = HybrisProjectSettingsComponent.getInstance(project) + val settingsComponent = ProjectSettingsComponent.getInstance(project) val isHybrisProject = settingsComponent.isHybrisProject() if (isHybrisProject) { @@ -76,7 +76,7 @@ class HybrisProjectStructureStartupActivity : ProjectActivity { } private fun logVersion(project: Project) { - val settings = HybrisProjectSettingsComponent.getInstance(project).state + val settings = ProjectSettingsComponent.getInstance(project).state val importedBy = settings.importedByVersion val hybrisVersion = settings.hybrisVersion val plugin = PluginManagerCore.getPlugin(PluginId.getId(HybrisConstants.PLUGIN_ID)) ?: return diff --git a/src/com/intellij/idea/plugin/hybris/startup/ItemsXmlFileOpenStartupActivity.kt b/src/com/intellij/idea/plugin/hybris/startup/ItemsXmlFileOpenStartupActivity.kt index f509c20a2..819610ea5 100644 --- a/src/com/intellij/idea/plugin/hybris/startup/ItemsXmlFileOpenStartupActivity.kt +++ b/src/com/intellij/idea/plugin/hybris/startup/ItemsXmlFileOpenStartupActivity.kt @@ -19,8 +19,8 @@ package com.intellij.idea.plugin.hybris.startup import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.common.utils.HybrisItemsXmlFileType -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.type.validation.ItemsXmlFileValidation import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.progress.ProgressIndicator @@ -37,8 +37,8 @@ import com.intellij.psi.search.GlobalSearchScope class ItemsXmlFileOpenStartupActivity : ProjectActivity { override suspend fun execute(project: Project) { - if (!HybrisProjectSettingsComponent.getInstance(project).isHybrisProject()) return - if (!HybrisApplicationSettingsComponent.getInstance().state.warnIfGeneratedItemsAreOutOfDate) return + if (!ProjectSettingsComponent.getInstance(project).isHybrisProject()) return + if (!ApplicationSettingsComponent.getInstance().state.warnIfGeneratedItemsAreOutOfDate) return val task = object : Task.Backgroundable(project, message("hybris.startupActivity.itemsXmlValidation.progress.title")) { override fun run(indicator: ProgressIndicator) { diff --git a/src/com/intellij/idea/plugin/hybris/startup/PreLoadSystemsStartupActivity.kt b/src/com/intellij/idea/plugin/hybris/startup/PreLoadSystemsStartupActivity.kt index c79800465..a8a9081e7 100644 --- a/src/com/intellij/idea/plugin/hybris/startup/PreLoadSystemsStartupActivity.kt +++ b/src/com/intellij/idea/plugin/hybris/startup/PreLoadSystemsStartupActivity.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.startup import com.intellij.idea.plugin.hybris.properties.PropertyService -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.bean.meta.BSMetaModelAccess import com.intellij.idea.plugin.hybris.system.cockpitng.meta.CngMetaModelAccess import com.intellij.idea.plugin.hybris.system.spring.SimpleSpringService @@ -31,7 +31,7 @@ import com.intellij.openapi.startup.ProjectActivity class PreLoadSystemsStartupActivity : ProjectActivity { override suspend fun execute(project: Project) { - if (!HybrisProjectSettingsComponent.getInstance(project).isHybrisProject()) return + if (!ProjectSettingsComponent.getInstance(project).isHybrisProject()) return refreshSystem(project) { TSMetaModelAccess.getInstance(project).initMetaModel() } refreshSystem(project) { BSMetaModelAccess.getInstance(project).initMetaModel() } diff --git a/src/com/intellij/idea/plugin/hybris/startup/event/HybrisFileEditorManagerListener.kt b/src/com/intellij/idea/plugin/hybris/startup/event/HybrisFileEditorManagerListener.kt index 752244484..e28fa668d 100644 --- a/src/com/intellij/idea/plugin/hybris/startup/event/HybrisFileEditorManagerListener.kt +++ b/src/com/intellij/idea/plugin/hybris/startup/event/HybrisFileEditorManagerListener.kt @@ -24,7 +24,7 @@ import com.intellij.idea.plugin.hybris.impex.file.ImpExFileToolbarInstaller import com.intellij.idea.plugin.hybris.impex.file.ImpexFileType import com.intellij.idea.plugin.hybris.polyglotQuery.file.PolyglotQueryFileToolbarInstaller import com.intellij.idea.plugin.hybris.polyglotQuery.file.PolyglotQueryFileType -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.editor.ex.util.EditorUtil import com.intellij.openapi.fileEditor.FileEditorManager import com.intellij.openapi.fileEditor.FileEditorManagerListener @@ -37,7 +37,7 @@ class HybrisFileEditorManagerListener(private val project: Project) : FileEditor override fun fileOpened(source: FileEditorManager, file: VirtualFile) { if (SingleRootFileViewProvider.isTooLargeForIntelligence(file)) return - val projectSettings = HybrisProjectSettingsComponent.getInstance(project) + val projectSettings = ProjectSettingsComponent.getInstance(project) if (!projectSettings.isHybrisProject()) return val toolbarInstaller = when (file.fileType) { diff --git a/src/com/intellij/idea/plugin/hybris/startup/event/ItemsXmlFileEditorManagerListener.kt b/src/com/intellij/idea/plugin/hybris/startup/event/ItemsXmlFileEditorManagerListener.kt index add1001f3..3c8cf79a1 100644 --- a/src/com/intellij/idea/plugin/hybris/startup/event/ItemsXmlFileEditorManagerListener.kt +++ b/src/com/intellij/idea/plugin/hybris/startup/event/ItemsXmlFileEditorManagerListener.kt @@ -19,8 +19,8 @@ package com.intellij.idea.plugin.hybris.startup.event import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.type.validation.ItemsXmlFileValidation import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.fileEditor.FileEditorManager @@ -36,8 +36,8 @@ import com.intellij.openapi.vfs.VirtualFile class ItemsXmlFileEditorManagerListener(private val project: Project) : FileEditorManagerListener { override fun fileOpened(source: FileEditorManager, file: VirtualFile) { - if (!HybrisProjectSettingsComponent.getInstance(project).isHybrisProject()) return - if (!HybrisApplicationSettingsComponent.getInstance().state.warnIfGeneratedItemsAreOutOfDate) return + if (!ProjectSettingsComponent.getInstance(project).isHybrisProject()) return + if (!ApplicationSettingsComponent.getInstance().state.warnIfGeneratedItemsAreOutOfDate) return val task = object : Task.Backgroundable(project, HybrisI18NBundleUtils.message("hybris.startupActivity.itemsXmlValidation.progress.title")) { override fun run(indicator: ProgressIndicator) { diff --git a/src/com/intellij/idea/plugin/hybris/system/bean/BSDomFileDescription.kt b/src/com/intellij/idea/plugin/hybris/system/bean/BSDomFileDescription.kt index 79fbfad6f..78364e4d7 100644 --- a/src/com/intellij/idea/plugin/hybris/system/bean/BSDomFileDescription.kt +++ b/src/com/intellij/idea/plugin/hybris/system/bean/BSDomFileDescription.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.system.bean import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.bean.model.Beans import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleUtil @@ -34,7 +34,7 @@ class BSDomFileDescription : DomFileDescription(Beans::class.java, "beans override fun isMyFile(file: XmlFile, module: Module?) = super.isMyFile(file, module) && file.virtualFile != null && (module != null || ModuleUtil.projectContainsFile(file.project, file.virtualFile, true)) - && HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject() + && ProjectSettingsComponent.getInstance(file.project).isHybrisProject() && file.name.endsWith(HybrisConstants.HYBRIS_BEANS_XML_FILE_ENDING) && file.rootTag ?.attributes diff --git a/src/com/intellij/idea/plugin/hybris/system/bean/codeInsight/hints/BeansXmlInlayHintsProvider.kt b/src/com/intellij/idea/plugin/hybris/system/bean/codeInsight/hints/BeansXmlInlayHintsProvider.kt index 1edbf4823..5bfad647f 100644 --- a/src/com/intellij/idea/plugin/hybris/system/bean/codeInsight/hints/BeansXmlInlayHintsProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/system/bean/codeInsight/hints/BeansXmlInlayHintsProvider.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.system.bean.codeInsight.hints import com.intellij.codeInsight.hints.* -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.editor.Editor import com.intellij.psi.PsiFile import javax.swing.JPanel @@ -41,6 +41,6 @@ class BeansXmlInlayHintsProvider : InlayHintsProvider { override fun getCollectorFor( file: PsiFile, editor: Editor, settings: NoSettings, sink: InlayHintsSink - ) = if (file.name.endsWith(name) && HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject()) BeansXmlInlayHintsCollector(editor) + ) = if (file.name.endsWith(name) && ProjectSettingsComponent.getInstance(file.project).isHybrisProject()) BeansXmlInlayHintsCollector(editor) else null } diff --git a/src/com/intellij/idea/plugin/hybris/system/bean/lang/folding/BeansXmlFoldingBuilder.kt b/src/com/intellij/idea/plugin/hybris/system/bean/lang/folding/BeansXmlFoldingBuilder.kt index 426cc45ad..c2f2bc7da 100644 --- a/src/com/intellij/idea/plugin/hybris/system/bean/lang/folding/BeansXmlFoldingBuilder.kt +++ b/src/com/intellij/idea/plugin/hybris/system/bean/lang/folding/BeansXmlFoldingBuilder.kt @@ -19,11 +19,11 @@ package com.intellij.idea.plugin.hybris.system.bean.lang.folding import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.lang.folding.AbstractXmlFoldingBuilderEx -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.BeanSystemFoldingSettings +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.idea.plugin.hybris.system.bean.meta.BSMetaHelper import com.intellij.idea.plugin.hybris.system.bean.model.* import com.intellij.idea.plugin.hybris.system.bean.model.Enum -import com.intellij.idea.plugin.hybris.system.bean.settings.BeanSystemFoldingSettings import com.intellij.lang.ASTNode import com.intellij.openapi.project.DumbAware import com.intellij.openapi.project.Project @@ -60,7 +60,7 @@ class BeansXmlFoldingBuilder : AbstractXmlFoldingBuilderEx(Process::class.java, Hy override fun isMyFile(file: XmlFile, module: Module?) = super.isMyFile(file, module) && (module != null || ModuleUtil.projectContainsFile(file.project, file.virtualFile, true)) - && HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject() + && ProjectSettingsComponent.getInstance(file.project).isHybrisProject() } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/system/businessProcess/lang/folding/BpXmlFoldingBuilder.kt b/src/com/intellij/idea/plugin/hybris/system/businessProcess/lang/folding/BpXmlFoldingBuilder.kt index 70d07bcd1..2322d06e2 100644 --- a/src/com/intellij/idea/plugin/hybris/system/businessProcess/lang/folding/BpXmlFoldingBuilder.kt +++ b/src/com/intellij/idea/plugin/hybris/system/businessProcess/lang/folding/BpXmlFoldingBuilder.kt @@ -19,9 +19,9 @@ package com.intellij.idea.plugin.hybris.system.businessProcess.lang.folding import com.intellij.idea.plugin.hybris.lang.folding.AbstractXmlFoldingBuilderEx -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.BpFoldingSettings +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.idea.plugin.hybris.system.businessProcess.model.* -import com.intellij.idea.plugin.hybris.system.businessProcess.settings.BpFoldingSettings import com.intellij.idea.plugin.hybris.system.businessProcess.util.BpHelper import com.intellij.lang.ASTNode import com.intellij.openapi.project.DumbAware @@ -50,7 +50,7 @@ class BpXmlFoldingBuilder : AbstractXmlFoldingBuilderEx(Config::class.jav override fun isMyFile(file: XmlFile, module: Module?) = super.isMyFile(file, module) && (module != null || ModuleUtil.projectContainsFile(file.project, file.virtualFile, true)) && hasNamespace(file) - && HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject() + && ProjectSettingsComponent.getInstance(file.project).isHybrisProject() private fun hasNamespace(file: XmlFile) = file.rootTag ?.attributes diff --git a/src/com/intellij/idea/plugin/hybris/system/cockpitng/CngEditorDefinitionDomFileDescription.kt b/src/com/intellij/idea/plugin/hybris/system/cockpitng/CngEditorDefinitionDomFileDescription.kt index e0cffccd0..a929b3fa5 100644 --- a/src/com/intellij/idea/plugin/hybris/system/cockpitng/CngEditorDefinitionDomFileDescription.kt +++ b/src/com/intellij/idea/plugin/hybris/system/cockpitng/CngEditorDefinitionDomFileDescription.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.system.cockpitng import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.cockpitng.model.core.EditorDefinition import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleUtil @@ -35,6 +35,6 @@ class CngEditorDefinitionDomFileDescription : DomFileDescription(Widgets::class. override fun isMyFile(file: XmlFile, module: Module?) = super.isMyFile(file, module) && (module != null || ModuleUtil.projectContainsFile(file.project, file.virtualFile, true)) && (hasNamespace(file) || "backoffice-widgets.xml" == file.name) - && HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject() + && ProjectSettingsComponent.getInstance(file.project).isHybrisProject() private fun hasNamespace(file: XmlFile) = file.rootTag ?.attributes diff --git a/src/com/intellij/idea/plugin/hybris/system/cockpitng/lang/folding/CngConfigFoldingBuilder.kt b/src/com/intellij/idea/plugin/hybris/system/cockpitng/lang/folding/CngConfigFoldingBuilder.kt index 19a642a7c..b50f56ccf 100644 --- a/src/com/intellij/idea/plugin/hybris/system/cockpitng/lang/folding/CngConfigFoldingBuilder.kt +++ b/src/com/intellij/idea/plugin/hybris/system/cockpitng/lang/folding/CngConfigFoldingBuilder.kt @@ -18,7 +18,8 @@ package com.intellij.idea.plugin.hybris.system.cockpitng.lang.folding import com.intellij.idea.plugin.hybris.lang.folding.AbstractXmlFoldingBuilderEx -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.CngFoldingSettings +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.idea.plugin.hybris.system.cockpitng.model.advancedSearch.Field import com.intellij.idea.plugin.hybris.system.cockpitng.model.advancedSearch.FieldList import com.intellij.idea.plugin.hybris.system.cockpitng.model.config.Config @@ -34,7 +35,6 @@ import com.intellij.idea.plugin.hybris.system.cockpitng.model.wizardConfig.Addit import com.intellij.idea.plugin.hybris.system.cockpitng.model.wizardConfig.ComposedHandler import com.intellij.idea.plugin.hybris.system.cockpitng.model.wizardConfig.Property import com.intellij.idea.plugin.hybris.system.cockpitng.model.wizardConfig.PropertyList -import com.intellij.idea.plugin.hybris.system.cockpitng.settings.CngFoldingSettings import com.intellij.lang.ASTNode import com.intellij.openapi.project.DumbAware import com.intellij.openapi.project.Project @@ -63,7 +63,7 @@ class CngConfigFoldingBuilder : AbstractXmlFoldingBuilderEx(ExtensionInfo::c && file.virtualFile != null && file.name == HybrisConstants.EXTENSION_INFO_XML && (module != null || ModuleUtil.projectContainsFile(file.project, file.virtualFile, true)) - && HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject() + && ProjectSettingsComponent.getInstance(file.project).isHybrisProject() } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/system/externalDependencies/EDDomFileDescription.kt b/src/com/intellij/idea/plugin/hybris/system/externalDependencies/EDDomFileDescription.kt index ba614914e..be776ca7d 100644 --- a/src/com/intellij/idea/plugin/hybris/system/externalDependencies/EDDomFileDescription.kt +++ b/src/com/intellij/idea/plugin/hybris/system/externalDependencies/EDDomFileDescription.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.system.externalDependencies import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleUtil import com.intellij.psi.xml.XmlFile @@ -35,6 +35,6 @@ class EDDomFileDescription : MavenDomProjectModelDescription() { && file.virtualFile != null && file.name == HybrisConstants.EXTERNAL_DEPENDENCIES_XML && (module != null || ModuleUtil.projectContainsFile(file.project, file.virtualFile, true)) - && HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject() + && ProjectSettingsComponent.getInstance(file.project).isHybrisProject() } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/system/localextensions/LeSDomFileDescription.kt b/src/com/intellij/idea/plugin/hybris/system/localextensions/LeSDomFileDescription.kt index 7a4c4abef..2ab7bd6d0 100644 --- a/src/com/intellij/idea/plugin/hybris/system/localextensions/LeSDomFileDescription.kt +++ b/src/com/intellij/idea/plugin/hybris/system/localextensions/LeSDomFileDescription.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.system.localextensions import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.localextensions.model.Hybrisconfig import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleUtil @@ -36,6 +36,6 @@ class LeSDomFileDescription : DomFileDescription(Hybrisconfig::cla && file.virtualFile != null && file.name == HybrisConstants.LOCAL_EXTENSIONS_XML && (module != null || ModuleUtil.projectContainsFile(file.project, file.virtualFile, true)) - && HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject() + && ProjectSettingsComponent.getInstance(file.project).isHybrisProject() } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/system/manifest/codeInsight/completion/provider/TemplateExtensionNameCompletionProvider.kt b/src/com/intellij/idea/plugin/hybris/system/manifest/codeInsight/completion/provider/TemplateExtensionNameCompletionProvider.kt index 2893e1abe..a2c4cb3aa 100644 --- a/src/com/intellij/idea/plugin/hybris/system/manifest/codeInsight/completion/provider/TemplateExtensionNameCompletionProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/system/manifest/codeInsight/completion/provider/TemplateExtensionNameCompletionProvider.kt @@ -21,7 +21,7 @@ package com.intellij.idea.plugin.hybris.system.manifest.codeInsight.completion.p import com.intellij.codeInsight.completion.CompletionParameters import com.intellij.codeInsight.completion.CompletionProvider import com.intellij.idea.plugin.hybris.codeInsight.completion.provider.ExtensionNameCompletionProvider -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.Service import com.intellij.openapi.project.Project @@ -29,7 +29,7 @@ import com.intellij.openapi.project.Project @Service class TemplateExtensionNameCompletionProvider : ExtensionNameCompletionProvider() { - override fun getExtensionDescriptors(parameters: CompletionParameters, project: Project) = HybrisProjectSettingsComponent.getInstance(project) + override fun getExtensionDescriptors(parameters: CompletionParameters, project: Project) = ProjectSettingsComponent.getInstance(project) .getAvailableExtensions() .values .filter { it.extGenTemplateExtension } diff --git a/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestCommerceJsonSchemaFileProvider.kt b/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestCommerceJsonSchemaFileProvider.kt index 63470153c..ceee7029d 100644 --- a/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestCommerceJsonSchemaFileProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestCommerceJsonSchemaFileProvider.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.system.manifest.jsonSchema.providers import com.intellij.idea.plugin.hybris.common.HybrisConstants -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.components.Service import com.intellij.openapi.project.Project import com.intellij.openapi.vfs.VirtualFile @@ -32,7 +32,7 @@ class ManifestCommerceJsonSchemaFileProvider(val project: Project) : JsonSchemaF override fun isAvailable(file: VirtualFile) = HybrisConstants.CCV2_MANIFEST_NAME == file.name && HybrisConstants.CCV2_CORE_CUSTOMIZE_NAME == file.parent?.name - && HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + && ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun getName() = "SAP Commerce Manifest" override fun getSchemaFile() = JsonSchemaProviderFactory.getResourceFile(javaClass, "/schemas/manifest-commerce.schema.json") diff --git a/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestDataHubJsonSchemaFileProvider.kt b/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestDataHubJsonSchemaFileProvider.kt index f23c21a0c..08e1cf38d 100644 --- a/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestDataHubJsonSchemaFileProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestDataHubJsonSchemaFileProvider.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.system.manifest.jsonSchema.providers import com.intellij.idea.plugin.hybris.common.HybrisConstants -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.components.Service import com.intellij.openapi.project.Project import com.intellij.openapi.vfs.VirtualFile @@ -31,7 +31,7 @@ import com.jetbrains.jsonSchema.extension.SchemaType class ManifestDataHubJsonSchemaFileProvider(val project: Project) : JsonSchemaFileProvider { override fun isAvailable(file: VirtualFile) = HybrisConstants.CCV2_MANIFEST_NAME == file.name && HybrisConstants.CCV2_DATAHUB_NAME == file.parent?.name - && HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + && ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun getName() = "SAP DataHub Manifest" override fun getSchemaFile() = JsonSchemaProviderFactory.getResourceFile(javaClass, "/schemas/manifest-datahub.schema.json") diff --git a/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestJavascriptStorefrontJsonSchemaFileProvider.kt b/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestJavascriptStorefrontJsonSchemaFileProvider.kt index 8681b786a..258eb0b9a 100644 --- a/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestJavascriptStorefrontJsonSchemaFileProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/system/manifest/jsonSchema/providers/ManifestJavascriptStorefrontJsonSchemaFileProvider.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.system.manifest.jsonSchema.providers import com.intellij.idea.plugin.hybris.common.HybrisConstants -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.components.Service import com.intellij.openapi.project.Project import com.intellij.openapi.vfs.VirtualFile @@ -31,7 +31,7 @@ import com.jetbrains.jsonSchema.extension.SchemaType class ManifestJavascriptStorefrontJsonSchemaFileProvider(val project: Project) : JsonSchemaFileProvider { override fun isAvailable(file: VirtualFile) = HybrisConstants.CCV2_MANIFEST_NAME == file.name && HybrisConstants.CCV2_JS_STOREFRONT_NAME == file.parent?.name - && HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + && ProjectSettingsComponent.getInstance(project).isHybrisProject() override fun getName() = "SAP Javascript Storefront Manifest" override fun getSchemaFile() = JsonSchemaProviderFactory.getResourceFile(javaClass, "/schemas/manifest-js-storefront.schema.json") diff --git a/src/com/intellij/idea/plugin/hybris/system/type/codeInsight/completion/TSCompletionService.kt b/src/com/intellij/idea/plugin/hybris/system/type/codeInsight/completion/TSCompletionService.kt index 4dca1e5a9..24d451fd2 100644 --- a/src/com/intellij/idea/plugin/hybris/system/type/codeInsight/completion/TSCompletionService.kt +++ b/src/com/intellij/idea/plugin/hybris/system/type/codeInsight/completion/TSCompletionService.kt @@ -27,7 +27,7 @@ import com.intellij.idea.plugin.hybris.common.HybrisConstants.ATTRIBUTE_TARGET import com.intellij.idea.plugin.hybris.common.HybrisConstants.ATTRIBUTE_VALUE import com.intellij.idea.plugin.hybris.impex.psi.ImpexParameter import com.intellij.idea.plugin.hybris.properties.PropertyService -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.idea.plugin.hybris.system.type.codeInsight.lookup.TSLookupElementFactory import com.intellij.idea.plugin.hybris.system.type.meta.TSMetaModelAccess import com.intellij.idea.plugin.hybris.system.type.meta.model.* @@ -84,7 +84,7 @@ class TSCompletionService(private val project: Project) { } fun getImpexInlineTypeCompletions(project: Project, element: ImpexParameter): List { - val completion = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.impexSettings.completion + val completion = DeveloperSettingsComponent.getInstance(project).state.impexSettings.completion if (!completion.showInlineTypes) return emptyList() val referenceItemTypeName = element.referenceItemTypeName ?: return emptyList() diff --git a/src/com/intellij/idea/plugin/hybris/system/type/codeInsight/hints/ItemsXmlInlayHintsProvider.kt b/src/com/intellij/idea/plugin/hybris/system/type/codeInsight/hints/ItemsXmlInlayHintsProvider.kt index 6c8fdd0e5..3843004f6 100644 --- a/src/com/intellij/idea/plugin/hybris/system/type/codeInsight/hints/ItemsXmlInlayHintsProvider.kt +++ b/src/com/intellij/idea/plugin/hybris/system/type/codeInsight/hints/ItemsXmlInlayHintsProvider.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.system.type.codeInsight.hints import com.intellij.codeInsight.hints.* -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.editor.Editor import com.intellij.psi.PsiFile import javax.swing.JPanel @@ -41,6 +41,6 @@ class ItemsXmlInlayHintsProvider : InlayHintsProvider { override fun getCollectorFor( file: PsiFile, editor: Editor, settings: NoSettings, sink: InlayHintsSink - ) = if (file.name.endsWith(name) && HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject()) ItemsXmlInlayHintsCollector(editor) + ) = if (file.name.endsWith(name) && ProjectSettingsComponent.getInstance(file.project).isHybrisProject()) ItemsXmlInlayHintsCollector(editor) else null } diff --git a/src/com/intellij/idea/plugin/hybris/system/type/file/TSDomFileDescription.kt b/src/com/intellij/idea/plugin/hybris/system/type/file/TSDomFileDescription.kt index 3a09aedc7..aa684f7fd 100644 --- a/src/com/intellij/idea/plugin/hybris/system/type/file/TSDomFileDescription.kt +++ b/src/com/intellij/idea/plugin/hybris/system/type/file/TSDomFileDescription.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.system.type.file import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.system.type.model.Items import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleUtil @@ -34,7 +34,7 @@ class TSDomFileDescription : DomFileDescription(Items::class.java, Hybris file: XmlFile, module: Module? ) = super.isMyFile(file, module) && (module != null || ModuleUtil.projectContainsFile(file.project, file.virtualFile, true)) - && HybrisProjectSettingsComponent.getInstance(file.project).isHybrisProject() + && ProjectSettingsComponent.getInstance(file.project).isHybrisProject() && file.name.endsWith(HybrisConstants.HYBRIS_ITEMS_XML_FILE_ENDING) && file.rootTag ?.attributes diff --git a/src/com/intellij/idea/plugin/hybris/system/type/lang/folding/ItemsXmlFoldingBuilder.kt b/src/com/intellij/idea/plugin/hybris/system/type/lang/folding/ItemsXmlFoldingBuilder.kt index f50d3843b..f4bafe74a 100644 --- a/src/com/intellij/idea/plugin/hybris/system/type/lang/folding/ItemsXmlFoldingBuilder.kt +++ b/src/com/intellij/idea/plugin/hybris/system/type/lang/folding/ItemsXmlFoldingBuilder.kt @@ -19,9 +19,9 @@ package com.intellij.idea.plugin.hybris.system.type.lang.folding import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.lang.folding.AbstractXmlFoldingBuilderEx -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.TypeSystemFoldingSettings +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.idea.plugin.hybris.system.type.model.* -import com.intellij.idea.plugin.hybris.system.type.settings.TypeSystemFoldingSettings import com.intellij.lang.ASTNode import com.intellij.openapi.project.DumbAware import com.intellij.openapi.project.Project @@ -64,7 +64,7 @@ class ItemsXmlFoldingBuilder : AbstractXmlFoldingBuilderEx 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 - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.intellij.idea.plugin.hybris.system.type.settings - -import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent -import com.intellij.openapi.options.BoundSearchableConfigurable -import com.intellij.openapi.options.ConfigurableProvider -import com.intellij.openapi.project.Project -import com.intellij.ui.dsl.builder.bindSelected -import com.intellij.ui.dsl.builder.panel -import com.intellij.ui.layout.selected -import javax.swing.JCheckBox - -class TypeSystemConfigurableProvider(val project: Project) : ConfigurableProvider() { - - override fun canCreateConfigurable() = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() - override fun createConfigurable() = SettingsConfigurable(project) - - class SettingsConfigurable(project: Project) : BoundSearchableConfigurable( - message("hybris.settings.project.ts.title"), "[y] SAP Commerce plugin Type System configuration." - ) { - - private val settings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.typeSystemSettings - - private lateinit var foldingEnableCheckBox: JCheckBox - - override fun createPanel() = panel { - group("Code Folding") { - row { - foldingEnableCheckBox = checkBox("Enable code folding") - .bindSelected(settings.folding::enabled) - .component - } - group("Table-Like Folding", true) { - row { - checkBox("Atomics") - .bindSelected(settings.folding::tablifyAtomics) - .enabledIf(foldingEnableCheckBox.selected) - checkBox("Collections") - .bindSelected(settings.folding::tablifyCollections) - .enabledIf(foldingEnableCheckBox.selected) - checkBox("Maps") - .bindSelected(settings.folding::tablifyMaps) - .enabledIf(foldingEnableCheckBox.selected) - checkBox("Relations") - .bindSelected(settings.folding::tablifyRelations) - .enabledIf(foldingEnableCheckBox.selected) - } - row { - checkBox("Item attributes") - .bindSelected(settings.folding::tablifyItemAttributes) - .enabledIf(foldingEnableCheckBox.selected) - checkBox("Item indexes") - .bindSelected(settings.folding::tablifyItemIndexes) - .enabledIf(foldingEnableCheckBox.selected) - checkBox("Item custom properties") - .bindSelected(settings.folding::tablifyItemCustomProperties) - .enabledIf(foldingEnableCheckBox.selected) - } - } - } - } - } -} \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/system/type/settings/TypeSystemSettings.kt b/src/com/intellij/idea/plugin/hybris/system/type/settings/TypeSystemSettings.kt deleted file mode 100644 index 202219ace..000000000 --- a/src/com/intellij/idea/plugin/hybris/system/type/settings/TypeSystemSettings.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems 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 - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.intellij.idea.plugin.hybris.system.type.settings - -import com.intellij.idea.plugin.hybris.settings.FoldingSettings - -data class TypeSystemSettings( - var folding: TypeSystemFoldingSettings = TypeSystemFoldingSettings(), -) - -data class TypeSystemFoldingSettings( - override var enabled: Boolean = true, - var tablifyAtomics: Boolean = true, - var tablifyCollections: Boolean = true, - var tablifyMaps: Boolean = true, - var tablifyRelations: Boolean = true, - var tablifyItemAttributes: Boolean = true, - var tablifyItemIndexes: Boolean = true, - var tablifyItemCustomProperties: Boolean = true, -): FoldingSettings diff --git a/src/com/intellij/idea/plugin/hybris/system/type/validation/impl/ItemsFileValidation.kt b/src/com/intellij/idea/plugin/hybris/system/type/validation/impl/ItemsFileValidation.kt index 8ed3bae90..df1d0aa1d 100644 --- a/src/com/intellij/idea/plugin/hybris/system/type/validation/impl/ItemsFileValidation.kt +++ b/src/com/intellij/idea/plugin/hybris/system/type/validation/impl/ItemsFileValidation.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.system.type.validation.impl import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.notifications.Notifications -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent import com.intellij.idea.plugin.hybris.system.type.model.ItemType import com.intellij.idea.plugin.hybris.system.type.model.Items import com.intellij.idea.plugin.hybris.system.type.validation.ItemsXmlFileValidation @@ -44,7 +44,7 @@ import org.apache.commons.collections4.map.CaseInsensitiveMap class ItemsFileValidation(private val project: Project) : ItemsXmlFileValidation { override fun isFileOutOfDate(file: VirtualFile): Boolean { - if (!HybrisApplicationSettingsComponent.getInstance().state.warnIfGeneratedItemsAreOutOfDate) return false + if (!ApplicationSettingsComponent.getInstance().state.warnIfGeneratedItemsAreOutOfDate) return false if (!file.name.endsWith(HybrisConstants.HYBRIS_ITEMS_XML_FILE_ENDING)) return false if (!ModuleUtil.projectContainsFile(project, file, false)) return false if (DumbService.isDumb(project)) return false diff --git a/src/com/intellij/idea/plugin/hybris/tools/ccm/SAPCCM.kt b/src/com/intellij/idea/plugin/hybris/tools/ccm/SAPCCM.kt index d6bb1c6e5..8b2e709ce 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/ccm/SAPCCM.kt +++ b/src/com/intellij/idea/plugin/hybris/tools/ccm/SAPCCM.kt @@ -26,8 +26,8 @@ import com.intellij.execution.process.ProcessEvent import com.intellij.ide.BrowserUtil import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.notifications.Notifications -import com.intellij.idea.plugin.hybris.settings.CCv2SettingsConfigurableProvider -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.options.ApplicationCCv2SettingsConfigurableProvider import com.intellij.notification.NotificationType import com.intellij.openapi.options.ShowSettingsUtil import com.intellij.openapi.project.Project @@ -39,7 +39,7 @@ object SAPCCM { fun execute( project: Project, - appSettings: HybrisApplicationSettingsComponent, + appSettings: ApplicationSettingsComponent, vararg parameters: String ): List? { val cliDirectory = appSettings.state.sapCLIDirectory @@ -84,7 +84,7 @@ object SAPCCM { "Exceeded current timeout of $timeout seconds, it can be adjusted within CCv2 settings." ) .addAction("Open Settings") { _, _ -> - ShowSettingsUtil.getInstance().showSettingsDialog(project, CCv2SettingsConfigurableProvider.SettingsConfigurable::class.java) + ShowSettingsUtil.getInstance().showSettingsDialog(project, ApplicationCCv2SettingsConfigurableProvider.SettingsConfigurable::class.java) } .hideAfter(10) .notify(project) @@ -103,7 +103,7 @@ object SAPCCM { if (content.contains("UNAUTHORIZED")) { notification .addAction("Open Settings") { _, _ -> - ShowSettingsUtil.getInstance().showSettingsDialog(project, CCv2SettingsConfigurableProvider.SettingsConfigurable::class.java) + ShowSettingsUtil.getInstance().showSettingsDialog(project, ApplicationCCv2SettingsConfigurableProvider.SettingsConfigurable::class.java) } .addAction("Generating API Tokens...") { _, _ -> BrowserUtil.browse(HybrisConstants.URL_HELP_GENERATING_API_TOKENS) } } diff --git a/src/com/intellij/idea/plugin/hybris/tools/ccm/SAPCCMCommands.kt b/src/com/intellij/idea/plugin/hybris/tools/ccm/SAPCCMCommands.kt index 7ee182e5a..6342b264a 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/ccm/SAPCCMCommands.kt +++ b/src/com/intellij/idea/plugin/hybris/tools/ccm/SAPCCMCommands.kt @@ -19,11 +19,8 @@ package com.intellij.idea.plugin.hybris.tools.ccm import com.intellij.idea.plugin.hybris.settings.CCv2Subscription -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent -import com.intellij.idea.plugin.hybris.tools.ccv2.dto.CCv2Build -import com.intellij.idea.plugin.hybris.tools.ccv2.dto.CCv2DTO -import com.intellij.idea.plugin.hybris.tools.ccv2.dto.CCv2Environment -import com.intellij.idea.plugin.hybris.tools.ccv2.dto.CCv2EnvironmentType +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.tools.ccv2.dto.* import com.intellij.openapi.progress.ProgressManager import com.intellij.openapi.project.Project @@ -34,10 +31,10 @@ open class SAPCCMCommand( ) { // TODO: use Kotlin coroutines for parallel processing fun list( - project: Project, - appSettings: HybrisApplicationSettingsComponent, - subscriptions: Collection, - transform: (String, Map) -> T, + project: Project, + appSettings: ApplicationSettingsComponent, + subscriptions: Collection, + transform: (String, Map) -> T, ) = subscriptions .associateWith { subscription -> val parameters = arrayOf(command, "list", "--subscription-code=${subscription.id}") @@ -73,15 +70,15 @@ object SAPCCMEnvironmentCommands { fun list( project: Project, - appSettings: HybrisApplicationSettingsComponent, + appSettings: ApplicationSettingsComponent, subscriptions: Collection - ) = listCommand.list(project, appSettings, subscriptions) { it, columns -> + ) = listCommand.list(project, appSettings, subscriptions) { row, columns -> CCv2Environment( - code = it.substring(0.. - ) = listCommand.list(project, appSettings, subscriptions) { it, columns -> + ) = listCommand.list(project, appSettings, subscriptions) { row, columns -> + val buildVersion = row.substring(columns["BUILD VERSION"]!!).trim() CCv2Build( - code = it.substring(0.. - ShowSettingsUtil.getInstance().showSettingsDialog(project, CCv2SettingsConfigurableProvider.SettingsConfigurable::class.java) + ShowSettingsUtil.getInstance().showSettingsDialog(project, ApplicationCCv2SettingsConfigurableProvider.SettingsConfigurable::class.java) } .addAction("Generating API Tokens...") { _, _ -> BrowserUtil.browse(HybrisConstants.URL_HELP_GENERATING_API_TOKENS) } .hideAfter(10) diff --git a/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2Build.kt b/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2Build.kt index e4875eb21..fe31084ce 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2Build.kt +++ b/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2Build.kt @@ -22,11 +22,27 @@ data class CCv2Build( val code: String, val name: String, val branch: String, - val status: String, + val status: CCv2BuildStatus, val appCode: String, val appDefVersion: String, val createdBy: String, val startTime: String, val endTime: String, val buildVersion: String, -) : CCv2DTO \ No newline at end of file + val version: String, +) : CCv2DTO + +enum class CCv2BuildStatus(val title: String) { + UNKNOWN("Unknown"), + SCHEDULED("Scheduled"), + BUILDING("Building"), + SUCCESS("Success"), + FAIL("Fail"), + DELETED("Deleted"); + + companion object { + fun tryValueOf(name: String) = CCv2BuildStatus.entries + .find { it.name == name } + ?: UNKNOWN + } +} \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2Environment.kt b/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2Environment.kt index c6f36f5f0..58aa94df5 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2Environment.kt +++ b/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2Environment.kt @@ -24,4 +24,17 @@ data class CCv2Environment( val type: CCv2EnvironmentType, val status: String, val deploymentStatus: String, -) : CCv2DTO \ No newline at end of file +) : CCv2DTO + +enum class CCv2EnvironmentType(val title: String) { + DEV("Development"), + STG("Staging"), + PROD("Production"), + UNKNOWN("Unknown"); + + companion object { + fun tryValueOf(name: String) = entries + .find { it.name == name } + ?: UNKNOWN + } +} diff --git a/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2EnvironmentType.kt b/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2EnvironmentType.kt deleted file mode 100644 index 31c19844c..000000000 --- a/src/com/intellij/idea/plugin/hybris/tools/ccv2/dto/CCv2EnvironmentType.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. - * Copyright (C) 2019-2024 EPAM Systems 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 - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.intellij.idea.plugin.hybris.tools.ccv2.dto - -enum class CCv2EnvironmentType(val title: String) { - DEV("Development"), - STG("Staging"), - PROD("Production"), - UNKNOWN("Unknown"); - - companion object { - fun tryValueOf(name: String) = entries - .find { it.name == name } - ?: UNKNOWN - } -} \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/tools/ccv2/strategies/SAPCCMCCv2Strategy.kt b/src/com/intellij/idea/plugin/hybris/tools/ccv2/strategies/SAPCCMCCv2Strategy.kt index 1321df259..9c84b0d1a 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/ccv2/strategies/SAPCCMCCv2Strategy.kt +++ b/src/com/intellij/idea/plugin/hybris/tools/ccv2/strategies/SAPCCMCCv2Strategy.kt @@ -19,7 +19,7 @@ package com.intellij.idea.plugin.hybris.tools.ccv2.strategies import com.intellij.idea.plugin.hybris.settings.CCv2Subscription -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent import com.intellij.idea.plugin.hybris.tools.ccm.SAPCCM import com.intellij.idea.plugin.hybris.tools.ccm.SAPCCMBuildCommands import com.intellij.idea.plugin.hybris.tools.ccm.SAPCCMEnvironmentCommands @@ -37,14 +37,14 @@ import kotlin.io.path.isExecutable class SAPCCMCCv2Strategy : CCv2Strategy { override fun fetchEnvironments(project: Project, ccv2Token: String, subscriptions: Collection): Map> { - val appSettings = HybrisApplicationSettingsComponent.getInstance() + val appSettings = ApplicationSettingsComponent.getInstance() authCredentials(project, appSettings, ccv2Token) ?: return emptyMap() return SAPCCMEnvironmentCommands.list(project, appSettings, subscriptions) } override fun fetchBuilds(project: Project, ccv2Token: String, subscriptions: Collection): Map> { - val appSettings = HybrisApplicationSettingsComponent.getInstance() + val appSettings = ApplicationSettingsComponent.getInstance() authCredentials(project, appSettings, ccv2Token) ?: return emptyMap() return SAPCCMBuildCommands.list(project, appSettings, subscriptions) @@ -64,7 +64,7 @@ class SAPCCMCCv2Strategy : CCv2Strategy { private fun authCredentials( project: Project, - appSettings: HybrisApplicationSettingsComponent, + appSettings: ApplicationSettingsComponent, ccv2Token: String ): List? { ProgressManager.getInstance().progressIndicator.text2 = "Authenticating with the provided token..." diff --git a/src/com/intellij/idea/plugin/hybris/tools/remote/RemoteConnectionUtil.kt b/src/com/intellij/idea/plugin/hybris/tools/remote/RemoteConnectionUtil.kt index b3ba66a12..f56017346 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/remote/RemoteConnectionUtil.kt +++ b/src/com/intellij/idea/plugin/hybris/tools/remote/RemoteConnectionUtil.kt @@ -22,9 +22,9 @@ import ai.grazie.utils.toLinkedSet import com.intellij.credentialStore.Credentials import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.properties.PropertyService -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.openapi.project.Project import java.util.* @@ -56,7 +56,7 @@ object RemoteConnectionUtil { ?: "" } - fun getActiveRemoteConnectionSettings(project: Project, type: RemoteConnectionType): HybrisRemoteConnectionSettings { + fun getActiveRemoteConnectionSettings(project: Project, type: RemoteConnectionType): RemoteConnectionSettings { val instances = getRemoteConnections(project, type) if (instances.isEmpty()) return createDefaultRemoteConnectionSettings(project, type) @@ -67,7 +67,7 @@ object RemoteConnectionUtil { ?: instances.first() } - fun getActiveRemoteConnectionId(project: Project, type: RemoteConnectionType) = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state + fun getActiveRemoteConnectionId(project: Project, type: RemoteConnectionType) = DeveloperSettingsComponent.getInstance(project).state .let { when (type) { RemoteConnectionType.Hybris -> it.activeRemoteConnectionID @@ -75,7 +75,7 @@ object RemoteConnectionUtil { } } - fun createDefaultRemoteConnectionSettings(project: Project, type: RemoteConnectionType) = HybrisRemoteConnectionSettings() + fun createDefaultRemoteConnectionSettings(project: Project, type: RemoteConnectionType) = RemoteConnectionSettings() .also { it.type = type when (type) { @@ -99,7 +99,7 @@ object RemoteConnectionUtil { } } - fun getRemoteConnections(project: Project, type: RemoteConnectionType): Collection { + fun getRemoteConnections(project: Project, type: RemoteConnectionType): Collection { val projectLevelSettings = getProjectLevelSettings(project, type) val projectPersonalLevelSettings = getProjectPersonalLevelSettings(project, type) @@ -107,29 +107,29 @@ object RemoteConnectionUtil { .toLinkedSet() } - fun addRemoteConnection(project: Project, settings: HybrisRemoteConnectionSettings) { + fun addRemoteConnection(project: Project, settings: RemoteConnectionSettings) { if (settings.uuid == null) { settings.uuid = UUID.randomUUID().toString() } when (settings.scope) { RemoteConnectionScope.PROJECT_PERSONAL -> { - val state = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state + val state = DeveloperSettingsComponent.getInstance(project).state state.remoteConnectionSettingsList.add(settings) } RemoteConnectionScope.PROJECT -> { - val state = HybrisProjectSettingsComponent.getInstance(project).state + val state = ProjectSettingsComponent.getInstance(project).state state.remoteConnectionSettingsList.add(settings) } } } - fun saveRemoteConnections(project: Project, type: RemoteConnectionType, settings: Collection) { - HybrisProjectSettingsComponent.getInstance(project).state + fun saveRemoteConnections(project: Project, type: RemoteConnectionType, settings: Collection) { + ProjectSettingsComponent.getInstance(project).state .remoteConnectionSettingsList .removeIf { it.type == type } - HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state + DeveloperSettingsComponent.getInstance(project).state .remoteConnectionSettingsList .removeIf { it.type == type } @@ -137,8 +137,8 @@ object RemoteConnectionUtil { else settings.forEach { addRemoteConnection(project, it) } } - fun setActiveRemoteConnectionSettings(project: Project, settings: HybrisRemoteConnectionSettings) { - val developerSettings = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state + fun setActiveRemoteConnectionSettings(project: Project, settings: RemoteConnectionSettings) { + val developerSettings = DeveloperSettingsComponent.getInstance(project).state when (settings.type) { RemoteConnectionType.Hybris -> { @@ -151,10 +151,10 @@ object RemoteConnectionUtil { } } - fun changeRemoteConnectionScope(project: Project, settings: HybrisRemoteConnectionSettings, originalScope: RemoteConnectionScope) { + fun changeRemoteConnectionScope(project: Project, settings: RemoteConnectionSettings, originalScope: RemoteConnectionScope) { val remoteConnectionSettings = when (originalScope) { - RemoteConnectionScope.PROJECT_PERSONAL -> HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.remoteConnectionSettingsList - RemoteConnectionScope.PROJECT -> HybrisProjectSettingsComponent.getInstance(project).state.remoteConnectionSettingsList + RemoteConnectionScope.PROJECT_PERSONAL -> DeveloperSettingsComponent.getInstance(project).state.remoteConnectionSettingsList + RemoteConnectionScope.PROJECT -> ProjectSettingsComponent.getInstance(project).state.remoteConnectionSettingsList } remoteConnectionSettings.remove(settings) addRemoteConnection(project, settings) @@ -166,7 +166,7 @@ object RemoteConnectionUtil { ) = getRemoteConnectionSettings( type, RemoteConnectionScope.PROJECT_PERSONAL, - HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).state.remoteConnectionSettingsList + DeveloperSettingsComponent.getInstance(project).state.remoteConnectionSettingsList ) private fun getProjectLevelSettings( @@ -175,13 +175,13 @@ object RemoteConnectionUtil { ) = getRemoteConnectionSettings( type, RemoteConnectionScope.PROJECT, - HybrisProjectSettingsComponent.getInstance(project).state.remoteConnectionSettingsList + ProjectSettingsComponent.getInstance(project).state.remoteConnectionSettingsList ) private fun getRemoteConnectionSettings( type: RemoteConnectionType, scope: RemoteConnectionScope, - settings: MutableList + settings: MutableList ) = settings .filter { it.type == type } .filter { it.uuid?.isNotBlank() ?: false } diff --git a/src/com/intellij/idea/plugin/hybris/tools/remote/console/actions/HybrisChooseInstanceAction.kt b/src/com/intellij/idea/plugin/hybris/tools/remote/console/actions/HybrisChooseInstanceAction.kt index fbc842233..1f12628ac 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/remote/console/actions/HybrisChooseInstanceAction.kt +++ b/src/com/intellij/idea/plugin/hybris/tools/remote/console/actions/HybrisChooseInstanceAction.kt @@ -2,7 +2,7 @@ package com.intellij.idea.plugin.hybris.tools.remote.console.actions import com.intellij.idea.plugin.hybris.common.utils.HybrisI18NBundleUtils.message import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons.Y_REMOTE -import com.intellij.idea.plugin.hybris.settings.HybrisProjectRemoteInstancesSettingsConfigurableProvider.SettingsConfigurable +import com.intellij.idea.plugin.hybris.settings.options.ProjectRemoteInstancesSettingsConfigurableProvider.SettingsConfigurable import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent diff --git a/src/com/intellij/idea/plugin/hybris/tools/remote/console/impl/HybrisImpexMonitorConsole.kt b/src/com/intellij/idea/plugin/hybris/tools/remote/console/impl/HybrisImpexMonitorConsole.kt index b495877cf..ebe5d8ed9 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/remote/console/impl/HybrisImpexMonitorConsole.kt +++ b/src/com/intellij/idea/plugin/hybris/tools/remote/console/impl/HybrisImpexMonitorConsole.kt @@ -23,7 +23,7 @@ import com.intellij.execution.console.ConsoleRootType import com.intellij.idea.plugin.hybris.common.HybrisConstants import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons import com.intellij.idea.plugin.hybris.impex.ImpexLanguage -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.tools.remote.console.HybrisConsole import com.intellij.idea.plugin.hybris.tools.remote.console.TimeOption import com.intellij.idea.plugin.hybris.tools.remote.http.monitorImpexFiles @@ -82,7 +82,7 @@ class HybrisImpexMonitorConsole(project: Project) : HybrisConsole(project, Hybri } private fun obtainDataFolder(project: Project): String { - val settings = HybrisProjectSettingsComponent.getInstance(project).state + val settings = ProjectSettingsComponent.getInstance(project).state return FileUtil.toCanonicalPath("${project.basePath}${File.separatorChar}${settings.hybrisDirectory}${File.separatorChar}${HybrisConstants.HYBRIS_DATA_DIRECTORY}") } diff --git a/src/com/intellij/idea/plugin/hybris/tools/remote/http/AbstractHybrisHacHttpClient.java b/src/com/intellij/idea/plugin/hybris/tools/remote/http/AbstractHybrisHacHttpClient.java index 9ac64e8a5..ffca4a51c 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/remote/http/AbstractHybrisHacHttpClient.java +++ b/src/com/intellij/idea/plugin/hybris/tools/remote/http/AbstractHybrisHacHttpClient.java @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.tools.remote.http; -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings; +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import org.apache.commons.lang3.StringUtils; @@ -95,9 +95,9 @@ public void checkServerTrusted(@NotNull final X509Certificate[] chain, final Str } }; - private final Map> cookiesPerSettings = new WeakHashMap<>(); + private final Map> cookiesPerSettings = new WeakHashMap<>(); - public String login(@NotNull final Project project, @NotNull final HybrisRemoteConnectionSettings settings) { + public String login(@NotNull final Project project, @NotNull final RemoteConnectionSettings settings) { final var hostHacURL = settings.getGeneratedURL(); retrieveCookies(hostHacURL, project, settings); final var sessionId = Optional.ofNullable(cookiesPerSettings.get(settings)) @@ -146,7 +146,7 @@ public final HttpResponse post( @NotNull final List params, final boolean canReLoginIfNeeded, final long timeout, - final HybrisRemoteConnectionSettings settings + final RemoteConnectionSettings settings ) { var cookies = cookiesPerSettings.get(settings); if (cookies == null || !cookies.containsKey(COOKIE_JSESSIONID)) { @@ -246,7 +246,7 @@ protected CloseableHttpClient createAllowAllClient(final long timeout) { protected void retrieveCookies( final String hacURL, final @NotNull Project project, - final @NotNull HybrisRemoteConnectionSettings settings + final @NotNull RemoteConnectionSettings settings ) { final var cookies = cookiesPerSettings.computeIfAbsent(settings, _settings -> new HashMap<>()); cookies.clear(); @@ -260,7 +260,7 @@ protected void retrieveCookies( protected Response getResponseForUrl( final String hacURL, - final @NotNull HybrisRemoteConnectionSettings settings + final @NotNull RemoteConnectionSettings settings ) { try { final var sslProtocol = settings.getSslProtocol(); @@ -276,7 +276,7 @@ protected Response getResponseForUrl( protected String getCsrfToken( final @NotNull String hacURL, final @NotNull String sessionId, - final @NotNull HybrisRemoteConnectionSettings settings + final @NotNull RemoteConnectionSettings settings ) { try { final var sslProtocol = settings.getSslProtocol(); diff --git a/src/com/intellij/idea/plugin/hybris/tools/remote/http/HybrisHacHttpClient.java b/src/com/intellij/idea/plugin/hybris/tools/remote/http/HybrisHacHttpClient.java index afe0805bc..df7b2e1b7 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/remote/http/HybrisHacHttpClient.java +++ b/src/com/intellij/idea/plugin/hybris/tools/remote/http/HybrisHacHttpClient.java @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.tools.remote.http; import com.google.gson.Gson; -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings; +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings; import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionType; import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionUtil; import com.intellij.idea.plugin.hybris.tools.remote.http.flexibleSearch.TableBuilder; @@ -103,7 +103,7 @@ private HttpResponse getHttpResponse( final Project project, final String urlSuffix, final Map requestParams, - final HybrisRemoteConnectionSettings settings + final RemoteConnectionSettings settings ) { final List params = createParamsList(requestParams); diff --git a/src/com/intellij/idea/plugin/hybris/tools/remote/http/solr/impl/SolrHttpClient.kt b/src/com/intellij/idea/plugin/hybris/tools/remote/http/solr/impl/SolrHttpClient.kt index 519dfa080..cfbe8d665 100644 --- a/src/com/intellij/idea/plugin/hybris/tools/remote/http/solr/impl/SolrHttpClient.kt +++ b/src/com/intellij/idea/plugin/hybris/tools/remote/http/solr/impl/SolrHttpClient.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.tools.remote.http.solr.impl -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionType import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionUtil import com.intellij.idea.plugin.hybris.tools.remote.http.impex.HybrisHttpResult @@ -44,13 +44,13 @@ class SolrHttpClient { fun coresData(project: Project): Array = coresData(solrConnectionSettings(project)) - fun listOfCores(solrConnectionSettings: HybrisRemoteConnectionSettings) = coresData(solrConnectionSettings) + fun listOfCores(solrConnectionSettings: RemoteConnectionSettings) = coresData(solrConnectionSettings) .map { it.core } .toTypedArray() fun executeSolrQuery(project: Project, queryObject: SolrQueryObject) = executeSolrQuery(solrConnectionSettings(project), queryObject) - private fun coresData(settings: HybrisRemoteConnectionSettings) = CoreAdminRequest() + private fun coresData(settings: RemoteConnectionSettings) = CoreAdminRequest() .apply { setAction(CoreAdminParams.CoreAdminAction.STATUS) setBasicAuthCredentials(settings.username, settings.password) @@ -78,7 +78,7 @@ class SolrHttpClient { private fun buildHttpSolrClient(url: String) = HttpSolrClient.Builder(url).build() private fun executeSolrQuery( - solrConnectionSettings: HybrisRemoteConnectionSettings, + solrConnectionSettings: RemoteConnectionSettings, queryObject: SolrQueryObject ): HybrisHttpResult = executeSolrRequest( solrConnectionSettings, @@ -89,7 +89,7 @@ class SolrHttpClient { ) ) - private fun executeSolrRequest(solrConnectionSettings: HybrisRemoteConnectionSettings, queryObject: SolrQueryObject, queryRequest: QueryRequest): HybrisHttpResult = + private fun executeSolrRequest(solrConnectionSettings: RemoteConnectionSettings, queryObject: SolrQueryObject, queryRequest: QueryRequest): HybrisHttpResult = buildHttpSolrClient("${solrConnectionSettings.generatedURL}/${queryObject.core}") .runCatching { request(queryRequest) } .map { resultBuilder().output(it["response"] as String?).build() } @@ -97,7 +97,7 @@ class SolrHttpClient { private fun resultBuilder() = HybrisHttpResult.HybrisHttpResultBuilder.createResult() - private fun buildQueryRequest(solrQuery: SolrQuery, solrConnectionSettings: HybrisRemoteConnectionSettings) = QueryRequest(solrQuery).apply { + private fun buildQueryRequest(solrQuery: SolrQuery, solrConnectionSettings: RemoteConnectionSettings) = QueryRequest(solrQuery).apply { setBasicAuthCredentials(solrConnectionSettings.username, solrConnectionSettings.password) method = SolrRequest.METHOD.POST // https://issues.apache.org/jira/browse/SOLR-5530 diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/AbstractRemoteConnectionDialog.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/AbstractRemoteConnectionDialog.kt index b36836b73..d0acbe0c6 100644 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/AbstractRemoteConnectionDialog.kt +++ b/src/com/intellij/idea/plugin/hybris/toolwindow/AbstractRemoteConnectionDialog.kt @@ -21,7 +21,7 @@ package com.intellij.idea.plugin.hybris.toolwindow import com.intellij.credentialStore.CredentialAttributes import com.intellij.credentialStore.Credentials import com.intellij.ide.passwordSafe.PasswordSafe -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionUtil import com.intellij.openapi.application.ModalityState import com.intellij.openapi.application.ReadAction @@ -51,7 +51,7 @@ import javax.swing.JLabel abstract class AbstractRemoteConnectionDialog( protected val project: Project, parentComponent: Component, - protected val settings: HybrisRemoteConnectionSettings, + protected val settings: RemoteConnectionSettings, dialogTitle: String ) : DialogWrapper(project, parentComponent, false, IdeModalityType.IDE) { @@ -109,8 +109,8 @@ abstract class AbstractRemoteConnectionDialog( } } - protected abstract fun createTestSettings(): HybrisRemoteConnectionSettings - protected abstract fun testConnection(testSettings: HybrisRemoteConnectionSettings): String? + protected abstract fun createTestSettings(): RemoteConnectionSettings + protected abstract fun testConnection(testSettings: RemoteConnectionSettings): String? protected abstract fun panel(): DialogPanel init { diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/HybrisToolWindowFactory.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/HybrisToolWindowFactory.kt index 3d2485418..b252ea56e 100644 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/HybrisToolWindowFactory.kt +++ b/src/com/intellij/idea/plugin/hybris/toolwindow/HybrisToolWindowFactory.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.toolwindow import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ProjectSettingsComponent import com.intellij.idea.plugin.hybris.tools.remote.console.view.HybrisConsolesView import com.intellij.idea.plugin.hybris.toolwindow.ccv2.CCv2View import com.intellij.idea.plugin.hybris.toolwindow.system.bean.view.BSView @@ -43,8 +43,8 @@ class HybrisToolWindowFactory : ToolWindowFactory, DumbAware { ).forEach { toolWindow.contentManager.addContent(it) } } - override suspend fun isApplicableAsync(project: Project) = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() - override fun shouldBeAvailable(project: Project) = HybrisProjectSettingsComponent.getInstance(project).isHybrisProject() + override suspend fun isApplicableAsync(project: Project) = ProjectSettingsComponent.getInstance(project).isHybrisProject() + override fun shouldBeAvailable(project: Project) = ProjectSettingsComponent.getInstance(project).isHybrisProject() private fun createTSContent(toolWindow: ToolWindow, panel: TSView) = with(toolWindow.contentManager.factory.createContent(panel, TS_ID, true)) { Disposer.register(toolWindow.disposable, panel) diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/RemoteHacConnectionDialog.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/RemoteHacConnectionDialog.kt index 15c2aff58..2fd9488c5 100644 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/RemoteHacConnectionDialog.kt +++ b/src/com/intellij/idea/plugin/hybris/toolwindow/RemoteHacConnectionDialog.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.toolwindow import com.intellij.credentialStore.Credentials import com.intellij.idea.plugin.hybris.common.HybrisConstants -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionScope import com.intellij.idea.plugin.hybris.tools.remote.http.HybrisHacHttpClient import com.intellij.openapi.project.Project @@ -34,12 +34,12 @@ import java.awt.Component class RemoteHacConnectionDialog( project: Project, parentComponent: Component, - settings: HybrisRemoteConnectionSettings + settings: RemoteConnectionSettings ) : AbstractRemoteConnectionDialog(project, parentComponent, settings, "Remote SAP Commerce Instance") { private lateinit var sslProtocolComboBox: ComboBox - override fun createTestSettings() = with(HybrisRemoteConnectionSettings()) { + override fun createTestSettings() = with(RemoteConnectionSettings()) { type = settings.type hostIP = hostTextField.text port = portTextField.text @@ -50,7 +50,7 @@ class RemoteHacConnectionDialog( this } - override fun testConnection(testSettings: HybrisRemoteConnectionSettings): String = HybrisHacHttpClient.getInstance(project) + override fun testConnection(testSettings: RemoteConnectionSettings): String = HybrisHacHttpClient.getInstance(project) .login(project, testSettings) override fun panel() = panel { diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/RemoteSolrConnectionDialog.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/RemoteSolrConnectionDialog.kt index 977da0ebe..bb95962e8 100644 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/RemoteSolrConnectionDialog.kt +++ b/src/com/intellij/idea/plugin/hybris/toolwindow/RemoteSolrConnectionDialog.kt @@ -20,7 +20,7 @@ package com.intellij.idea.plugin.hybris.toolwindow import com.intellij.credentialStore.Credentials import com.intellij.idea.plugin.hybris.common.HybrisConstants -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionScope import com.intellij.idea.plugin.hybris.tools.remote.http.solr.impl.SolrHttpClient import com.intellij.openapi.project.Project @@ -32,7 +32,7 @@ import java.awt.Component class RemoteSolrConnectionDialog( project: Project, parentComponent: Component, - settings: HybrisRemoteConnectionSettings + settings: RemoteConnectionSettings ) : AbstractRemoteConnectionDialog(project, parentComponent, settings, "Remote SOLR Instance") { override fun panel() = panel { @@ -137,7 +137,7 @@ class RemoteSolrConnectionDialog( } } - override fun createTestSettings() = with(HybrisRemoteConnectionSettings()) { + override fun createTestSettings() = with(RemoteConnectionSettings()) { type = settings.type hostIP = hostTextField.text port = portTextField.text @@ -147,7 +147,7 @@ class RemoteSolrConnectionDialog( this } - override fun testConnection(testSettings: HybrisRemoteConnectionSettings): String? = try { + override fun testConnection(testSettings: RemoteConnectionSettings): String? = try { SolrHttpClient.getInstance(project).listOfCores(testSettings) null diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2Actions.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2Actions.kt index 422cd197d..5f8641a19 100644 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2Actions.kt +++ b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2Actions.kt @@ -20,8 +20,8 @@ package com.intellij.idea.plugin.hybris.toolwindow.ccv2 import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons import com.intellij.idea.plugin.hybris.settings.CCv2Subscription -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent -import com.intellij.idea.plugin.hybris.settings.HybrisDeveloperSpecificProjectSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.idea.plugin.hybris.tools.ccv2.CCv2Service import com.intellij.idea.plugin.hybris.toolwindow.HybrisToolWindowFactory import com.intellij.openapi.actionSystem.ActionUpdateThread @@ -52,9 +52,9 @@ abstract class FetchAction( val task = object : Task.Backgroundable(project, taskTitle) { override fun run(indicator: ProgressIndicator) { fetching = true - val ccv2Subscriptions = HybrisDeveloperSpecificProjectSettingsComponent.getInstance(project).getActiveCCv2Subscription() + val ccv2Subscriptions = DeveloperSettingsComponent.getInstance(project).getActiveCCv2Subscription() ?.let { listOf(it) } - ?: HybrisApplicationSettingsComponent.getInstance().state.ccv2Subscriptions + ?: ApplicationSettingsComponent.getInstance().state.ccv2Subscriptions .sortedBy { it.toString() } fetch(project, ccv2Subscriptions) @@ -66,7 +66,7 @@ abstract class FetchAction( } override fun update(e: AnActionEvent) { - e.presentation.isEnabled = !fetching && HybrisApplicationSettingsComponent.getInstance().state.ccv2Subscriptions.isNotEmpty() + e.presentation.isEnabled = !fetching && ApplicationSettingsComponent.getInstance().state.ccv2Subscriptions.isNotEmpty() e.presentation.isVisible = e.project ?.let { getActiveTab(it) == tab } ?: false diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2Tab.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2Tab.kt index c06d92a51..2b3804a2a 100644 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2Tab.kt +++ b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2Tab.kt @@ -19,13 +19,12 @@ package com.intellij.idea.plugin.hybris.toolwindow.ccv2 import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.toolwindow.ccv2.views.* +import com.intellij.idea.plugin.hybris.toolwindow.ccv2.views.AbstractCCv2DataView +import com.intellij.idea.plugin.hybris.toolwindow.ccv2.views.CCv2BuildsDataView +import com.intellij.idea.plugin.hybris.toolwindow.ccv2.views.CCv2EnvironmentsDataView import javax.swing.Icon enum class CCv2Tab(val title: String, val icon: Icon, val view: AbstractCCv2DataView<*>) { ENVIRONMENTS("Environments", HybrisIcons.CCV2_ENVIRONMENTS, CCv2EnvironmentsDataView), BUILDS("Builds", HybrisIcons.CCV2_BUILDS, CCv2BuildsDataView), - DEPLOYMENTS("Deployments", HybrisIcons.CCV2_DEPLOYMENTS, CCv2DeploymentsDataView), - BACKUPS("Backups", HybrisIcons.CCV2_BACKUPS, CCv2BackupsDataView), - ENDPOINTS("Endpoints", HybrisIcons.CCV2_ENDPOINTS, CCv2EndpointsDataView), } \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2View.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2View.kt index e2118ef33..bf77ddddd 100644 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2View.kt +++ b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/CCv2View.kt @@ -19,7 +19,8 @@ package com.intellij.idea.plugin.hybris.toolwindow.ccv2 import com.intellij.idea.plugin.hybris.settings.CCv2Subscription -import com.intellij.idea.plugin.hybris.settings.HybrisApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.ApplicationSettingsComponent +import com.intellij.idea.plugin.hybris.settings.components.DeveloperSettingsComponent import com.intellij.idea.plugin.hybris.tools.ccv2.CCv2BuildsListener import com.intellij.idea.plugin.hybris.tools.ccv2.CCv2EnvironmentsListener import com.intellij.idea.plugin.hybris.tools.ccv2.CCv2Service @@ -51,7 +52,22 @@ class CCv2View(val project: Project) : SimpleToolWindowPanel(false), Disposable .toMutableMap() // TODO: add new TOPIC for CCv2Subscriptions - private val ccv2SubscriptionsModel = DefaultComboBoxModel() + private val ccv2SubscriptionsModel = object : DefaultComboBoxModel() { + @Serial + private val serialVersionUID: Long = -7978280099808704031L + + override fun setSelectedItem(anObject: Any?) { + super.setSelectedItem(anObject) + if (anObject == null) { + DeveloperSettingsComponent.getInstance(project).state.activeCCv2SubscriptionID = null + } + } + }.also { + it.addElement(null) + it.addAll(ApplicationSettingsComponent.getInstance().state.ccv2Subscriptions) + it.selectedItem = DeveloperSettingsComponent.getInstance(project).getActiveCCv2Subscription() + } + private val tabbedPane = JBTabbedPane().also { CCv2Tab.entries.forEach { tab -> it.addTab(tab.title, tab.icon, tab.view.noDataPanel()) @@ -59,10 +75,6 @@ class CCv2View(val project: Project) : SimpleToolWindowPanel(false), Disposable } init { - val ccv2Subscriptions = HybrisApplicationSettingsComponent.getInstance().state.ccv2Subscriptions - ccv2SubscriptionsModel.addElement(null) - ccv2SubscriptionsModel.addAll(ccv2Subscriptions) - add(rootPanel()) installToolbar() installListeners() @@ -79,6 +91,15 @@ class CCv2View(val project: Project) : SimpleToolWindowPanel(false), Disposable renderer = SimpleListCellRenderer.create("-- all subscriptions --") { it.toString() } ) .label("Subscription:") + .onChanged { + val devSettings = DeveloperSettingsComponent.getInstance(project).state + + when (val element = it.selectedItem) { + is CCv2Subscription -> devSettings.activeCCv2SubscriptionID = element.id + else -> devSettings.activeCCv2SubscriptionID = null + } + } + .component } .topGap(TopGap.SMALL) .bottomGap(BottomGap.SMALL) diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/AbstractCCv2DataView.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/AbstractCCv2DataView.kt index fcb5c3405..0a7902028 100644 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/AbstractCCv2DataView.kt +++ b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/AbstractCCv2DataView.kt @@ -47,7 +47,7 @@ abstract class AbstractCCv2DataView { protected fun Panel.noData() { row { - label("No ${CCv2EnvironmentsDataView.tab.title} data available. Try re-fetching remote data...") + label("No ${tab.title} data available. Try re-fetching remote data...") .align(Align.CENTER) .resizableColumn() }.resizableRow() diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2BackupsDataView.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2BackupsDataView.kt deleted file mode 100644 index 6af89c7b2..000000000 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2BackupsDataView.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. - * Copyright (C) 2019-2024 EPAM Systems 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 - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.intellij.idea.plugin.hybris.toolwindow.ccv2.views - -import com.intellij.idea.plugin.hybris.settings.CCv2Subscription -import com.intellij.idea.plugin.hybris.tools.ccv2.dto.CCv2DTO -import com.intellij.idea.plugin.hybris.toolwindow.ccv2.CCv2Tab -import com.intellij.openapi.ui.DialogPanel - -object CCv2BackupsDataView : AbstractCCv2DataView() { - - override val tab: CCv2Tab - get() = CCv2Tab.BACKUPS - - override fun dataPanel(data: Map>): DialogPanel { - TODO("Not yet implemented") - } -} \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2BuildsDataView.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2BuildsDataView.kt index 13889637d..eb8c3303f 100644 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2BuildsDataView.kt +++ b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2BuildsDataView.kt @@ -57,6 +57,13 @@ object CCv2BuildsDataView : AbstractCCv2DataView() { } }.gap(RightGap.COLUMNS) + panel { + row { + label(build.version) + .comment("Version") + } + }.gap(RightGap.COLUMNS) + panel { row { label(build.branch) @@ -66,7 +73,7 @@ object CCv2BuildsDataView : AbstractCCv2DataView() { panel { row { - label(build.status) + label(build.status.title) .comment("Status") } }.gap(RightGap.COLUMNS) @@ -90,13 +97,6 @@ object CCv2BuildsDataView : AbstractCCv2DataView() { label(build.endTime) .comment("End time") } - }.gap(RightGap.COLUMNS) - - panel { - row { - label(build.buildVersion) - .comment("Build") - } } }.layout(RowLayout.PARENT_GRID) } diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2DeploymentsDataView.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2DeploymentsDataView.kt deleted file mode 100644 index c106b074e..000000000 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2DeploymentsDataView.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. - * Copyright (C) 2019-2024 EPAM Systems 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 - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.intellij.idea.plugin.hybris.toolwindow.ccv2.views - -import com.intellij.idea.plugin.hybris.settings.CCv2Subscription -import com.intellij.idea.plugin.hybris.tools.ccv2.dto.CCv2DTO -import com.intellij.idea.plugin.hybris.toolwindow.ccv2.CCv2Tab -import com.intellij.openapi.ui.DialogPanel - -object CCv2DeploymentsDataView : AbstractCCv2DataView() { - - override val tab: CCv2Tab - get() = CCv2Tab.DEPLOYMENTS - - override fun dataPanel(data: Map>): DialogPanel { - TODO("Not yet implemented") - } -} \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2EndpointsDataView.kt b/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2EndpointsDataView.kt deleted file mode 100644 index e40d06d3c..000000000 --- a/src/com/intellij/idea/plugin/hybris/toolwindow/ccv2/views/CCv2EndpointsDataView.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of "SAP Commerce Developers Toolset" plugin for IntelliJ IDEA. - * Copyright (C) 2019-2024 EPAM Systems 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 - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.intellij.idea.plugin.hybris.toolwindow.ccv2.views - -import com.intellij.idea.plugin.hybris.settings.CCv2Subscription -import com.intellij.idea.plugin.hybris.tools.ccv2.dto.CCv2DTO -import com.intellij.idea.plugin.hybris.toolwindow.ccv2.CCv2Tab -import com.intellij.openapi.ui.DialogPanel - -object CCv2EndpointsDataView : AbstractCCv2DataView() { - - override val tab: CCv2Tab - get() = CCv2Tab.ENDPOINTS - - override fun dataPanel(data: Map>): DialogPanel { - TODO("Not yet implemented") - } -} \ No newline at end of file diff --git a/src/com/intellij/idea/plugin/hybris/ui/CCv2SubscriptionDialog.kt b/src/com/intellij/idea/plugin/hybris/ui/CCv2SubscriptionDialog.kt index acad600c6..3adf8c7b6 100644 --- a/src/com/intellij/idea/plugin/hybris/ui/CCv2SubscriptionDialog.kt +++ b/src/com/intellij/idea/plugin/hybris/ui/CCv2SubscriptionDialog.kt @@ -41,7 +41,7 @@ class CCv2SubscriptionDialog( override fun createCenterPanel() = panel { row { idTextField = textField() - .label("ID:") + .label("Subscription code:") .align(AlignX.FILL) .addValidationRule("ID cannot be blank.") { it.text.isBlank() } .bindText(subscription::id.toNonNullableProperty("")) diff --git a/src/com/intellij/idea/plugin/hybris/ui/RemoteHacInstancesListPanel.kt b/src/com/intellij/idea/plugin/hybris/ui/RemoteHacInstancesListPanel.kt index 5c8fd2160..f3028c31b 100644 --- a/src/com/intellij/idea/plugin/hybris/ui/RemoteHacInstancesListPanel.kt +++ b/src/com/intellij/idea/plugin/hybris/ui/RemoteHacInstancesListPanel.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.ui import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionType import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionUtil import com.intellij.idea.plugin.hybris.toolwindow.RemoteHacConnectionDialog @@ -28,7 +28,7 @@ import javax.swing.event.ListDataEvent class RemoteHacInstancesListPanel( project: Project, - private val onDataChanged: (ListDataEvent, Set) -> Unit + private val onDataChanged: (ListDataEvent, Set) -> Unit ) : RemoteInstancesListPanel(project, RemoteConnectionType.Hybris, HybrisIcons.Y_REMOTE) { public override fun addItem() { @@ -41,10 +41,10 @@ class RemoteHacInstancesListPanel( override fun onDataChanged( e: ListDataEvent, - data: Set + data: Set ) = onDataChanged.invoke(e, data) - override fun editSelectedItem(item: HybrisRemoteConnectionSettings) = if (RemoteHacConnectionDialog(myProject, this, item).showAndGet()) item + override fun editSelectedItem(item: RemoteConnectionSettings) = if (RemoteHacConnectionDialog(myProject, this, item).showAndGet()) item else null companion object { diff --git a/src/com/intellij/idea/plugin/hybris/ui/RemoteInstancesListPanel.java b/src/com/intellij/idea/plugin/hybris/ui/RemoteInstancesListPanel.java index 72c0d51f5..8cf2121b7 100644 --- a/src/com/intellij/idea/plugin/hybris/ui/RemoteInstancesListPanel.java +++ b/src/com/intellij/idea/plugin/hybris/ui/RemoteInstancesListPanel.java @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.ui; -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings; +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings; import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionType; import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionUtil; import com.intellij.openapi.project.Project; @@ -37,7 +37,7 @@ import java.util.LinkedHashSet; import java.util.Set; -abstract public class RemoteInstancesListPanel extends AddEditDeleteListPanel { +abstract public class RemoteInstancesListPanel extends AddEditDeleteListPanel { @Serial private static final long serialVersionUID = -1932103943790251488L; @@ -73,29 +73,29 @@ public void contentsChanged(final ListDataEvent e) { }); } - public void setData(final Collection remoteConnectionSettingsList) { + public void setData(final Collection remoteConnectionSettingsList) { myListModel.clear(); myListModel.addAll(remoteConnectionSettingsList); } - public Set getData() { - final var remoteConnectionSettingsList = new LinkedHashSet(); + public Set getData() { + final var remoteConnectionSettingsList = new LinkedHashSet(); for (int index = 0; index < myList.getModel().getSize(); index++) { remoteConnectionSettingsList.add(myList.getModel().getElementAt(index)); } return remoteConnectionSettingsList; } - abstract protected void onDataChanged(ListDataEvent e, final Set data); + abstract protected void onDataChanged(ListDataEvent e, final Set data); @Nullable @Override - protected HybrisRemoteConnectionSettings findItemToAdd() { + protected RemoteConnectionSettings findItemToAdd() { return null; } @Override - protected void addElement(@Nullable final HybrisRemoteConnectionSettings itemToAdd) { + protected void addElement(@Nullable final RemoteConnectionSettings itemToAdd) { super.addElement(itemToAdd); if (itemToAdd != null) RemoteConnectionUtil.INSTANCE.addRemoteConnection(myProject, itemToAdd); diff --git a/src/com/intellij/idea/plugin/hybris/ui/RemoteSolrInstancesListPanel.kt b/src/com/intellij/idea/plugin/hybris/ui/RemoteSolrInstancesListPanel.kt index cfd32c489..cb76a9b80 100644 --- a/src/com/intellij/idea/plugin/hybris/ui/RemoteSolrInstancesListPanel.kt +++ b/src/com/intellij/idea/plugin/hybris/ui/RemoteSolrInstancesListPanel.kt @@ -18,7 +18,7 @@ package com.intellij.idea.plugin.hybris.ui import com.intellij.idea.plugin.hybris.common.utils.HybrisIcons -import com.intellij.idea.plugin.hybris.settings.HybrisRemoteConnectionSettings +import com.intellij.idea.plugin.hybris.settings.RemoteConnectionSettings import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionType import com.intellij.idea.plugin.hybris.tools.remote.RemoteConnectionUtil import com.intellij.idea.plugin.hybris.toolwindow.RemoteSolrConnectionDialog @@ -28,10 +28,10 @@ import javax.swing.event.ListDataEvent class RemoteSolrInstancesListPanel( project: Project, - private val onDataChanged: (ListDataEvent, Set) -> Unit = { _, _ -> } + private val onDataChanged: (ListDataEvent, Set) -> Unit = { _, _ -> } ) : RemoteInstancesListPanel(project, RemoteConnectionType.SOLR, HybrisIcons.CONSOLE_SOLR) { - override fun editSelectedItem(item: HybrisRemoteConnectionSettings): HybrisRemoteConnectionSettings? { + override fun editSelectedItem(item: RemoteConnectionSettings): RemoteConnectionSettings? { val ok = RemoteSolrConnectionDialog(myProject, this, item).showAndGet() return if (ok) item else null @@ -47,7 +47,7 @@ class RemoteSolrInstancesListPanel( override fun onDataChanged( e: ListDataEvent, - data: Set + data: Set ) = onDataChanged.invoke(e, data) companion object {