├── .github └── workflows │ └── verify.yml ├── .gitignore ├── .sdkmanrc ├── Dockerfile ├── README.markdown ├── build.gradle ├── copyright.txt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── ignoredProblems.txt ├── libs ├── com.liferay.workspace.bundle.url.codec-1.0.0.jar └── gradle-tooling.jar ├── settings.gradle ├── source-formatter-suppressions.xml ├── source-formatter.properties ├── src ├── main │ ├── java │ │ └── com │ │ │ └── liferay │ │ │ └── ide │ │ │ └── idea │ │ │ ├── bnd │ │ │ ├── BndFileType.java │ │ │ ├── BndHighlightingAnnotator.java │ │ │ ├── BndLanguage.java │ │ │ ├── LiferayBndConstants.java │ │ │ ├── OsgiManifestColorsAndFonts.java │ │ │ ├── actions │ │ │ │ └── EnterInBndFileHandler.java │ │ │ ├── commenter │ │ │ │ └── BndCommenter.java │ │ │ ├── completion │ │ │ │ ├── BndCompletionContributor.java │ │ │ │ ├── HeaderParametersProvider.java │ │ │ │ └── SimpleProvider.java │ │ │ ├── formatting │ │ │ │ ├── BndFormatterBlock.java │ │ │ │ └── BndFormattingModelBuilder.java │ │ │ ├── highlighting │ │ │ │ └── BndSyntaxHighlighterFactory.java │ │ │ ├── lexer │ │ │ │ └── BndLexer.java │ │ │ ├── parser │ │ │ │ ├── BasePackageParser.java │ │ │ │ ├── BndHeaderParser.java │ │ │ │ ├── BndHeaderParsers.java │ │ │ │ ├── BndHeaderParsersConstants.java │ │ │ │ ├── BndParser.java │ │ │ │ ├── BndParserDefinition.java │ │ │ │ ├── BundleActivatorParser.java │ │ │ │ ├── BundleVersionParser.java │ │ │ │ ├── ClassReferenceParser.java │ │ │ │ ├── ExportPackageParser.java │ │ │ │ └── FileReferenceParser.java │ │ │ └── psi │ │ │ │ ├── AssignmentExpression.java │ │ │ │ ├── Attribute.java │ │ │ │ ├── BndElementType.java │ │ │ │ ├── BndFile.java │ │ │ │ ├── BndHeader.java │ │ │ │ ├── BndHeaderValue.java │ │ │ │ ├── BndHeaderValuePart.java │ │ │ │ ├── BndSection.java │ │ │ │ ├── BndToken.java │ │ │ │ ├── BndTokenType.java │ │ │ │ ├── Clause.java │ │ │ │ ├── Directive.java │ │ │ │ ├── impl │ │ │ │ ├── AbstractAssignmentExpression.java │ │ │ │ ├── AttributeImpl.java │ │ │ │ ├── BndFileImpl.java │ │ │ │ ├── BndHeaderImpl.java │ │ │ │ ├── BndHeaderValuePartImpl.java │ │ │ │ ├── BndHeaderValuePartManipulator.java │ │ │ │ ├── BndSectionImpl.java │ │ │ │ ├── BndTokenImpl.java │ │ │ │ ├── ClauseImpl.java │ │ │ │ └── DirectiveImpl.java │ │ │ │ └── util │ │ │ │ └── BndPsiUtil.java │ │ │ ├── core │ │ │ ├── AbstractWorkspaceProvider.java │ │ │ ├── LiferayCore.java │ │ │ ├── LiferayGradleProjectResolverExtension.java │ │ │ ├── LiferayGradleTaskManager.java │ │ │ ├── LiferayGradleWorkspaceProvider.java │ │ │ ├── LiferayIcons.java │ │ │ ├── LiferayInspectionsConstants.java │ │ │ ├── LiferayMavenWorkspaceProvider.java │ │ │ ├── LiferayPostStartupActivity.java │ │ │ ├── LiferayProjectTypeService.java │ │ │ ├── LiferayWebFacetPostStartupActivity.java │ │ │ ├── MessagesBundle.java │ │ │ ├── ProductInfo.java │ │ │ ├── WorkspaceConstants.java │ │ │ └── WorkspaceProvider.java │ │ │ ├── extensions │ │ │ ├── GradleDependencyQuickFix.java │ │ │ └── GradleDependencyQuickFixProvider.java │ │ │ ├── language │ │ │ ├── LiferayDefinitionsResourceProvider.java │ │ │ ├── LiferayXmlFileReferenceContributor.java │ │ │ ├── LiferayXmlFileReferenceFilterPattern.java │ │ │ ├── LiferayXmlSchemaProvider.java │ │ │ ├── blade │ │ │ │ └── LiferayBladePropertiesImplicitUsageProvider.java │ │ │ ├── gradle │ │ │ │ └── LiferayGradlePropertiesImplicitUsageProvider.java │ │ │ ├── javascript │ │ │ │ └── LiferayJSPredefinedLibraryProvider.java │ │ │ ├── jsp │ │ │ │ ├── LiferayJspDebuggerPositionManager.java │ │ │ │ ├── LiferayJspDebuggerPositionManagerFactory.java │ │ │ │ └── LiferayJspDebuggerSourceFinderAdapter.java │ │ │ ├── osgi │ │ │ │ ├── ComponentPropertiesCompletionContributor.java │ │ │ │ ├── ComponentPropertiesPsiElementPatternCapture.java │ │ │ │ └── LiferayOsgiImplicitUsageProvider.java │ │ │ ├── resourcebundle │ │ │ │ ├── CustomResourceBundleReference.java │ │ │ │ ├── LiferayResourceBundlePropertiesImplicitUsageProvider.java │ │ │ │ ├── ResourceBundleReferenceContributor.java │ │ │ │ ├── ResourceBundleReferenceElementFilter.java │ │ │ │ └── ResourceBundleReferenceProvider.java │ │ │ ├── service │ │ │ │ ├── AbstractLiferayServiceXMLDuplicateEntryInspection.java │ │ │ │ ├── LiferayServiceJavaImplLineMarkerProvider.java │ │ │ │ ├── LiferayServiceXMLDuplicateColumnInspection.java │ │ │ │ ├── LiferayServiceXMLDuplicateEntityInspection.java │ │ │ │ ├── LiferayServiceXMLDuplicateExceptionInspection.java │ │ │ │ ├── LiferayServiceXMLDuplicateFinderInspection.java │ │ │ │ ├── LiferayServiceXMLEntityUuidInspection.java │ │ │ │ ├── LiferayServiceXMLExceptionNameInspection.java │ │ │ │ ├── LiferayServiceXMLInspectionToolProvider.java │ │ │ │ ├── LiferayServiceXMLLineMarkerProvider.java │ │ │ │ ├── LiferayServiceXMLNamespaceInspection.java │ │ │ │ ├── LiferayServiceXMLPrimaryKeyColumnInspection.java │ │ │ │ └── LiferayServiceXMLUtil.java │ │ │ └── tag │ │ │ │ ├── AbstractLiferayTaglibJavaBeanReferenceProvider.java │ │ │ │ ├── AbstractLiferayTaglibReferenceContributor.java │ │ │ │ ├── AuiTagAttributeValueCompletionContributor.java │ │ │ │ ├── BooleanCompletionProvider.java │ │ │ │ ├── LiferayLookupElementBuilderFactory.java │ │ │ │ ├── LiferayTaglibCSSClassAttributeReferenceContributor.java │ │ │ │ ├── LiferayTaglibClassNameReferenceContributor.java │ │ │ │ ├── LiferayTaglibInspectionToolProvider.java │ │ │ │ ├── LiferayTaglibJavaBeanReference.java │ │ │ │ ├── LiferayTaglibJavascriptLanguageInjector.java │ │ │ │ ├── LiferayTaglibModelContextJavaBeanReferenceContributor.java │ │ │ │ ├── LiferayTaglibModelContextJavaBeanReferenceProvider.java │ │ │ │ ├── LiferayTaglibResourceBundlePropertyReference.java │ │ │ │ ├── LiferayTaglibResourceBundleReferenceContributor.java │ │ │ │ ├── LiferayTaglibResourceBundleReferenceProvider.java │ │ │ │ ├── LiferayTaglibSearchContainerJavaBeanReferenceContributor.java │ │ │ │ ├── LiferayTaglibSearchContainerJavaBeanReferenceProvider.java │ │ │ │ ├── LiferayTaglibStrictQuoteEscapingInspection.java │ │ │ │ ├── LiferayTaglibStringConcatInspection.java │ │ │ │ ├── LiferayTaglibs.java │ │ │ │ ├── StringCompletionProvider.java │ │ │ │ └── TagPatternCondition.java │ │ │ ├── server │ │ │ ├── LiferayDockerServerConfiguration.java │ │ │ ├── LiferayDockerServerConfigurationEditor.form │ │ │ ├── LiferayDockerServerConfigurationEditor.java │ │ │ ├── LiferayDockerServerConfigurationProducer.java │ │ │ ├── LiferayDockerServerConfigurationType.java │ │ │ ├── LiferayDockerServerDebuggerRunner.java │ │ │ ├── LiferayDockerServerRunner.java │ │ │ ├── LiferayEnvironmentVariablesDialog.java │ │ │ ├── LiferayEnvironmentVariablesTextFieldWithBrowseButton.java │ │ │ ├── LiferayServerCommandLineState.java │ │ │ ├── LiferayServerConfigurable.form │ │ │ ├── LiferayServerConfigurable.java │ │ │ ├── LiferayServerConfiguration.java │ │ │ ├── LiferayServerConfigurationProducer.java │ │ │ ├── LiferayServerConfigurationType.java │ │ │ ├── LiferayServerDebuggerRunner.java │ │ │ ├── LiferayServerRunner.java │ │ │ ├── ServerRunnerChecker.java │ │ │ ├── gogo │ │ │ │ └── GogoTelnetClient.java │ │ │ └── portal │ │ │ │ ├── AbstractPortalBundle.java │ │ │ │ ├── AbstractPortalBundleFactory.java │ │ │ │ ├── LayeredModulePathFactory.java │ │ │ │ ├── PortalBundle.java │ │ │ │ ├── PortalBundleFactory.java │ │ │ │ ├── PortalJBossBundle.java │ │ │ │ ├── PortalJBossBundleFactory.java │ │ │ │ ├── PortalJBossEapBundle.java │ │ │ │ ├── PortalJBossEapBundleFactory.java │ │ │ │ ├── PortalTomcatBundle.java │ │ │ │ ├── PortalTomcatBundleFactory.java │ │ │ │ ├── PortalWildFlyBundle.java │ │ │ │ └── PortalWildFlyBundleFactory.java │ │ │ ├── ui │ │ │ ├── actions │ │ │ │ ├── AbstractLiferayAction.java │ │ │ │ ├── AbstractLiferayGradleTaskAction.java │ │ │ │ ├── AbstractLiferayMavenGoalAction.java │ │ │ │ ├── BuildServiceGradleModuleAction.java │ │ │ │ ├── BuildServiceMavenModuleAction.java │ │ │ │ ├── CompareOriginalImplementationAction.java │ │ │ │ ├── DeployDockerModuleAction.java │ │ │ │ ├── DeployGradleModuleAction.java │ │ │ │ ├── DeployMavenModuleAction.java │ │ │ │ ├── InitBundleGradleAction.java │ │ │ │ ├── InitBundleMavenAction.java │ │ │ │ ├── InitDockerBundleAction.java │ │ │ │ ├── LiferayActionGroup.java │ │ │ │ └── WatchGradleModuleAction.java │ │ │ ├── compoments │ │ │ │ └── FixedSizeRefreshButton.java │ │ │ ├── decorator │ │ │ │ └── ProjectViewWatchDecorator.java │ │ │ └── modules │ │ │ │ ├── LiferayGradleWorkspaceBuilder.java │ │ │ │ ├── LiferayMavenWorkspaceBuilder.java │ │ │ │ ├── LiferayModuleBuilder.java │ │ │ │ ├── LiferayModuleNameLocationComponent.form │ │ │ │ ├── LiferayModuleNameLocationComponent.java │ │ │ │ ├── LiferayModuleTemplate.java │ │ │ │ ├── LiferayModuleWizardStep.form │ │ │ │ ├── LiferayModuleWizardStep.java │ │ │ │ ├── LiferayNamePathComponent.java │ │ │ │ ├── LiferayProjectSettingsStep.form │ │ │ │ ├── LiferayProjectSettingsStep.java │ │ │ │ ├── LiferayProjectTemplateList.form │ │ │ │ ├── LiferayProjectTemplateList.java │ │ │ │ ├── LiferayProjectType.java │ │ │ │ ├── LiferayProjectTypesComponent.form │ │ │ │ ├── LiferayProjectTypesComponent.java │ │ │ │ ├── LiferayWorkspaceBuilder.java │ │ │ │ ├── LiferayWorkspaceProductDialog.java │ │ │ │ ├── LiferayWorkspaceProductTip.java │ │ │ │ ├── LiferayWorkspaceTemplate.java │ │ │ │ ├── LiferayWorkspaceTemplatesFactory.java │ │ │ │ ├── ext │ │ │ │ ├── EntryDescription.java │ │ │ │ ├── LiferayModuleExtBuilder.java │ │ │ │ ├── LiferayModuleExtTemplate.java │ │ │ │ ├── LiferayModuleExtWizardStep.form │ │ │ │ ├── LiferayModuleExtWizardStep.java │ │ │ │ ├── NewModuleExtFilesAction.java │ │ │ │ ├── NewModuleExtFilesDialog.form │ │ │ │ ├── OverrideFilesComponent.form │ │ │ │ └── OverrideFilesComponent.java │ │ │ │ └── springmvcportlet │ │ │ │ ├── LiferaySpringMVCPortletTemplate.java │ │ │ │ ├── SpringMVCPortletModuleBuilder.java │ │ │ │ ├── SpringMVCPortletProjectConstants.java │ │ │ │ ├── SpringMvcPortletModuleModuleWizardStep.form │ │ │ │ └── SpringMvcPortletModuleWizardStep.java │ │ │ └── util │ │ │ ├── BladeCLI.java │ │ │ ├── CoreUtil.java │ │ │ ├── FileListing.java │ │ │ ├── FileUtil.java │ │ │ ├── FindAllDependenciesVisitor.java │ │ │ ├── GradleDependency.java │ │ │ ├── GradleDependencyUpdater.java │ │ │ ├── GradleUtil.java │ │ │ ├── IntellijUtil.java │ │ │ ├── JavaUtil.java │ │ │ ├── LiferayAnnotationUtil.java │ │ │ ├── LiferayWorkspaceSupport.java │ │ │ ├── ListUtil.java │ │ │ ├── MavenUtil.java │ │ │ ├── Pair.java │ │ │ ├── PortalPropertiesConfiguration.java │ │ │ ├── PortalPropertiesConfigurationLayout.java │ │ │ ├── ProjectConfigurationUtil.java │ │ │ ├── PropertiesUtil.java │ │ │ ├── SdkUtil.java │ │ │ ├── ServerUtil.java │ │ │ ├── StringBufferOutputStream.java │ │ │ ├── StringPool.java │ │ │ ├── SwitchConsumer.java │ │ │ ├── ZipUtil.java │ │ │ └── init.gradle │ └── resources │ │ ├── META-INF │ │ ├── com.liferay.ide.intellij.plugin-JSIntentionPowerPack.xml │ │ ├── com.liferay.ide.intellij.plugin-css.xml │ │ ├── com.liferay.ide.intellij.plugin-database.xml │ │ ├── com.liferay.ide.intellij.plugin-javaee-web.xml │ │ ├── com.liferay.ide.intellij.plugin-javaee.xml │ │ ├── com.liferay.ide.intellij.plugin-javascript.xml │ │ ├── com.liferay.ide.intellij.plugin-jsp.xml │ │ ├── com.liferay.ide.intellij.plugin-persistence.xml │ │ ├── com.liferay.ide.intellij.plugin-properties.xml │ │ ├── com.liferay.ide.intellij.plugin-sass.xml │ │ ├── com.liferay.ide.intellij.plugin-webcomponents.xml │ │ ├── plugin.xml │ │ ├── pluginIcon.svg │ │ └── services │ │ │ └── com.liferay.ide.idea.core.WorkspaceProvider │ │ ├── configurations │ │ └── springmvc.json │ │ ├── definitions │ │ ├── dtd │ │ │ ├── liferay-display_7_0_0.dtd │ │ │ ├── liferay-display_7_1_0.dtd │ │ │ ├── liferay-display_7_2_0.dtd │ │ │ ├── liferay-display_7_3_0.dtd │ │ │ ├── liferay-display_7_4_0.dtd │ │ │ ├── liferay-friendly-url-routes_7_0_0.dtd │ │ │ ├── liferay-friendly-url-routes_7_1_0.dtd │ │ │ ├── liferay-friendly-url-routes_7_2_0.dtd │ │ │ ├── liferay-friendly-url-routes_7_3_0.dtd │ │ │ ├── liferay-friendly-url-routes_7_4_0.dtd │ │ │ ├── liferay-hook_7_0_0.dtd │ │ │ ├── liferay-hook_7_1_0.dtd │ │ │ ├── liferay-hook_7_2_0.dtd │ │ │ ├── liferay-hook_7_3_0.dtd │ │ │ ├── liferay-hook_7_4_0.dtd │ │ │ ├── liferay-layout-templates_7_0_0.dtd │ │ │ ├── liferay-layout-templates_7_1_0.dtd │ │ │ ├── liferay-layout-templates_7_2_0.dtd │ │ │ ├── liferay-layout-templates_7_3_0.dtd │ │ │ ├── liferay-layout-templates_7_4_0.dtd │ │ │ ├── liferay-look-and-feel_7_0_0.dtd │ │ │ ├── liferay-look-and-feel_7_1_0.dtd │ │ │ ├── liferay-look-and-feel_7_2_0.dtd │ │ │ ├── liferay-look-and-feel_7_3_0.dtd │ │ │ ├── liferay-look-and-feel_7_4_0.dtd │ │ │ ├── liferay-plugin-package_7_0_0.dtd │ │ │ ├── liferay-plugin-package_7_1_0.dtd │ │ │ ├── liferay-plugin-package_7_2_0.dtd │ │ │ ├── liferay-plugin-package_7_3_0.dtd │ │ │ ├── liferay-plugin-package_7_4_0.dtd │ │ │ ├── liferay-plugin-repository_7_0_0.dtd │ │ │ ├── liferay-plugin-repository_7_1_0.dtd │ │ │ ├── liferay-plugin-repository_7_2_0.dtd │ │ │ ├── liferay-plugin-repository_7_3_0.dtd │ │ │ ├── liferay-plugin-repository_7_4_0.dtd │ │ │ ├── liferay-portlet-app_7_0_0.dtd │ │ │ ├── liferay-portlet-app_7_1_0.dtd │ │ │ ├── liferay-portlet-app_7_2_0.dtd │ │ │ ├── liferay-portlet-app_7_3_0.dtd │ │ │ ├── liferay-portlet-app_7_4_0.dtd │ │ │ ├── liferay-resource-action-mapping_7_0_0.dtd │ │ │ ├── liferay-resource-action-mapping_7_1_0.dtd │ │ │ ├── liferay-resource-action-mapping_7_2_0.dtd │ │ │ ├── liferay-resource-action-mapping_7_3_0.dtd │ │ │ ├── liferay-resource-action-mapping_7_4_0.dtd │ │ │ ├── liferay-service-builder_7_0_0.dtd │ │ │ ├── liferay-service-builder_7_1_0.dtd │ │ │ ├── liferay-service-builder_7_2_0.dtd │ │ │ ├── liferay-service-builder_7_3_0.dtd │ │ │ ├── liferay-service-builder_7_4_0.dtd │ │ │ ├── liferay-social_7_0_0.dtd │ │ │ ├── liferay-social_7_1_0.dtd │ │ │ ├── liferay-social_7_2_0.dtd │ │ │ ├── liferay-social_7_3_0.dtd │ │ │ ├── liferay-social_7_4_0.dtd │ │ │ ├── liferay-theme-loader_7_0_0.dtd │ │ │ ├── liferay-theme-loader_7_1_0.dtd │ │ │ ├── liferay-theme-loader_7_2_0.dtd │ │ │ ├── liferay-theme-loader_7_3_0.dtd │ │ │ ├── liferay-theme-loader_7_4_0.dtd │ │ │ ├── liferay-user-notification-definitions_7_0_0.dtd │ │ │ ├── liferay-user-notification-definitions_7_1_0.dtd │ │ │ ├── liferay-user-notification-definitions_7_2_0.dtd │ │ │ ├── liferay-user-notification-definitions_7_3_0.dtd │ │ │ └── liferay-user-notification-definitions_7_4_0.dtd │ │ ├── tld │ │ │ ├── liferay-aui.tld │ │ │ └── liferay-ui.tld │ │ └── xsd │ │ │ ├── liferay-custom-sql_7_0_0.xsd │ │ │ ├── liferay-portlet-model-hints_7_0_0.xsd │ │ │ ├── liferay-workflow-definition_7_0_0.xsd │ │ │ ├── liferay-workflow-definition_7_1_0.xsd │ │ │ ├── liferay-workflow-definition_7_2_0.xsd │ │ │ ├── liferay-workflow-definition_7_3_0.xsd │ │ │ ├── liferay-workflow-definition_7_4_0.xsd │ │ │ ├── portlet-app_2_0.xsd │ │ │ └── portlet-app_3_0.xsd │ │ ├── icons │ │ ├── bnd.png │ │ ├── liferay.svg │ │ ├── osgi.png │ │ └── portletMVC4Spring_16x16_new.png │ │ ├── libs │ │ └── gradle-tooling.jar │ │ └── messages │ │ └── Messages.properties └── test │ └── java │ └── com │ └── liferay │ └── ide │ └── idea │ ├── bnd │ ├── BndHighlightingAnnotatorTest.java │ ├── actions │ │ └── EnterInBndFileHandlerTest.java │ ├── commenter │ │ └── BndCommenterTest.java │ ├── completion │ │ └── BndFileCompletionTest.java │ ├── formatting │ │ └── BndFormattingTest.java │ ├── parser │ │ ├── BasePackageParserTest.java │ │ ├── BundleActivatorParserTest.java │ │ ├── BundleVersionParserTest.java │ │ ├── ClassReferenceParserTest.java │ │ ├── ExportPackageParserTest.java │ │ └── FileReferenceParserTest.java │ └── psi │ │ └── impl │ │ └── BndHeaderValuePartManipulatorTest.java │ ├── language │ ├── LiferayXmlFileReferenceContributorTest.java │ ├── LiferayXmlSchemaProviderTest.java │ ├── blade │ │ └── LiferayBladePropertiesImplicitUsageProviderTest.java │ ├── gradle │ │ └── LiferayGradlePropertiesImplicitUsageProviderTest.java │ ├── javascript │ │ └── LiferayJSPredefinedLibraryProviderTest.java │ ├── jsp │ │ └── LiferayJspDebuggerSourceFinderAdapterTest.java │ ├── osgi │ │ ├── ComponentPropertiesCompletionContributorTest.java │ │ └── LiferayOsgiImplicitUsageProviderTest.java │ ├── resourcebundle │ │ ├── LiferayResourceBundlePropertiesImplicitUsageProviderTest.java │ │ └── ResourceBundleReferenceProviderTest.java │ ├── service │ │ ├── LiferayServiceJavaImplLineMarkerProviderTest.java │ │ ├── LiferayServiceXMLDuplicateColumnInspectionTest.java │ │ ├── LiferayServiceXMLDuplicateEntityInspectionTest.java │ │ ├── LiferayServiceXMLDuplicateExceptionInspectionTest.java │ │ ├── LiferayServiceXMLDuplicateFinderInspectionTest.java │ │ ├── LiferayServiceXMLEntityUuidInspectionTest.java │ │ ├── LiferayServiceXMLExceptionNameInspectionTest.java │ │ ├── LiferayServiceXMLLineMarkerProviderTest.java │ │ ├── LiferayServiceXMLNamespaceInspectionTest.java │ │ └── LiferayServiceXMLPrimaryKeyColumnInspectionTest.java │ └── tag │ │ ├── LiferayTaglibCSSClassAttributeReferenceContributorTest.java │ │ ├── LiferayTaglibClassNameReferenceContributorTest.java │ │ ├── LiferayTaglibJavascriptLanguageInjectorTest.java │ │ ├── LiferayTaglibModelContextJavaBeanReferenceProviderTest.java │ │ ├── LiferayTaglibResourceBundleReferenceContributorTest.java │ │ ├── LiferayTaglibSearchContainerJavaBeanReferenceContributorTest.java │ │ ├── LiferayTaglibStrictQuoteEscapingInspectionTest.java │ │ └── LiferayTaglibStringConcatInspectionTest.java │ └── util │ └── SwitchConsumerTest.java └── testdata └── com └── liferay └── ide └── idea ├── bnd ├── BndHighlightingAnnotatorTest │ └── bnd.bnd ├── actions │ └── EnterInBndFileHandlerTest │ │ ├── bnd.bnd │ │ └── updated.bnd ├── commenter │ └── BndCommenterTest │ │ ├── bnd.bnd │ │ └── expected.bnd ├── formatting │ └── BndFormattingTest │ │ ├── bnd.bnd │ │ └── formatted.bnd ├── parser │ ├── BasePackageParserTest │ │ ├── com │ │ │ └── liferay │ │ │ │ └── test │ │ │ │ └── Foo.java │ │ ├── invalidImportPackage │ │ │ └── bnd.bnd │ │ ├── resolvePackage │ │ │ └── bnd.bnd │ │ └── validImportPackage │ │ │ └── bnd.bnd │ ├── BundleActivatorParserTest │ │ ├── com │ │ │ └── liferay │ │ │ │ └── test │ │ │ │ ├── Foo.java │ │ │ │ └── MyBundleActivator.java │ │ ├── invalid │ │ │ └── bnd.bnd │ │ ├── org │ │ │ └── osgi │ │ │ │ └── framework │ │ │ │ └── BundleActivator.java │ │ └── valid │ │ │ └── bnd.bnd │ ├── ClassReferenceParserTest │ │ ├── classReferenceContributor │ │ │ └── bnd.bnd │ │ ├── com │ │ │ └── liferay │ │ │ │ └── test │ │ │ │ └── Foo.java │ │ ├── invalidClassReference │ │ │ └── bnd.bnd │ │ ├── resolveClass │ │ │ └── bnd.bnd │ │ └── validClassReference │ │ │ └── bnd.bnd │ ├── ExportPackageParserTest │ │ ├── com │ │ │ └── liferay │ │ │ │ ├── foo │ │ │ │ └── Bar.java │ │ │ │ └── test │ │ │ │ └── Foo.java │ │ ├── invalidExportPackage │ │ │ └── bnd.bnd │ │ ├── invalidExportPackageUses │ │ │ └── bnd.bnd │ │ ├── resolvePackage │ │ │ └── bnd.bnd │ │ ├── resolvePackageUses │ │ │ └── bnd.bnd │ │ ├── validExportPackage │ │ │ └── bnd.bnd │ │ └── validExportPackageUses │ │ │ └── bnd.bnd │ └── FileReferenceParserTest │ │ ├── configs │ │ └── main.js │ │ ├── fileReferenceContributor │ │ └── bnd.bnd │ │ ├── invalidFileReference │ │ └── bnd.bnd │ │ ├── resolveFile │ │ └── bnd.bnd │ │ └── validFileReference │ │ └── bnd.bnd └── psi │ └── impl │ └── BndHeaderValuePartManipulatorTest │ ├── com │ └── liferay │ │ └── test │ │ ├── Bar.java │ │ ├── Bar_Renamed.java │ │ ├── Baz.java │ │ ├── Foo.java │ │ └── Foo_Renamed.java │ ├── testRenameClassInsideBnd │ └── bnd.bnd │ ├── testRenameClassInsideClass │ ├── bnd.bnd │ └── bnd_renamed.bnd │ ├── testRenamePackageInsideBnd │ └── bnd.bnd │ └── testRenamePackageInsideClass │ ├── bnd.bnd │ └── bnd_renamed.bnd └── language ├── LiferayXmlFileReferenceContributorTest ├── META-INF │ └── resource-actions │ │ ├── custom.xml │ │ └── default.xml ├── custom_jsps │ └── foo.txt ├── default.xml ├── liferay-hook.xml └── my_resources.xml ├── LiferayXmlSchemaProviderTest └── portlet-model-hints.xml ├── blade └── LiferayBladePropertiesImplicitUsageProviderTest │ └── .blade.properties ├── gradle └── LiferayGradlePropertiesImplicitUsageProviderTest │ └── gradle.properties ├── javascript └── LiferayJSPredefinedLibraryProviderTest │ ├── aui.jsp │ ├── com.liferay.frontend.js.web.jar │ ├── liferay-aui.tld │ ├── main.js │ └── view.jsp ├── jsp └── LiferayJspDebuggerSourceFinderAdapterTest │ ├── com.liferay.journal.web.jar │ └── com.liferay.login.web.jar ├── osgi ├── ComponentPropertiesCompletionContributorTest │ ├── MultiServiceComponent.java │ ├── MyComponent.java │ ├── SinglePropertyComponent.java │ ├── com │ │ └── liferay │ │ │ └── portal │ │ │ └── kernel │ │ │ ├── portlet │ │ │ └── bridges │ │ │ │ └── mvc │ │ │ │ └── MVCActionCommand.java │ │ │ └── search │ │ │ └── IndexerPostProcessor.java │ └── osgi.jar └── LiferayOsgiImplicitUsageProviderTest │ ├── MyComponent.java │ ├── MyServiceWrapper.java │ ├── com │ └── liferay │ │ └── portal │ │ └── kernel │ │ └── service │ │ └── ServiceWrapper.java │ └── osgi.jar ├── resourcebundle ├── LiferayResourceBundlePropertiesImplicitUsageProviderTest │ ├── Language.properties │ └── Language_unused.properties └── ResourceBundleReferenceProviderTest │ ├── MyResourceBundleLoader.java │ ├── content │ ├── Language.properties │ └── Language_en.properties │ └── java │ └── util │ └── ResourceBundle.java ├── service ├── LiferayServiceJavaImplLineMarkerProviderTest │ ├── com │ │ └── liferay │ │ │ └── ide │ │ │ └── model │ │ │ └── impl │ │ │ └── MyModelImpl.java │ └── service.xml ├── LiferayServiceXMLDuplicateColumnInspectionTest │ ├── service.xml │ └── service_fixed.xml ├── LiferayServiceXMLDuplicateEntityInspectionTest │ ├── service.xml │ └── service_fixed.xml ├── LiferayServiceXMLDuplicateExceptionInspectionTest │ ├── service.xml │ └── service_fixed.xml ├── LiferayServiceXMLDuplicateFinderInspectionTest │ ├── service.xml │ └── service_fixed.xml ├── LiferayServiceXMLEntityUuidInspectionTest │ ├── service_invalid.xml │ └── service_valid.xml ├── LiferayServiceXMLExceptionNameInspectionTest │ ├── service.xml │ └── service_fixed.xml ├── LiferayServiceXMLLineMarkerProviderTest │ ├── com │ │ └── liferay │ │ │ └── ide │ │ │ └── model │ │ │ └── impl │ │ │ └── MyModelImpl.java │ └── service.xml ├── LiferayServiceXMLNamespaceInspectionTest │ ├── service_invalid.xml │ └── service_valid.xml └── LiferayServiceXMLPrimaryKeyColumnInspectionTest │ ├── service_invalid.xml │ └── service_valid.xml └── tag ├── LiferayTaglibCSSClassAttributeReferenceContributorTest ├── custom.scss ├── liferay-aui.tld ├── main.css └── view.jsp ├── LiferayTaglibClassNameReferenceContributorTest ├── MyObject.java ├── com │ └── liferay │ │ └── ide │ │ └── model │ │ └── MyOuter.java ├── inner.jsp ├── liferay-aui.tld └── view.jsp ├── LiferayTaglibJavascriptLanguageInjectorTest ├── aui-validator-custom.jsp ├── aui-validator-required.jsp ├── custom.jsp ├── liferay-aui.tld └── view.jsp ├── LiferayTaglibModelContextJavaBeanReferenceProviderTest ├── com │ └── liferay │ │ └── ide │ │ └── model │ │ ├── MyModel.java │ │ └── MySecondModel.java ├── liferay-aui.tld ├── model-attribute-precedence.jsp ├── model-attribute.jsp └── view.jsp ├── LiferayTaglibResourceBundleReferenceContributorTest ├── Language.properties ├── edit.jsp ├── foo.properties ├── invalid.jsp ├── liferay-ui.tld └── view.jsp ├── LiferayTaglibSearchContainerJavaBeanReferenceContributorTest ├── com │ └── liferay │ │ └── ide │ │ └── model │ │ └── MyModel.java ├── liferay-ui.tld └── view.jsp ├── LiferayTaglibStrictQuoteEscapingInspectionTest ├── liferay-ui.tld ├── view.jsp └── view_fixed.jsp └── LiferayTaglibStringConcatInspectionTest ├── liferay-aui.tld ├── view.jsp └── view_fixed.jsp /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.ipr 3 | *.iws 4 | .classpath 5 | .gradle/ 6 | .idea/ 7 | .intellijPlatform 8 | .project 9 | .settings/ 10 | /bin/ 11 | /gradle/ 12 | /gradle/wrapper 13 | build/ 14 | out/ -------------------------------------------------------------------------------- /.sdkmanrc: -------------------------------------------------------------------------------- 1 | # Enable auto-env through the sdkman_auto_env config 2 | # Add key=value pairs of SDKs to use below 3 | java=21.0.6-zulu 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM azul/zulu-openjdk-alpine:21 2 | 3 | RUN apk update && apk add git 4 | RUN ["mkdir", "-p", "/root/.gradle/"] 5 | 6 | COPY . /liferay-intellij-plugin 7 | 8 | WORKDIR /liferay-intellij-plugin 9 | 10 | CMD ["./gradlew", "clean", "-x", "test", "publishPlugin"] -------------------------------------------------------------------------------- /copyright.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | bladeBuildOutputDir=build/resources/main/libs/ 2 | blade392DownloadURL=https://repository-cdn.liferay.com/nexus/content/repositories/public/com/liferay/blade/com.liferay.blade.cli/3.9.2/com.liferay.blade.cli-3.9.2.jar 3 | blade392MD5=08aedcb6bacc3166060d0032f9489dd1 4 | bladeLatestDownloadURL=https://repository.liferay.com/nexus/content/groups/public/com/liferay/blade/com.liferay.blade.cli/7.0.5-SNAPSHOT/com.liferay.blade.cli-7.0.5-20250507.185058-2.jar 5 | bladeLatestMD5=928e6ee45919007d36e68d8713a6da1c 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Apr 17 15:00:19 CST 2020 2 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip 3 | zipStoreBase=GRADLE_USER_HOME 4 | -------------------------------------------------------------------------------- /ignoredProblems.txt: -------------------------------------------------------------------------------- 1 | TemplateWordInPluginId,TemplateWordInPluginName -------------------------------------------------------------------------------- /libs/com.liferay.workspace.bundle.url.codec-1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/libs/com.liferay.workspace.bundle.url.codec-1.0.0.jar -------------------------------------------------------------------------------- /libs/gradle-tooling.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/libs/gradle-tooling.jar -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | dependencies { 3 | classpath group: "com.gradle", name: "gradle-enterprise-gradle-plugin", version: "3.12" 4 | } 5 | 6 | repositories { 7 | maven { 8 | url "https://plugins.gradle.org/m2/" 9 | } 10 | maven { 11 | url "https://repository-cdn.liferay.com/nexus/content/groups/public" 12 | } 13 | maven { 14 | url "https://oss.sonatype.org/content/repositories/snapshots/" 15 | } 16 | } 17 | } 18 | 19 | plugins { 20 | id "com.gradle.enterprise" version "3.12" 21 | } -------------------------------------------------------------------------------- /source-formatter-suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /source-formatter.properties: -------------------------------------------------------------------------------- 1 | checkstyle.chaining.check.allowedMethodNames=newConnector,stream 2 | run.outside.portal.excludes=**/liferay-intellij-plugin/** 3 | 4 | source.formatter.excludes=\ 5 | .github/workflows/*.yml,\ 6 | .intellijPlatform/**,\ 7 | out/**,\ 8 | src/main/resources/**,\ 9 | src/test/resources/**,\ 10 | testdata/** -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/BndFileType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd; 7 | 8 | import com.intellij.openapi.fileTypes.LanguageFileType; 9 | import com.intellij.openapi.vfs.VirtualFile; 10 | 11 | import com.liferay.ide.idea.core.LiferayIcons; 12 | 13 | import javax.swing.Icon; 14 | 15 | import org.jetbrains.annotations.NotNull; 16 | import org.jetbrains.annotations.Nullable; 17 | 18 | /** 19 | * @author Dominik Marks 20 | * @author Joye Luo 21 | */ 22 | public class BndFileType extends LanguageFileType { 23 | 24 | public static final LanguageFileType INSTANCE = new BndFileType(); 25 | 26 | public BndFileType() { 27 | super(BndLanguage.INSTANCE); 28 | } 29 | 30 | @Nullable 31 | @Override 32 | public String getCharset(@NotNull VirtualFile file, @NotNull byte[] content) { 33 | return null; 34 | } 35 | 36 | @NotNull 37 | @Override 38 | public String getDefaultExtension() { 39 | return "bnd"; 40 | } 41 | 42 | @NotNull 43 | @Override 44 | public String getDescription() { 45 | return "bnd file"; 46 | } 47 | 48 | @Nullable 49 | @Override 50 | public Icon getIcon() { 51 | return LiferayIcons.BND_ICON; 52 | } 53 | 54 | @NotNull 55 | @Override 56 | public String getName() { 57 | return "bnd file"; 58 | } 59 | 60 | @Override 61 | public boolean isReadOnly() { 62 | return false; 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/BndLanguage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd; 7 | 8 | import com.intellij.lang.Language; 9 | 10 | /** 11 | * @author Dominik Marks 12 | */ 13 | public class BndLanguage extends Language { 14 | 15 | public static final BndLanguage INSTANCE = new BndLanguage(); 16 | 17 | public BndLanguage() { 18 | super("bnd"); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/LiferayBndConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd; 7 | 8 | /** 9 | * @author Dominik Marks 10 | */ 11 | public class LiferayBndConstants { 12 | 13 | public static final String DYNAMIC_IMPORT_PACKAGE = "DynamicImport-Package"; 14 | 15 | public static final String JSP = "-jsp"; 16 | 17 | public static final String LIFERAY_CONFIGURATION_PATH = "Liferay-Configuration-Path"; 18 | 19 | public static final String LIFERAY_JS_CONFIG = "Liferay-JS-Config"; 20 | 21 | public static final String LIFERAY_MODULES_COMPAT_ADAPTERS = "Liferay-Modules-Compat-Adapters"; 22 | 23 | public static final String LIFERAY_RELENG_MODULE_GROUP_DESCRIPTION = "Liferay-Releng-Module-Group-Description"; 24 | 25 | public static final String LIFERAY_RELENG_MODULE_GROUP_TITLE = "Liferay-Releng-Module-Group-Title"; 26 | 27 | public static final String LIFERAY_REQUIRE_SCHEMA_VERSION = "Liferay-Require-SchemaVersion"; 28 | 29 | public static final String LIFERAY_SERVICE = "Liferay-Service"; 30 | 31 | public static final String LIFERAY_SERVICE_XML = "-liferay-service-xml"; 32 | 33 | public static final String PLUGIN_BUNDLE = "-plugin.bundle"; 34 | 35 | public static final String PLUGIN_JSP = "-plugin.jsp"; 36 | 37 | public static final String PLUGIN_NPM = "-plugin.npm"; 38 | 39 | public static final String PLUGIN_RESOURCEBUNDLE = "-plugin.resourcebundle"; 40 | 41 | public static final String PLUGIN_SASS = "-plugin.sass"; 42 | 43 | public static final String PLUGIN_SERVICE = "-plugin.service"; 44 | 45 | public static final String PLUGIN_SPRING = "-plugin.spring"; 46 | 47 | public static final String SASS = "-sass"; 48 | 49 | public static final String WEB_CONTEXT_PATH = "Web-ContextPath"; 50 | 51 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/commenter/BndCommenter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.commenter; 7 | 8 | import com.intellij.lang.Commenter; 9 | 10 | import org.jetbrains.annotations.Nullable; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | public class BndCommenter implements Commenter { 16 | 17 | @Nullable 18 | @Override 19 | public String getBlockCommentPrefix() { 20 | return null; 21 | } 22 | 23 | @Nullable 24 | @Override 25 | public String getBlockCommentSuffix() { 26 | return null; 27 | } 28 | 29 | @Nullable 30 | @Override 31 | public String getCommentedBlockCommentPrefix() { 32 | return null; 33 | } 34 | 35 | @Nullable 36 | @Override 37 | public String getCommentedBlockCommentSuffix() { 38 | return null; 39 | } 40 | 41 | @Nullable 42 | @Override 43 | public String getLineCommentPrefix() { 44 | return "#"; 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/completion/SimpleProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.completion; 7 | 8 | import com.intellij.codeInsight.completion.CompletionParameters; 9 | import com.intellij.codeInsight.completion.CompletionProvider; 10 | import com.intellij.codeInsight.completion.CompletionResultSet; 11 | import com.intellij.codeInsight.lookup.LookupElementBuilder; 12 | import com.intellij.util.ProcessingContext; 13 | 14 | import org.jetbrains.annotations.NotNull; 15 | 16 | /** 17 | * @author Charles Wu 18 | */ 19 | public class SimpleProvider extends CompletionProvider { 20 | 21 | public SimpleProvider(String... items) { 22 | _items = items; 23 | } 24 | 25 | @Override 26 | public void addCompletions( 27 | @NotNull CompletionParameters completionParameters, @NotNull ProcessingContext processingContext, 28 | @NotNull CompletionResultSet completeResultSet) { 29 | 30 | for (String item : _items) { 31 | completeResultSet.addElement( 32 | LookupElementBuilder.create( 33 | item 34 | ).withCaseSensitivity( 35 | false 36 | )); 37 | } 38 | } 39 | 40 | private final String[] _items; 41 | 42 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/parser/BndHeaderParsers.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.parser; 7 | 8 | import aQute.bnd.osgi.Constants; 9 | 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | /** 14 | * @author Dominik Marks 15 | */ 16 | public class BndHeaderParsers { 17 | 18 | public static final Map parsersMap = new HashMap() { 19 | { 20 | put(Constants.BUNDLE_ACTIVATOR, BundleActivatorParser.INSTANCE); 21 | put(Constants.BUNDLE_VERSION, BundleVersionParser.INSTANCE); 22 | put(Constants.CONDITIONAL_PACKAGE, BasePackageParser.INSTANCE); 23 | put(Constants.EXPORT_PACKAGE, ExportPackageParser.INSTANCE); 24 | put(Constants.IGNORE_PACKAGE, BasePackageParser.INSTANCE); 25 | put(Constants.IMPORT_PACKAGE, BasePackageParser.INSTANCE); 26 | put(Constants.PRIVATE_PACKAGE, BasePackageParser.INSTANCE); 27 | 28 | for (String header : BndHeaderParsersConstants.CLASS_REFERENCE_PROPERTIES) { 29 | put(header, ClassReferenceParser.INSTANCE); 30 | } 31 | 32 | for (String header : BndHeaderParsersConstants.FILE_REFERENCE_PROPERTIES) { 33 | put(header, FileReferenceParser.INSTANCE); 34 | } 35 | 36 | for (String header : BndHeaderParsersConstants.DEFAULT_HEADER_PROPERTIES) { 37 | put(header, BndHeaderParser.INSTANCE); 38 | } 39 | 40 | for (String header : Constants.headers) { 41 | if (!containsKey(header)) { 42 | put(header, BndHeaderParser.INSTANCE); 43 | } 44 | } 45 | 46 | for (String option : Constants.options) { 47 | if (!containsKey(option)) { 48 | put(option, BndHeaderParser.INSTANCE); 49 | } 50 | } 51 | } 52 | }; 53 | 54 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/parser/BndHeaderParsersConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.parser; 7 | 8 | import aQute.bnd.osgi.Constants; 9 | 10 | import com.liferay.ide.idea.bnd.LiferayBndConstants; 11 | 12 | /** 13 | * @author Dominik Marks 14 | * @author Simon Jiang 15 | */ 16 | public class BndHeaderParsersConstants { 17 | 18 | public static final String[] CLASS_REFERENCE_PROPERTIES = { 19 | LiferayBndConstants.PLUGIN_BUNDLE, LiferayBndConstants.PLUGIN_JSP, LiferayBndConstants.PLUGIN_NPM, 20 | LiferayBndConstants.PLUGIN_RESOURCEBUNDLE, LiferayBndConstants.PLUGIN_SASS, LiferayBndConstants.PLUGIN_SERVICE, 21 | LiferayBndConstants.PLUGIN_SPRING, Constants.TESTCASES 22 | }; 23 | 24 | public static final String[] DEFAULT_HEADER_PROPERTIES = { 25 | LiferayBndConstants.JSP, LiferayBndConstants.SASS, LiferayBndConstants.LIFERAY_SERVICE_XML, 26 | LiferayBndConstants.LIFERAY_RELENG_MODULE_GROUP_DESCRIPTION, 27 | LiferayBndConstants.LIFERAY_RELENG_MODULE_GROUP_TITLE, LiferayBndConstants.LIFERAY_REQUIRE_SCHEMA_VERSION, 28 | LiferayBndConstants.LIFERAY_SERVICE, LiferayBndConstants.DYNAMIC_IMPORT_PACKAGE, 29 | LiferayBndConstants.LIFERAY_MODULES_COMPAT_ADAPTERS, LiferayBndConstants.WEB_CONTEXT_PATH 30 | }; 31 | 32 | public static final String[] FILE_REFERENCE_PROPERTIES = { 33 | LiferayBndConstants.LIFERAY_JS_CONFIG, LiferayBndConstants.LIFERAY_CONFIGURATION_PATH 34 | }; 35 | 36 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/parser/BundleActivatorParser.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.parser; 7 | 8 | import com.intellij.lang.annotation.AnnotationHolder; 9 | import com.intellij.lang.annotation.HighlightSeverity; 10 | import com.intellij.psi.PsiClass; 11 | 12 | import com.liferay.ide.idea.bnd.psi.BndHeaderValuePart; 13 | import com.liferay.ide.idea.bnd.psi.util.BndPsiUtil; 14 | import com.liferay.ide.idea.util.LiferayAnnotationUtil; 15 | 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | /** 19 | * @author Dominik Marks 20 | */ 21 | public class BundleActivatorParser extends ClassReferenceParser { 22 | 23 | public static final BundleActivatorParser INSTANCE = new BundleActivatorParser(); 24 | 25 | @Override 26 | protected boolean checkClass( 27 | @NotNull BndHeaderValuePart bndHeaderValuePart, @NotNull PsiClass psiClass, 28 | @NotNull AnnotationHolder annotationHolder) { 29 | 30 | boolean result = super.checkClass(bndHeaderValuePart, psiClass, annotationHolder); 31 | 32 | PsiClass bundleActivatorClass = BndPsiUtil.getBundleActivatorClass(bndHeaderValuePart); 33 | 34 | if ((bundleActivatorClass != null) && !psiClass.isInheritor(bundleActivatorClass, true)) { 35 | LiferayAnnotationUtil.createAnnotation( 36 | annotationHolder, HighlightSeverity.ERROR, "Activator class does not inherit from BundleActivator", 37 | bndHeaderValuePart.getHighlightingRange()); 38 | 39 | return true; 40 | } 41 | 42 | return result; 43 | } 44 | 45 | private BundleActivatorParser() { 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/AssignmentExpression.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi; 7 | 8 | import com.intellij.psi.PsiNamedElement; 9 | 10 | /** 11 | * @author Charles Wu 12 | */ 13 | public interface AssignmentExpression extends PsiNamedElement { 14 | 15 | public BndHeaderValuePart getNameElement(); 16 | 17 | public String getValue(); 18 | 19 | public BndHeaderValuePart getValueElement(); 20 | 21 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/Attribute.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi; 7 | 8 | /** 9 | * @author Charles Wu 10 | */ 11 | public interface Attribute extends AssignmentExpression { 12 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/BndFile.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi; 7 | 8 | import com.intellij.psi.PsiFile; 9 | 10 | import java.util.List; 11 | 12 | import org.jetbrains.annotations.NotNull; 13 | import org.jetbrains.annotations.Nullable; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public interface BndFile extends PsiFile { 19 | 20 | /** 21 | * Returns the header from the main section with the given name, or null if no such header exists. 22 | */ 23 | @Nullable 24 | public BndHeader getHeader(@NotNull String name); 25 | 26 | /** 27 | * Returns all headers from the main section in this file. 28 | */ 29 | @NotNull 30 | public List getHeaders(); 31 | 32 | /** 33 | * Returns main (first) section if not empty. 34 | */ 35 | @Nullable 36 | public BndSection getMainSection(); 37 | 38 | /** 39 | * Returns all sections of the file. 40 | */ 41 | @NotNull 42 | public List getSections(); 43 | 44 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/BndHeader.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi; 7 | 8 | import com.intellij.psi.PsiNamedElement; 9 | 10 | import java.util.List; 11 | 12 | import org.jetbrains.annotations.NotNull; 13 | import org.jetbrains.annotations.Nullable; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public interface BndHeader extends PsiNamedElement { 19 | 20 | /** 21 | * Returns a first header value element if exists. 22 | */ 23 | @Nullable 24 | public BndHeaderValue getBndHeaderValue(); 25 | 26 | /** 27 | * Returns a list of all header value elements. 28 | */ 29 | @NotNull 30 | public List getBndHeaderValues(); 31 | 32 | @NotNull 33 | public BndToken getBndNameElement(); 34 | 35 | @NotNull 36 | @Override 37 | public String getName(); 38 | 39 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/BndHeaderValue.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi; 7 | 8 | import com.intellij.psi.PsiElement; 9 | 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | public interface BndHeaderValue extends PsiElement { 16 | 17 | /** 18 | * Returns the unwrapped text without the newlines and extra continuation spaces. 19 | */ 20 | @NotNull 21 | public String getUnwrappedText(); 22 | 23 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/BndHeaderValuePart.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi; 7 | 8 | import com.intellij.openapi.util.TextRange; 9 | 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | public interface BndHeaderValuePart extends BndHeaderValue { 16 | 17 | /** 18 | * Returns the range to highlight in the element. 19 | */ 20 | @NotNull 21 | public TextRange getHighlightingRange(); 22 | 23 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/BndSection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi; 7 | 8 | import com.intellij.psi.PsiElement; 9 | 10 | /** 11 | * @author Dominik Marks 12 | */ 13 | public interface BndSection extends PsiElement { 14 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/BndToken.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi; 7 | 8 | import com.intellij.psi.PsiElement; 9 | 10 | /** 11 | * @author Dominik Marks 12 | */ 13 | public interface BndToken extends PsiElement { 14 | 15 | public BndTokenType getTokenType(); 16 | 17 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/Clause.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi; 7 | 8 | import java.util.List; 9 | 10 | import org.jetbrains.annotations.NotNull; 11 | import org.jetbrains.annotations.Nullable; 12 | 13 | /** 14 | * @author Charles Wu 15 | */ 16 | public interface Clause extends BndHeaderValue { 17 | 18 | /** 19 | * Returns the attribute with the given name. 20 | */ 21 | @Nullable 22 | public Attribute getAttribute(@NotNull String name); 23 | 24 | /** 25 | * Returns all attributes of this clause. 26 | */ 27 | @NotNull 28 | public List getAttributes(); 29 | 30 | /** 31 | * Returns the directive with the given name. 32 | */ 33 | @Nullable 34 | public Directive getDirective(@NotNull String name); 35 | 36 | /** 37 | * Returns all directives of this clause. 38 | */ 39 | @NotNull 40 | public List getDirectives(); 41 | 42 | /** 43 | * Returns the value of this clause. 44 | */ 45 | @Nullable 46 | public BndHeaderValuePart getValue(); 47 | 48 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/Directive.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi; 7 | 8 | /** 9 | * @author Charles Wu 10 | */ 11 | public interface Directive extends AssignmentExpression { 12 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/impl/AttributeImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi.impl; 7 | 8 | import com.intellij.lang.ASTNode; 9 | 10 | import com.liferay.ide.idea.bnd.psi.Attribute; 11 | 12 | import org.jetbrains.annotations.NotNull; 13 | 14 | /** 15 | * @author Charles Wu 16 | */ 17 | public class AttributeImpl extends AbstractAssignmentExpression implements Attribute { 18 | 19 | public AttributeImpl(@NotNull ASTNode node) { 20 | super(node); 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return "Attribute:" + getName(); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/impl/BndSectionImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi.impl; 7 | 8 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 9 | import com.intellij.lang.ASTNode; 10 | 11 | import com.liferay.ide.idea.bnd.psi.BndSection; 12 | 13 | /** 14 | * @author Dominik Marks 15 | */ 16 | public class BndSectionImpl extends ASTWrapperPsiElement implements BndSection { 17 | 18 | public BndSectionImpl(ASTNode node) { 19 | super(node); 20 | } 21 | 22 | @Override 23 | public String toString() { 24 | return "BndSection"; 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/impl/BndTokenImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi.impl; 7 | 8 | import com.intellij.psi.impl.source.tree.LeafPsiElement; 9 | 10 | import com.liferay.ide.idea.bnd.psi.BndToken; 11 | import com.liferay.ide.idea.bnd.psi.BndTokenType; 12 | 13 | import org.jetbrains.annotations.NotNull; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public class BndTokenImpl extends LeafPsiElement implements BndToken { 19 | 20 | public BndTokenImpl(@NotNull BndTokenType type, CharSequence text) { 21 | super(type, text); 22 | } 23 | 24 | @Override 25 | public BndTokenType getTokenType() { 26 | return (BndTokenType)getElementType(); 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return "BndToken:" + getTokenType(); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/bnd/psi/impl/DirectiveImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.psi.impl; 7 | 8 | import com.intellij.lang.ASTNode; 9 | 10 | import com.liferay.ide.idea.bnd.psi.Directive; 11 | 12 | import org.jetbrains.annotations.NotNull; 13 | 14 | /** 15 | * @author Charles Wu 16 | */ 17 | public class DirectiveImpl extends AbstractAssignmentExpression implements Directive { 18 | 19 | public DirectiveImpl(@NotNull ASTNode node) { 20 | super(node); 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return "Directive:" + getName(); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/core/AbstractWorkspaceProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.core; 7 | 8 | import com.intellij.openapi.project.Project; 9 | import com.intellij.openapi.vfs.LocalFileSystem; 10 | import com.intellij.openapi.vfs.VirtualFile; 11 | 12 | import java.io.File; 13 | 14 | /** 15 | * @author Simon Jiang 16 | */ 17 | public abstract class AbstractWorkspaceProvider implements WorkspaceProvider { 18 | 19 | public AbstractWorkspaceProvider() { 20 | } 21 | 22 | public AbstractWorkspaceProvider(Project project) { 23 | this.project = project; 24 | } 25 | 26 | @Override 27 | public VirtualFile getModuleExtDirFile() { 28 | if (project == null) { 29 | return null; 30 | } 31 | 32 | String moduleExtDir = getWorkspaceProperty( 33 | WorkspaceConstants.EXT_DIR_PROPERTY, WorkspaceConstants.EXT_DIR_DEFAULT); 34 | 35 | File extDir = new File(project.getBasePath(), moduleExtDir); 36 | 37 | if (!extDir.isAbsolute()) { 38 | String projectBasePath = project.getBasePath(); 39 | 40 | if (projectBasePath == null) { 41 | return null; 42 | } 43 | 44 | extDir = new File(projectBasePath, moduleExtDir); 45 | } 46 | 47 | LocalFileSystem localFileSystem = LocalFileSystem.getInstance(); 48 | 49 | return localFileSystem.findFileByPath(extDir.getPath()); 50 | } 51 | 52 | protected Project project; 53 | 54 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/core/LiferayIcons.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.core; 7 | 8 | import com.intellij.openapi.util.IconLoader; 9 | 10 | import javax.swing.Icon; 11 | 12 | /** 13 | * @author Joye Luo 14 | */ 15 | public class LiferayIcons { 16 | 17 | public static final Icon BND_ICON = IconLoader.getIcon("/icons/bnd.png", LiferayIcons.class); 18 | 19 | public static final Icon LIFERAY_ICON = IconLoader.getIcon("/icons/liferay.svg", LiferayIcons.class); 20 | 21 | public static final Icon OSGI_ICON = IconLoader.getIcon("/icons/osgi.png", LiferayIcons.class); 22 | 23 | public static final Icon SPRING_ICON = IconLoader.getIcon( 24 | "/icons/portletMVC4Spring_16x16_new.png", LiferayIcons.class); 25 | 26 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/core/LiferayInspectionsConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.core; 7 | 8 | /** 9 | * @author Dominik Marks 10 | */ 11 | public class LiferayInspectionsConstants { 12 | 13 | public static final String JSP_GROUP_NAME = "JSP"; 14 | 15 | public static final String LIFERAY_GROUP_NAME = "Liferay"; 16 | 17 | public static final String SERVICE_XML_GROUP_NAME = "service.xml"; 18 | 19 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/core/MessagesBundle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.core; 7 | 8 | import com.intellij.AbstractBundle; 9 | 10 | import org.jetbrains.annotations.NotNull; 11 | import org.jetbrains.annotations.PropertyKey; 12 | 13 | /** 14 | * @author Charles Wu 15 | */ 16 | public class MessagesBundle extends AbstractBundle { 17 | 18 | public static final String MESSAGES = "messages.Messages"; 19 | 20 | public static String message( 21 | @NotNull @PropertyKey(resourceBundle = MESSAGES) String key, @NotNull Object... params) { 22 | 23 | return _bundle.getMessage(key, params); 24 | } 25 | 26 | public MessagesBundle() { 27 | super(MESSAGES); 28 | } 29 | 30 | private static final MessagesBundle _bundle = new MessagesBundle(); 31 | 32 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/core/ProductInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.core; 7 | 8 | import com.google.gson.annotations.SerializedName; 9 | 10 | /** 11 | * @author Simon Jiang 12 | */ 13 | public class ProductInfo { 14 | 15 | public String getAppServerTomcatVersion() { 16 | return _appServerTomcatVersion; 17 | } 18 | 19 | public String getBundleUrl() { 20 | return _bundleUrl; 21 | } 22 | 23 | public String getLiferayDockerImage() { 24 | return _liferayDockerImage; 25 | } 26 | 27 | public String getLiferayProductVersion() { 28 | return _liferayProductVersion; 29 | } 30 | 31 | public String getReleaseDate() { 32 | return _releaseDate; 33 | } 34 | 35 | public String getTargetPlatformVersion() { 36 | return _targetPlatformVersion; 37 | } 38 | 39 | public boolean isInitialVersion() { 40 | return _initialVersion; 41 | } 42 | 43 | @SerializedName("appServerTomcatVersion") 44 | private String _appServerTomcatVersion; 45 | 46 | @SerializedName("bundleUrl") 47 | private String _bundleUrl; 48 | 49 | @SerializedName("initialVersion") 50 | private boolean _initialVersion; 51 | 52 | @SerializedName("liferayDockerImage") 53 | private String _liferayDockerImage; 54 | 55 | @SerializedName("liferayProductVersion") 56 | private String _liferayProductVersion; 57 | 58 | @SerializedName("releaseDate") 59 | private String _releaseDate; 60 | 61 | @SerializedName("targetPlatformVersion") 62 | private String _targetPlatformVersion; 63 | 64 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/core/WorkspaceProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.core; 7 | 8 | import com.intellij.openapi.project.Project; 9 | import com.intellij.openapi.vfs.VirtualFile; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * @author Simon Jiang 15 | */ 16 | public interface WorkspaceProvider { 17 | 18 | public default boolean getIndexSources() { 19 | return false; 20 | } 21 | 22 | public String getLiferayHome(); 23 | 24 | public VirtualFile getModuleExtDirFile(); 25 | 26 | public default List getTargetPlatformDependencies() { 27 | return null; 28 | } 29 | 30 | public String getTargetPlatformVersion(); 31 | 32 | public String[] getWorkspaceModuleDirs(); 33 | 34 | public String getWorkspaceProperty(String key, String defaultValue); 35 | 36 | public String[] getWorkspaceWarDirs(); 37 | 38 | public boolean isFlexibleLiferayWorkspace(); 39 | 40 | public default boolean isGradleWorkspace() { 41 | return false; 42 | } 43 | 44 | public T provide(Project project, Class adapterType); 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/blade/LiferayBladePropertiesImplicitUsageProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.blade; 7 | 8 | import com.intellij.lang.properties.codeInspection.unused.ImplicitPropertyUsageProvider; 9 | import com.intellij.lang.properties.psi.Property; 10 | import com.intellij.psi.PsiFile; 11 | 12 | import org.jetbrains.annotations.NotNull; 13 | 14 | /** 15 | * @author Dominik Marks 16 | */ 17 | public class LiferayBladePropertiesImplicitUsageProvider implements ImplicitPropertyUsageProvider { 18 | 19 | @Override 20 | public boolean isUsed(@NotNull Property property) { 21 | PsiFile containingFile = property.getContainingFile(); 22 | 23 | String propertyKey = property.getKey(); 24 | 25 | if ((containingFile != null) && (propertyKey != null)) { 26 | String fileName = containingFile.getName(); 27 | 28 | return _BLADE_PROPERTIES.equals(fileName); 29 | } 30 | 31 | return false; 32 | } 33 | 34 | private static final String _BLADE_PROPERTIES = ".blade.properties"; 35 | 36 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/gradle/LiferayGradlePropertiesImplicitUsageProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.gradle; 7 | 8 | import com.intellij.lang.properties.codeInspection.unused.ImplicitPropertyUsageProvider; 9 | import com.intellij.lang.properties.psi.Property; 10 | import com.intellij.psi.PsiFile; 11 | 12 | import org.jetbrains.annotations.NotNull; 13 | 14 | /** 15 | * @author Dominik Marks 16 | */ 17 | public class LiferayGradlePropertiesImplicitUsageProvider implements ImplicitPropertyUsageProvider { 18 | 19 | @Override 20 | public boolean isUsed(@NotNull Property property) { 21 | PsiFile containingFile = property.getContainingFile(); 22 | 23 | String propertyKey = property.getKey(); 24 | 25 | if ((containingFile != null) && (propertyKey != null)) { 26 | String fileName = containingFile.getName(); 27 | 28 | if (_GRADLE_PROPERTIES.equals(fileName) || _GRADLE_LOCAL_PROPERTIES.equals(fileName)) { 29 | return propertyKey.startsWith(_LIFERAY_WORKSPACE_PREFIX); 30 | } 31 | } 32 | 33 | return false; 34 | } 35 | 36 | private static final String _GRADLE_LOCAL_PROPERTIES = "gradle-local.properties"; 37 | 38 | private static final String _GRADLE_PROPERTIES = "gradle.properties"; 39 | 40 | private static final String _LIFERAY_WORKSPACE_PREFIX = "liferay.workspace."; 41 | 42 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/jsp/LiferayJspDebuggerPositionManagerFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.jsp; 7 | 8 | import com.intellij.debugger.PositionManager; 9 | import com.intellij.debugger.PositionManagerFactory; 10 | import com.intellij.debugger.engine.DebugProcess; 11 | 12 | import org.jetbrains.annotations.NotNull; 13 | import org.jetbrains.annotations.Nullable; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public class LiferayJspDebuggerPositionManagerFactory extends PositionManagerFactory { 19 | 20 | @Nullable 21 | @Override 22 | public PositionManager createPositionManager(@NotNull DebugProcess debugProcess) { 23 | return new LiferayJspDebuggerPositionManager(debugProcess); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/resourcebundle/LiferayResourceBundlePropertiesImplicitUsageProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.resourcebundle; 7 | 8 | import com.intellij.lang.properties.codeInspection.unused.ImplicitPropertyUsageProvider; 9 | import com.intellij.lang.properties.psi.Property; 10 | import com.intellij.psi.PsiFile; 11 | 12 | import org.jetbrains.annotations.NotNull; 13 | 14 | /** 15 | * @author Dominik Marks 16 | */ 17 | public class LiferayResourceBundlePropertiesImplicitUsageProvider implements ImplicitPropertyUsageProvider { 18 | 19 | @Override 20 | public boolean isUsed(@NotNull Property property) { 21 | PsiFile containingFile = property.getContainingFile(); 22 | 23 | String propertyKey = property.getKey(); 24 | 25 | if ((containingFile != null) && (propertyKey != null)) { 26 | String fileName = containingFile.getName(); 27 | 28 | if (fileName.startsWith(_LANGUAGE_PROPERTY_FILE_PREFIX)) { 29 | for (String implicitPropertyPrefix : _IMPLICIT_PROPERTY_PREFIXES) { 30 | if (propertyKey.startsWith(implicitPropertyPrefix)) { 31 | return true; 32 | } 33 | } 34 | } 35 | } 36 | 37 | return false; 38 | } 39 | 40 | private static final String[] _IMPLICIT_PROPERTY_PREFIXES = { 41 | "action.", "category.", "javax.portlet.description.", "javax.portlet.long-title.", "javax.portlet.title.", 42 | "model.resource." 43 | }; 44 | 45 | private static final String _LANGUAGE_PROPERTY_FILE_PREFIX = "Language"; 46 | 47 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/resourcebundle/ResourceBundleReferenceContributor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.resourcebundle; 7 | 8 | import com.intellij.patterns.PlatformPatterns; 9 | import com.intellij.patterns.PsiElementPattern; 10 | import com.intellij.psi.PsiElement; 11 | import com.intellij.psi.PsiReferenceContributor; 12 | import com.intellij.psi.PsiReferenceRegistrar; 13 | import com.intellij.psi.filters.position.FilterPattern; 14 | 15 | import org.jetbrains.annotations.NotNull; 16 | 17 | /** 18 | * @author Dominik Marks 19 | */ 20 | public class ResourceBundleReferenceContributor extends PsiReferenceContributor { 21 | 22 | @Override 23 | public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) { 24 | PsiElementPattern.Capture psiElementCapture = PlatformPatterns.psiElement(PsiElement.class); 25 | 26 | registrar.registerReferenceProvider( 27 | psiElementCapture.and(new FilterPattern(new ResourceBundleReferenceElementFilter())), 28 | new ResourceBundleReferenceProvider()); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/resourcebundle/ResourceBundleReferenceProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.resourcebundle; 7 | 8 | import com.intellij.psi.PsiElement; 9 | import com.intellij.psi.PsiReference; 10 | import com.intellij.psi.PsiReferenceProvider; 11 | import com.intellij.util.ProcessingContext; 12 | 13 | import org.jetbrains.annotations.NotNull; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public class ResourceBundleReferenceProvider extends PsiReferenceProvider { 19 | 20 | @Override 21 | public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) { 22 | return new PsiReference[] {new CustomResourceBundleReference(element)}; 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateColumnInspection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.psi.xml.XmlAttributeValue; 9 | import com.intellij.psi.xml.XmlText; 10 | 11 | import org.jetbrains.annotations.Nls; 12 | import org.jetbrains.annotations.NotNull; 13 | import org.jetbrains.annotations.Nullable; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public class LiferayServiceXMLDuplicateColumnInspection extends AbstractLiferayServiceXMLDuplicateEntryInspection { 19 | 20 | @Nls 21 | @NotNull 22 | @Override 23 | public String getDisplayName() { 24 | return "check for duplicate column names entries"; 25 | } 26 | 27 | @Nullable 28 | @Override 29 | public String getStaticDescription() { 30 | return "Check for duplicate column names for entities in service.xml."; 31 | } 32 | 33 | @Override 34 | protected boolean isSuitableXmlAttributeValue(XmlAttributeValue xmlAttributeValue) { 35 | return LiferayServiceXMLUtil.isColumnNameAttribute(xmlAttributeValue); 36 | } 37 | 38 | @Override 39 | protected boolean isSuitableXmlText(XmlText xmlText) { 40 | return false; 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateEntityInspection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.psi.xml.XmlAttributeValue; 9 | import com.intellij.psi.xml.XmlText; 10 | 11 | import org.jetbrains.annotations.Nls; 12 | import org.jetbrains.annotations.NotNull; 13 | import org.jetbrains.annotations.Nullable; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public class LiferayServiceXMLDuplicateEntityInspection extends AbstractLiferayServiceXMLDuplicateEntryInspection { 19 | 20 | @Nls 21 | @NotNull 22 | @Override 23 | public String getDisplayName() { 24 | return "check for duplicate entities"; 25 | } 26 | 27 | @Nullable 28 | @Override 29 | public String getStaticDescription() { 30 | return "Check for duplicate entities in service.xml."; 31 | } 32 | 33 | @Override 34 | protected boolean isSuitableXmlAttributeValue(XmlAttributeValue xmlAttributeValue) { 35 | return LiferayServiceXMLUtil.isEntityNameAttribute(xmlAttributeValue); 36 | } 37 | 38 | @Override 39 | protected boolean isSuitableXmlText(XmlText xmlText) { 40 | return false; 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateExceptionInspection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.psi.xml.XmlAttributeValue; 9 | import com.intellij.psi.xml.XmlText; 10 | 11 | import org.jetbrains.annotations.Nls; 12 | import org.jetbrains.annotations.NotNull; 13 | import org.jetbrains.annotations.Nullable; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public class LiferayServiceXMLDuplicateExceptionInspection extends AbstractLiferayServiceXMLDuplicateEntryInspection { 19 | 20 | @Nls 21 | @NotNull 22 | @Override 23 | public String getDisplayName() { 24 | return "check for duplicate exception entries"; 25 | } 26 | 27 | @Nullable 28 | @Override 29 | public String getStaticDescription() { 30 | return "Check for duplicate exception entries in service.xml."; 31 | } 32 | 33 | @Override 34 | protected boolean isSuitableXmlAttributeValue(XmlAttributeValue xmlAttributeValue) { 35 | return false; 36 | } 37 | 38 | @Override 39 | protected boolean isSuitableXmlText(XmlText xmlText) { 40 | return LiferayServiceXMLUtil.isExceptionTag(xmlText); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateFinderInspection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.psi.xml.XmlAttributeValue; 9 | import com.intellij.psi.xml.XmlText; 10 | 11 | import org.jetbrains.annotations.Nls; 12 | import org.jetbrains.annotations.NotNull; 13 | import org.jetbrains.annotations.Nullable; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public class LiferayServiceXMLDuplicateFinderInspection extends AbstractLiferayServiceXMLDuplicateEntryInspection { 19 | 20 | @Nls 21 | @NotNull 22 | @Override 23 | public String getDisplayName() { 24 | return "check for duplicate finders"; 25 | } 26 | 27 | @Nullable 28 | @Override 29 | public String getStaticDescription() { 30 | return "Check for duplicate finders for entities in service.xml."; 31 | } 32 | 33 | @Override 34 | protected boolean isSuitableXmlAttributeValue(XmlAttributeValue xmlAttributeValue) { 35 | return LiferayServiceXMLUtil.isFinderNameAttribute(xmlAttributeValue); 36 | } 37 | 38 | @Override 39 | protected boolean isSuitableXmlText(XmlText xmlText) { 40 | return false; 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/service/LiferayServiceXMLInspectionToolProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.codeInspection.InspectionToolProvider; 9 | 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | @SuppressWarnings("unchecked") 16 | public class LiferayServiceXMLInspectionToolProvider implements InspectionToolProvider { 17 | 18 | @NotNull 19 | @Override 20 | public Class[] getInspectionClasses() { 21 | return new Class[] { 22 | LiferayServiceXMLPrimaryKeyColumnInspection.class, LiferayServiceXMLNamespaceInspection.class, 23 | LiferayServiceXMLExceptionNameInspection.class, LiferayServiceXMLEntityUuidInspection.class, 24 | LiferayServiceXMLDuplicateColumnInspection.class, LiferayServiceXMLDuplicateEntityInspection.class, 25 | LiferayServiceXMLDuplicateExceptionInspection.class, LiferayServiceXMLDuplicateFinderInspection.class 26 | }; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/tag/AbstractLiferayTaglibJavaBeanReferenceProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.tag; 7 | 8 | import com.intellij.psi.ElementManipulators; 9 | import com.intellij.psi.PsiClass; 10 | import com.intellij.psi.PsiElement; 11 | import com.intellij.psi.PsiManager; 12 | import com.intellij.psi.PsiReference; 13 | import com.intellij.psi.PsiReferenceProvider; 14 | import com.intellij.psi.util.ClassUtil; 15 | import com.intellij.psi.xml.XmlAttributeValue; 16 | import com.intellij.util.ProcessingContext; 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | import org.jetbrains.annotations.NotNull; 22 | import org.jetbrains.annotations.Nullable; 23 | 24 | /** 25 | * @author Dominik Marks 26 | */ 27 | public abstract class AbstractLiferayTaglibJavaBeanReferenceProvider extends PsiReferenceProvider { 28 | 29 | @NotNull 30 | @Override 31 | public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) { 32 | List psiReferences = new ArrayList<>(); 33 | 34 | String className = getClassName(element); 35 | 36 | if (className != null) { 37 | PsiManager psiManager = PsiManager.getInstance(element.getProject()); 38 | 39 | PsiClass psiClass = ClassUtil.findPsiClass(psiManager, className); 40 | 41 | if (psiClass != null) { 42 | psiReferences.add( 43 | new LiferayTaglibJavaBeanReference( 44 | (XmlAttributeValue)element, ElementManipulators.getValueTextRange(element), psiClass)); 45 | } 46 | } 47 | 48 | return psiReferences.toArray(new PsiReference[0]); 49 | } 50 | 51 | @Nullable 52 | protected abstract String getClassName(PsiElement psiElement); 53 | 54 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/tag/BooleanCompletionProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.tag; 7 | 8 | import com.intellij.codeInsight.completion.CompletionParameters; 9 | import com.intellij.codeInsight.completion.CompletionProvider; 10 | import com.intellij.codeInsight.completion.CompletionResultSet; 11 | import com.intellij.util.ProcessingContext; 12 | 13 | import org.jetbrains.annotations.NotNull; 14 | 15 | /** 16 | * @author Terry Jia 17 | */ 18 | public class BooleanCompletionProvider extends CompletionProvider { 19 | 20 | @Override 21 | protected void addCompletions( 22 | @NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet result) { 23 | 24 | result.addElement(LiferayLookupElementBuilderFactory.create("true", "boolean")); 25 | result.addElement(LiferayLookupElementBuilderFactory.create("false", "boolean")); 26 | 27 | result.stopHere(); 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/tag/LiferayLookupElementBuilderFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.tag; 7 | 8 | import com.intellij.codeInsight.lookup.LookupElementBuilder; 9 | 10 | import com.liferay.ide.idea.core.LiferayIcons; 11 | 12 | /** 13 | * @author Terry Jia 14 | */ 15 | public class LiferayLookupElementBuilderFactory { 16 | 17 | public static LookupElementBuilder create(String value, String type) { 18 | return LookupElementBuilder.create( 19 | value 20 | ).withTypeText( 21 | type 22 | ).withIcon( 23 | LiferayIcons.LIFERAY_ICON 24 | ); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/tag/LiferayTaglibInspectionToolProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.tag; 7 | 8 | import com.intellij.codeInspection.InspectionToolProvider; 9 | 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | @SuppressWarnings("unchecked") 16 | public class LiferayTaglibInspectionToolProvider implements InspectionToolProvider { 17 | 18 | @NotNull 19 | @Override 20 | public Class[] getInspectionClasses() { 21 | return new Class[] { 22 | LiferayTaglibStrictQuoteEscapingInspection.class, LiferayTaglibStringConcatInspection.class 23 | }; 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/tag/LiferayTaglibResourceBundleReferenceProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.tag; 7 | 8 | import com.intellij.lang.properties.PropertiesReferenceProvider; 9 | import com.intellij.lang.properties.references.PropertyReference; 10 | import com.intellij.psi.PsiElement; 11 | import com.intellij.psi.PsiReference; 12 | import com.intellij.util.ProcessingContext; 13 | 14 | import org.jetbrains.annotations.NotNull; 15 | 16 | /** 17 | * @author Dominik Marks 18 | */ 19 | public class LiferayTaglibResourceBundleReferenceProvider extends PropertiesReferenceProvider { 20 | 21 | public LiferayTaglibResourceBundleReferenceProvider(boolean defaultSoft) { 22 | super(defaultSoft); 23 | } 24 | 25 | @NotNull 26 | @Override 27 | public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) { 28 | PsiReference[] referencesByElement = super.getReferencesByElement(element, context); 29 | 30 | if (referencesByElement.length == 1) { 31 | PsiReference psiReference = referencesByElement[0]; 32 | 33 | if (psiReference instanceof PropertyReference) { 34 | PropertyReference propertyReference = (PropertyReference)psiReference; 35 | 36 | String canonicalText = propertyReference.getCanonicalText(); 37 | PsiElement psiElement = propertyReference.getElement(); 38 | boolean soft = propertyReference.isSoft(); 39 | 40 | return new PsiReference[] { 41 | new LiferayTaglibResourceBundlePropertyReference(canonicalText, psiElement, null, soft) 42 | }; 43 | } 44 | } 45 | 46 | return referencesByElement; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/tag/LiferayTaglibSearchContainerJavaBeanReferenceProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.tag; 7 | 8 | import com.intellij.psi.PsiElement; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import com.intellij.psi.xml.XmlTag; 11 | 12 | import java.util.Objects; 13 | 14 | import org.jetbrains.annotations.Nullable; 15 | 16 | /** 17 | * @author Dominik Marks 18 | */ 19 | public class LiferayTaglibSearchContainerJavaBeanReferenceProvider 20 | extends AbstractLiferayTaglibJavaBeanReferenceProvider { 21 | 22 | @Nullable 23 | @Override 24 | protected String getClassName(PsiElement element) { 25 | PsiElement classNamePsiElement = PsiTreeUtil.findFirstParent( 26 | element, 27 | psiElement -> { 28 | if (psiElement instanceof XmlTag) { 29 | XmlTag xmlTag = (XmlTag)psiElement; 30 | 31 | if (LiferayTaglibs.TAGLIB_URI_LIFERAY_UI.equals(xmlTag.getNamespace())) { 32 | return Objects.equals(xmlTag.getLocalName(), "search-container-row"); 33 | } 34 | } 35 | 36 | return false; 37 | }); 38 | 39 | if (classNamePsiElement != null) { 40 | XmlTag xmlTag = (XmlTag)classNamePsiElement; 41 | 42 | return xmlTag.getAttributeValue("className"); 43 | } 44 | 45 | return null; 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/language/tag/StringCompletionProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.tag; 7 | 8 | import com.intellij.codeInsight.completion.CompletionParameters; 9 | import com.intellij.codeInsight.completion.CompletionProvider; 10 | import com.intellij.codeInsight.completion.CompletionResultSet; 11 | import com.intellij.util.ProcessingContext; 12 | 13 | import java.util.stream.Stream; 14 | 15 | import org.jetbrains.annotations.NotNull; 16 | 17 | /** 18 | * @author Terry Jia 19 | */ 20 | public class StringCompletionProvider extends CompletionProvider { 21 | 22 | public StringCompletionProvider(String[] strings) { 23 | _strings = strings; 24 | } 25 | 26 | @Override 27 | protected void addCompletions( 28 | @NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet result) { 29 | 30 | Stream.of( 31 | _strings 32 | ).map( 33 | s -> LiferayLookupElementBuilderFactory.create(s, "String") 34 | ).forEach( 35 | result::addElement 36 | ); 37 | 38 | result.stopHere(); 39 | } 40 | 41 | private final String[] _strings; 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/server/LiferayDockerServerConfigurationType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.server; 7 | 8 | import com.intellij.execution.configurations.ConfigurationFactory; 9 | import com.intellij.execution.configurations.ConfigurationType; 10 | import com.intellij.execution.configurations.ConfigurationTypeBase; 11 | import com.intellij.execution.configurations.RunConfiguration; 12 | import com.intellij.openapi.project.Project; 13 | 14 | import com.liferay.ide.idea.core.LiferayIcons; 15 | 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | /** 19 | * @author Simon jiang 20 | */ 21 | public class LiferayDockerServerConfigurationType extends ConfigurationTypeBase implements ConfigurationType { 22 | 23 | public static String id = "LiferayDockerServerConfiguration"; 24 | 25 | public LiferayDockerServerConfigurationType() { 26 | super(id, "Liferay Docker Server", "Run or Debug a Liferay Docker Server", LiferayIcons.LIFERAY_ICON); 27 | 28 | addFactory( 29 | new ConfigurationFactory(this) { 30 | 31 | @NotNull 32 | @Override 33 | public RunConfiguration createTemplateConfiguration(@NotNull Project project) { 34 | LiferayDockerServerConfiguration dockerServerConfiguration = new LiferayDockerServerConfiguration( 35 | project, this, "Liferay Docker"); 36 | 37 | dockerServerConfiguration.setAllowRunningInParallel(false); 38 | 39 | return dockerServerConfiguration; 40 | } 41 | 42 | @NotNull 43 | @Override 44 | public String getId() { 45 | return super.getName(); 46 | } 47 | 48 | }); 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/server/LiferayServerConfigurationType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.server; 7 | 8 | import com.intellij.execution.configurations.ConfigurationFactory; 9 | import com.intellij.execution.configurations.ConfigurationType; 10 | import com.intellij.execution.configurations.ConfigurationTypeBase; 11 | import com.intellij.execution.configurations.RunConfiguration; 12 | import com.intellij.openapi.project.Project; 13 | 14 | import com.liferay.ide.idea.core.LiferayIcons; 15 | 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | /** 19 | * @author Terry Jia 20 | */ 21 | public class LiferayServerConfigurationType extends ConfigurationTypeBase implements ConfigurationType { 22 | 23 | public static String id = "LiferayServerConfiguration"; 24 | 25 | public LiferayServerConfigurationType() { 26 | super(id, "Liferay Server", "Run or Debug a Liferay Server", LiferayIcons.LIFERAY_ICON); 27 | 28 | addFactory( 29 | new ConfigurationFactory(this) { 30 | 31 | @NotNull 32 | @Override 33 | public RunConfiguration createTemplateConfiguration(@NotNull Project project) { 34 | return new LiferayServerConfiguration(project, this, ""); 35 | } 36 | 37 | @NotNull 38 | @Override 39 | public String getId() { 40 | return super.getName(); 41 | } 42 | 43 | }); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/server/portal/AbstractPortalBundle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.server.portal; 7 | 8 | import com.liferay.ide.idea.util.FileUtil; 9 | 10 | import java.nio.file.Path; 11 | 12 | /** 13 | * @author Simon Jiang 14 | */ 15 | public abstract class AbstractPortalBundle implements PortalBundle { 16 | 17 | public AbstractPortalBundle(Path path) { 18 | if (path == null) { 19 | throw new IllegalArgumentException("path cannot be null"); 20 | } 21 | 22 | bundlePath = path; 23 | 24 | liferayHome = FileUtil.pathAppend(bundlePath, ".."); 25 | 26 | autoDeployPath = FileUtil.pathAppend(liferayHome, "deploy"); 27 | 28 | modulesPath = FileUtil.pathAppend(liferayHome, "osgi"); 29 | } 30 | 31 | @Override 32 | public Path getAppServerDir() { 33 | return bundlePath; 34 | } 35 | 36 | @Override 37 | public Path getLiferayHome() { 38 | return liferayHome; 39 | } 40 | 41 | protected Path autoDeployPath; 42 | protected Path bundlePath; 43 | protected Path liferayHome; 44 | protected Path modulesPath; 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/server/portal/AbstractPortalBundleFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.server.portal; 7 | 8 | import com.liferay.ide.idea.util.FileUtil; 9 | 10 | import java.io.File; 11 | 12 | import java.nio.file.Path; 13 | import java.nio.file.Paths; 14 | 15 | /** 16 | * @author Simon Jiang 17 | */ 18 | public abstract class AbstractPortalBundleFactory implements PortalBundleFactory { 19 | 20 | @Override 21 | public Path findAppServerPath(Path location) { 22 | Path retval = null; 23 | 24 | if (detectAppServerPath(location) && _detectLiferayHome(FileUtil.pathAppend(location, ".."))) { 25 | retval = location; 26 | } 27 | else if (_detectLiferayHome(location)) { 28 | File[] directories = FileUtil.getDirectories(location.toFile()); 29 | 30 | for (File directory : directories) { 31 | Path dirPath = Paths.get(directory.getAbsolutePath()); 32 | 33 | if (detectAppServerPath(dirPath)) { 34 | retval = dirPath; 35 | 36 | break; 37 | } 38 | } 39 | } 40 | 41 | return retval; 42 | } 43 | 44 | protected abstract boolean detectAppServerPath(Path path); 45 | 46 | private boolean _detectLiferayHome(Path path) { 47 | if (FileUtil.notExists(path)) { 48 | return false; 49 | } 50 | 51 | Path osgiPath = Paths.get(path.toString(), "osgi"); 52 | 53 | if (FileUtil.exists(osgiPath)) { 54 | return true; 55 | } 56 | 57 | return false; 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/server/portal/PortalBundle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.server.portal; 7 | 8 | import com.intellij.openapi.projectRoots.Sdk; 9 | 10 | import java.nio.file.Path; 11 | 12 | /** 13 | * @author Simon Jiang 14 | */ 15 | public interface PortalBundle { 16 | 17 | public Path getAppServerDir(); 18 | 19 | public String getDisplayName(); 20 | 21 | public Path getLiferayHome(); 22 | 23 | public String getMainClass(); 24 | 25 | public Path[] getRuntimeClasspath(); 26 | 27 | public String[] getRuntimeStartProgArgs(); 28 | 29 | public String[] getRuntimeStartVMArgs(Sdk sdk); 30 | 31 | public String getType(); 32 | 33 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/server/portal/PortalBundleFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.server.portal; 7 | 8 | import java.nio.file.Path; 9 | 10 | /** 11 | * @author Simon Jiang 12 | */ 13 | public interface PortalBundleFactory { 14 | 15 | public PortalBundle create(Path location); 16 | 17 | public Path findAppServerPath(Path location); 18 | 19 | public String getType(); 20 | 21 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/server/portal/PortalJBossBundleFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.server.portal; 7 | 8 | import com.liferay.ide.idea.util.FileUtil; 9 | import com.liferay.ide.idea.util.JavaUtil; 10 | 11 | import java.io.File; 12 | 13 | import java.nio.file.Path; 14 | 15 | /** 16 | * @author Seiphon Wang 17 | */ 18 | public class PortalJBossBundleFactory extends AbstractPortalBundleFactory { 19 | 20 | @Override 21 | public PortalBundle create(Path location) { 22 | return new PortalJBossBundle(location); 23 | } 24 | 25 | @Override 26 | public String getType() { 27 | return "jboss"; 28 | } 29 | 30 | @Override 31 | protected boolean detectAppServerPath(Path path) { 32 | if (FileUtil.notExists(path)) { 33 | return false; 34 | } 35 | 36 | Path bundlesPath = FileUtil.pathAppend(path, "bundles"); 37 | Path modulesPath = FileUtil.pathAppend(path, "modules"); 38 | Path standalonePath = FileUtil.pathAppend(path, "standalone"); 39 | Path binPath = FileUtil.pathAppend(path, "bin"); 40 | 41 | if (FileUtil.exists(bundlesPath) && FileUtil.exists(modulesPath) && FileUtil.exists(standalonePath) && 42 | FileUtil.exists(binPath)) { 43 | 44 | File mainFolder = new File("modules/org/jboss/as/server/main"); 45 | 46 | Path mainFolderPath = mainFolder.toPath(); 47 | 48 | return JavaUtil.scanFolderJarsForManifestProp( 49 | path.toFile(), mainFolderPath.toString(), _JBAS7_RELEASE_VERSION, "7."); 50 | } 51 | 52 | return false; 53 | } 54 | 55 | private static final String _JBAS7_RELEASE_VERSION = "JBossAS-Release-Version"; 56 | 57 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/server/portal/PortalTomcatBundleFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.server.portal; 7 | 8 | import com.liferay.ide.idea.util.FileUtil; 9 | 10 | import java.nio.file.Path; 11 | 12 | /** 13 | * @author Simon Jiang 14 | */ 15 | public class PortalTomcatBundleFactory extends AbstractPortalBundleFactory { 16 | 17 | @Override 18 | public PortalBundle create(Path location) { 19 | return new PortalTomcatBundle(location); 20 | } 21 | 22 | @Override 23 | public String getType() { 24 | return "tomcat"; 25 | } 26 | 27 | @Override 28 | protected boolean detectAppServerPath(Path path) { 29 | if (FileUtil.notExists(path)) { 30 | return false; 31 | } 32 | 33 | Path binPath = FileUtil.pathAppend(path, "bin"); 34 | Path confPath = FileUtil.pathAppend(path, "conf"); 35 | Path libPath = FileUtil.pathAppend(path, "lib"); 36 | Path webappPath = FileUtil.pathAppend(path, "webapps"); 37 | 38 | if (FileUtil.exists(binPath) && FileUtil.exists(confPath) && FileUtil.exists(libPath) && 39 | FileUtil.exists(webappPath)) { 40 | 41 | return true; 42 | } 43 | 44 | return false; 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/actions/BuildServiceMavenModuleAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.actions; 7 | 8 | import com.intellij.openapi.actionSystem.AnActionEvent; 9 | 10 | import com.liferay.ide.idea.core.LiferayIcons; 11 | import com.liferay.ide.idea.util.ListUtil; 12 | 13 | import java.util.Arrays; 14 | 15 | /** 16 | * @author Ethan Sun 17 | */ 18 | public class BuildServiceMavenModuleAction extends AbstractLiferayMavenGoalAction { 19 | 20 | public BuildServiceMavenModuleAction() { 21 | super("BuildService", "Run buildService goal", LiferayIcons.LIFERAY_ICON); 22 | 23 | goals = Arrays.asList("service-builder:build"); 24 | } 25 | 26 | @Override 27 | protected boolean isEnabledAndVisible(AnActionEvent anActionEvent) { 28 | if (super.isEnabledAndVisible(anActionEvent)) { 29 | return ListUtil.isNotEmpty(getServiceBuilderModules(anActionEvent)); 30 | } 31 | 32 | return false; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/actions/DeployGradleModuleAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.actions; 7 | 8 | import com.intellij.openapi.actionSystem.AnActionEvent; 9 | 10 | import com.liferay.ide.idea.core.LiferayIcons; 11 | 12 | /** 13 | * @author Andy Wu 14 | * @author Simon Jiang 15 | */ 16 | public class DeployGradleModuleAction extends AbstractLiferayGradleTaskAction { 17 | 18 | public DeployGradleModuleAction() { 19 | super("Deploy", "Run deploy task", LiferayIcons.LIFERAY_ICON, "deploy"); 20 | } 21 | 22 | @Override 23 | protected boolean isEnabledAndVisible(AnActionEvent anActionEvent) { 24 | if (super.isEnabledAndVisible(anActionEvent)) { 25 | return verifyModuleDeploy(anActionEvent); 26 | } 27 | 28 | return false; 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/actions/DeployMavenModuleAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.actions; 7 | 8 | import com.intellij.openapi.actionSystem.AnActionEvent; 9 | 10 | import com.liferay.ide.idea.core.LiferayIcons; 11 | 12 | import java.util.Arrays; 13 | 14 | /** 15 | * @author Joye Luo 16 | */ 17 | public class DeployMavenModuleAction extends AbstractLiferayMavenGoalAction { 18 | 19 | public DeployMavenModuleAction() { 20 | super("Deploy", "Run deploy goal", LiferayIcons.LIFERAY_ICON); 21 | 22 | goals = Arrays.asList("clean", "package", "bundle-support:deploy"); 23 | } 24 | 25 | @Override 26 | protected boolean isEnabledAndVisible(AnActionEvent anActionEvent) { 27 | if (super.isEnabledAndVisible(anActionEvent)) { 28 | return verifyModuleDeploy(anActionEvent); 29 | } 30 | 31 | return false; 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/actions/LiferayActionGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.actions; 7 | 8 | import com.intellij.ide.actions.NonTrivialActionGroup; 9 | import com.intellij.openapi.actionSystem.AnAction; 10 | import com.intellij.openapi.actionSystem.AnActionEvent; 11 | import com.intellij.openapi.actionSystem.Presentation; 12 | 13 | import java.util.List; 14 | import java.util.stream.Stream; 15 | 16 | import org.jetbrains.annotations.NotNull; 17 | import org.jetbrains.annotations.Unmodifiable; 18 | 19 | /** 20 | * @author Andy Wu 21 | */ 22 | public class LiferayActionGroup extends NonTrivialActionGroup { 23 | 24 | @Override 25 | public boolean isDumbAware() { 26 | return false; 27 | } 28 | 29 | @NotNull 30 | @Override 31 | @Unmodifiable 32 | public List postProcessVisibleChildren( 33 | AnActionEvent event, List visibleChildren) { 34 | 35 | Presentation presentation = event.getPresentation(); 36 | 37 | Stream stream = visibleChildren.stream(); 38 | 39 | presentation.setEnabled( 40 | stream.filter( 41 | action -> action instanceof AbstractLiferayAction 42 | ).map( 43 | action -> (AbstractLiferayAction)action 44 | ).anyMatch( 45 | action -> action.isEnabledAndVisible(event) 46 | )); 47 | 48 | return super.postProcessVisibleChildren(event, visibleChildren); 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/compoments/FixedSizeRefreshButton.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.compoments; 7 | 8 | import com.intellij.icons.AllIcons; 9 | import com.intellij.openapi.ui.FixedSizeButton; 10 | import com.intellij.util.ui.JBUI; 11 | import com.intellij.util.ui.UIUtil; 12 | 13 | import javax.swing.Icon; 14 | import javax.swing.JComponent; 15 | import javax.swing.UIDefaults; 16 | import javax.swing.UIManager; 17 | 18 | /** 19 | * @author Charle Wu 20 | */ 21 | @SuppressWarnings("serial") 22 | public class FixedSizeRefreshButton extends FixedSizeButton { 23 | 24 | public FixedSizeRefreshButton() { 25 | this(-1, null); 26 | } 27 | 28 | public FixedSizeRefreshButton(int size, JComponent component) { 29 | Icon icon = AllIcons.Actions.Refresh; 30 | 31 | if (icon != null) { 32 | setIcon(icon); 33 | } 34 | 35 | setAttachedComponent(component); 36 | setDefaultCapable(false); 37 | setFocusable(false); 38 | setMargin(JBUI.emptyInsets()); 39 | setSize(size); 40 | 41 | if (UIUtil.isUnderIntelliJLaF() || _isDarkTheme()) { 42 | putClientProperty("JButton.buttonType", "square"); 43 | } 44 | } 45 | 46 | private final boolean _isDarkTheme() { 47 | UIDefaults lookAndFeelDefaults = UIManager.getLookAndFeelDefaults(); 48 | 49 | if ((lookAndFeelDefaults == null) || lookAndFeelDefaults.getBoolean("ui.theme.is.dark")) { 50 | return true; 51 | } 52 | 53 | return false; 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/modules/LiferayMavenWorkspaceBuilder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.modules; 7 | 8 | import com.intellij.ide.util.projectWizard.ModuleBuilderListener; 9 | import com.intellij.openapi.module.Module; 10 | import com.intellij.openapi.project.Project; 11 | import com.intellij.openapi.roots.ModifiableRootModel; 12 | 13 | import icons.OpenapiIcons; 14 | 15 | import javax.swing.Icon; 16 | 17 | import org.jetbrains.annotations.NotNull; 18 | import org.jetbrains.idea.maven.project.MavenProjectsManager; 19 | 20 | /** 21 | * @author Joye Luo 22 | * @author Simon Jiang 23 | */ 24 | public class LiferayMavenWorkspaceBuilder extends LiferayWorkspaceBuilder { 25 | 26 | public LiferayMavenWorkspaceBuilder() { 27 | super(LiferayProjectType.LIFERAY_MAVEN_WORKSPACE); 28 | 29 | addListener( 30 | new ModuleBuilderListener() { 31 | 32 | @Override 33 | public void moduleCreated(@NotNull Module module) { 34 | Project mavenProject = module.getProject(); 35 | 36 | MavenProjectsManager mavenProjectsManager = MavenProjectsManager.getInstance(mavenProject); 37 | 38 | mavenProjectsManager.forceUpdateAllProjectsOrFindAllAvailablePomFiles(); 39 | 40 | removeListener(this); 41 | } 42 | 43 | }); 44 | } 45 | 46 | @Override 47 | public Icon getNodeIcon() { 48 | return OpenapiIcons.RepositoryLibraryLogo; 49 | } 50 | 51 | @Override 52 | public void setupRootModel(ModifiableRootModel modifiableRootModel) { 53 | initWorkspace(modifiableRootModel.getProject()); 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/modules/LiferayModuleTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.modules; 7 | 8 | import com.intellij.ide.util.projectWizard.ModuleBuilder; 9 | import com.intellij.platform.templates.BuilderBasedTemplate; 10 | 11 | import org.jetbrains.annotations.NotNull; 12 | import org.jetbrains.annotations.Nullable; 13 | 14 | /** 15 | * @author Joye Luo 16 | */ 17 | public class LiferayModuleTemplate extends BuilderBasedTemplate { 18 | 19 | public LiferayModuleTemplate(String name, String description, ModuleBuilder builder) { 20 | super(builder); 21 | 22 | _name = name; 23 | _description = description; 24 | } 25 | 26 | @Nullable 27 | @Override 28 | public String getDescription() { 29 | return _description; 30 | } 31 | 32 | @NotNull 33 | @Override 34 | public String getName() { 35 | return _name; 36 | } 37 | 38 | private final String _description; 39 | private final String _name; 40 | 41 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/modules/LiferayProjectType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.modules; 7 | 8 | /** 9 | * @author Joye Luo 10 | */ 11 | public class LiferayProjectType { 12 | 13 | public static final String LIFERAY_GRADLE_WORKSPACE = "LiferayGradleWorkspace"; 14 | 15 | public static final String LIFERAY_MAVEN_WORKSPACE = "LiferayMavenWorkspace"; 16 | 17 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/modules/LiferayProjectTypesComponent.form: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/modules/LiferayWorkspaceTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.modules; 7 | 8 | import com.intellij.platform.templates.BuilderBasedTemplate; 9 | 10 | import org.jetbrains.annotations.NotNull; 11 | import org.jetbrains.annotations.Nullable; 12 | 13 | /** 14 | * @author Joye Luo 15 | */ 16 | public class LiferayWorkspaceTemplate extends BuilderBasedTemplate { 17 | 18 | public LiferayWorkspaceTemplate(String name, String description, LiferayWorkspaceBuilder builder) { 19 | super(builder); 20 | 21 | _name = name; 22 | _description = description; 23 | } 24 | 25 | @Nullable 26 | @Override 27 | public String getDescription() { 28 | return _description; 29 | } 30 | 31 | @NotNull 32 | @Override 33 | public String getName() { 34 | return _name; 35 | } 36 | 37 | private final String _description; 38 | private final String _name; 39 | 40 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/modules/ext/LiferayModuleExtTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.modules.ext; 7 | 8 | import com.intellij.ide.util.projectWizard.ModuleBuilder; 9 | import com.intellij.platform.templates.BuilderBasedTemplate; 10 | 11 | import org.jetbrains.annotations.NotNull; 12 | import org.jetbrains.annotations.Nullable; 13 | 14 | /** 15 | * @author Joye Luo 16 | */ 17 | public class LiferayModuleExtTemplate extends BuilderBasedTemplate { 18 | 19 | public LiferayModuleExtTemplate(String name, String description, ModuleBuilder builder) { 20 | super(builder); 21 | 22 | _name = name; 23 | _description = description; 24 | } 25 | 26 | @Nullable 27 | @Override 28 | public String getDescription() { 29 | return _description; 30 | } 31 | 32 | @NotNull 33 | @Override 34 | public String getName() { 35 | return _name; 36 | } 37 | 38 | private final String _description; 39 | private final String _name; 40 | 41 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/modules/ext/OverrideFilesComponent.form: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/modules/springmvcportlet/LiferaySpringMVCPortletTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.modules.springmvcportlet; 7 | 8 | import com.intellij.ide.util.projectWizard.ModuleBuilder; 9 | import com.intellij.platform.templates.BuilderBasedTemplate; 10 | 11 | import org.jetbrains.annotations.NotNull; 12 | import org.jetbrains.annotations.Nullable; 13 | 14 | /** 15 | * @author Joye Luo 16 | */ 17 | public class LiferaySpringMVCPortletTemplate extends BuilderBasedTemplate { 18 | 19 | public LiferaySpringMVCPortletTemplate(String name, String description, ModuleBuilder builder) { 20 | super(builder); 21 | 22 | _name = name; 23 | _description = description; 24 | } 25 | 26 | @Nullable 27 | @Override 28 | public String getDescription() { 29 | return _description; 30 | } 31 | 32 | @NotNull 33 | @Override 34 | public String getName() { 35 | return _name; 36 | } 37 | 38 | private final String _description; 39 | private final String _name; 40 | 41 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/ui/modules/springmvcportlet/SpringMVCPortletProjectConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.ui.modules.springmvcportlet; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | /** 12 | * @author Gregory Amerson 13 | */ 14 | @SuppressWarnings("serial") 15 | public class SpringMVCPortletProjectConstants { 16 | 17 | public static final String[] SPRING_FRAMEWORK = {"PortletMVC4Spring", "Spring Portlet MVC"}; 18 | 19 | public static final String[] SPRING_FRAMEWORK_DEPENDENCIES = {"Embedded", "Provided"}; 20 | 21 | public static final String[] SPRING_VIEW_TYPE = {"Jsp", "Thymeleaf"}; 22 | 23 | public static final Map springDependenciesInjectors = new HashMap() { 24 | { 25 | put("DS", new String("ds")); 26 | put("Spring", new String("springmvcportlet")); 27 | } 28 | }; 29 | public static final Map springFrameworkDependeices = new HashMap() { 30 | { 31 | put(SPRING_FRAMEWORK_DEPENDENCIES[0], new String("embedded")); 32 | put(SPRING_FRAMEWORK_DEPENDENCIES[1], new String("provided")); 33 | } 34 | }; 35 | public static final Map springFrameworks = new HashMap() { 36 | { 37 | put(SPRING_FRAMEWORK[0], new String("portletmvc4spring")); 38 | put(SPRING_FRAMEWORK[1], new String("springportletmvc")); 39 | } 40 | }; 41 | public static final Map springViewTypes = new HashMap() { 42 | { 43 | put(SPRING_VIEW_TYPE[0], new String("jsp")); 44 | put(SPRING_VIEW_TYPE[1], new String("thymeleaf")); 45 | } 46 | }; 47 | 48 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/util/FileListing.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.util; 7 | 8 | import java.io.File; 9 | import java.io.FileNotFoundException; 10 | 11 | import java.util.ArrayList; 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | /** 16 | * @author Greg Amerson 17 | * @author Terry Jia 18 | */ 19 | public class FileListing { 20 | 21 | public static List getFileListing(File aStartingDir) throws FileNotFoundException { 22 | List result = new ArrayList<>(); 23 | 24 | File[] filesAndDirs = aStartingDir.listFiles(); 25 | 26 | List filesDirs = Arrays.asList(filesAndDirs); 27 | 28 | for (File file : filesDirs) { 29 | result.add(file); 30 | 31 | if (!file.isFile()) { 32 | List deeperList = getFileListing(file); 33 | 34 | result.addAll(deeperList); 35 | } 36 | } 37 | 38 | return result; 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/util/GradleDependencyUpdater.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.util; 7 | 8 | import com.google.common.collect.ListMultimap; 9 | 10 | import java.io.File; 11 | import java.io.IOException; 12 | 13 | import java.util.List; 14 | 15 | import org.apache.commons.io.FileUtils; 16 | 17 | import org.codehaus.groovy.ast.ASTNode; 18 | import org.codehaus.groovy.ast.GroovyCodeVisitor; 19 | import org.codehaus.groovy.ast.builder.AstBuilder; 20 | 21 | /** 22 | * @author Terry Jia 23 | */ 24 | public class GradleDependencyUpdater { 25 | 26 | public GradleDependencyUpdater(File file) throws IOException { 27 | this(FileUtils.readFileToString(file, "UTF-8")); 28 | 29 | _file = file; 30 | } 31 | 32 | public GradleDependencyUpdater(String scriptContents) { 33 | AstBuilder builder = new AstBuilder(); 34 | 35 | _nodes = builder.buildFromString(scriptContents); 36 | } 37 | 38 | public ListMultimap getAllDependencies() { 39 | FindAllDependenciesVisitor visitor = new FindAllDependenciesVisitor(); 40 | 41 | walkScript(visitor); 42 | 43 | return visitor.getDependencies(); 44 | } 45 | 46 | public List getDependenciesByName(String configurationName) { 47 | ListMultimap allDependencies = getAllDependencies(); 48 | 49 | return allDependencies.get(configurationName); 50 | } 51 | 52 | public void walkScript(GroovyCodeVisitor visitor) { 53 | for (ASTNode node : _nodes) { 54 | node.visit(visitor); 55 | } 56 | } 57 | 58 | private File _file; 59 | private List _nodes; 60 | 61 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/util/ListUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.util; 7 | 8 | import java.util.Collection; 9 | import java.util.List; 10 | import java.util.Set; 11 | 12 | /** 13 | * @author Terry Jia 14 | */ 15 | public class ListUtil { 16 | 17 | public static boolean isEmpty(Collection collection) { 18 | if ((collection == null) || collection.isEmpty()) { 19 | return true; 20 | } 21 | 22 | return false; 23 | } 24 | 25 | public static boolean isEmpty(List list) { 26 | if ((list == null) || list.isEmpty()) { 27 | return true; 28 | } 29 | 30 | return false; 31 | } 32 | 33 | public static boolean isEmpty(Object[] array) { 34 | if ((array == null) || (array.length == 0)) { 35 | return true; 36 | } 37 | 38 | return false; 39 | } 40 | 41 | public static boolean isEmpty(Set set) { 42 | if ((set == null) || set.isEmpty()) { 43 | return true; 44 | } 45 | 46 | return false; 47 | } 48 | 49 | public static boolean isNotEmpty(Collection collection) { 50 | return !isEmpty(collection); 51 | } 52 | 53 | public static boolean isNotEmpty(List list) { 54 | return !isEmpty(list); 55 | } 56 | 57 | public static boolean isNotEmpty(Object[] array) { 58 | return !isEmpty(array); 59 | } 60 | 61 | public static boolean isNotEmpty(Set set) { 62 | return !isEmpty(set); 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/util/Pair.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.util; 7 | 8 | /** 9 | * @author Alberto Chaparro 10 | */ 11 | public class Pair { 12 | 13 | public Pair(final F l, final S r) { 14 | _first = l; 15 | _second = r; 16 | } 17 | 18 | @Override 19 | public boolean equals(final Object obj) { 20 | if (this == obj) { 21 | return true; 22 | } 23 | 24 | if (obj == null) { 25 | return false; 26 | } 27 | 28 | if (getClass() != obj.getClass()) { 29 | return false; 30 | } 31 | 32 | final Pair other = (Pair)obj; 33 | 34 | if (_first == null) { 35 | if (other.first() != null) { 36 | return false; 37 | } 38 | } 39 | else if (!_first.equals(other.first())) { 40 | return false; 41 | } 42 | 43 | if (_second == null) { 44 | if (other.second() != null) { 45 | return false; 46 | } 47 | } 48 | else if (!_second.equals(other._second)) { 49 | return false; 50 | } 51 | 52 | return true; 53 | } 54 | 55 | public F first() { 56 | return _first; 57 | } 58 | 59 | @Override 60 | public int hashCode() { 61 | final int prime = 31; 62 | 63 | int result = 1; 64 | 65 | result = (prime * result) + ((_first == null) ? 0 : _first.hashCode()); 66 | 67 | result = (prime * result) + ((_second == null) ? 0 : _second.hashCode()); 68 | 69 | return result; 70 | } 71 | 72 | public S second() { 73 | return _second; 74 | } 75 | 76 | @Override 77 | public String toString() { 78 | return "(" + _first + ", " + _second + ")"; 79 | } 80 | 81 | private final F _first; 82 | private final S _second; 83 | 84 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/util/PortalPropertiesConfiguration.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.util; 7 | 8 | import org.apache.commons.configuration.ConfigurationException; 9 | import org.apache.commons.configuration.PropertiesConfiguration; 10 | import org.apache.commons.configuration.PropertiesConfigurationLayout; 11 | 12 | /** 13 | * @author Gregory Amerson 14 | */ 15 | public class PortalPropertiesConfiguration extends PropertiesConfiguration { 16 | 17 | public PortalPropertiesConfiguration() throws ConfigurationException { 18 | setDelimiterParsingDisabled(true); 19 | } 20 | 21 | @Override 22 | protected PropertiesConfigurationLayout createLayout() { 23 | return new PortalPropertiesConfigurationLayout(this); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/util/PropertiesUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.util; 7 | 8 | import java.io.File; 9 | import java.io.FileInputStream; 10 | import java.io.IOException; 11 | 12 | import java.util.Properties; 13 | 14 | /** 15 | * @author Terry Jia 16 | */ 17 | public class PropertiesUtil { 18 | 19 | public static Properties loadProperties(File f) { 20 | Properties properties = new Properties(); 21 | 22 | try (FileInputStream stream = new FileInputStream(f)) { 23 | properties.load(stream); 24 | 25 | return properties; 26 | } 27 | catch (IOException ioException) { 28 | return null; 29 | } 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/util/StringBufferOutputStream.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.util; 7 | 8 | import java.io.IOException; 9 | import java.io.OutputStream; 10 | 11 | /** 12 | * @author Terry Jia 13 | */ 14 | public class StringBufferOutputStream extends OutputStream { 15 | 16 | public StringBufferOutputStream() { 17 | } 18 | 19 | public void clear() { 20 | buffer.delete(0, buffer.length()); 21 | } 22 | 23 | public String toString() { 24 | return buffer.toString(); 25 | } 26 | 27 | /** 28 | * @see OutputStream#write(int) 29 | */ 30 | public void write(int write) throws IOException { 31 | buffer.append((char)write); 32 | } 33 | 34 | protected StringBuffer buffer = new StringBuffer(); 35 | 36 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/util/StringPool.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.util; 7 | 8 | /** 9 | * @author Gregory Amerson 10 | * @author Kuo Zhang 11 | */ 12 | public class StringPool { 13 | 14 | public static final String ASTERISK = "*"; 15 | 16 | public static final String BLANK = ""; 17 | 18 | public static final String COLON = ":"; 19 | 20 | public static final String COMMA = ","; 21 | 22 | public static final String DASH = "-"; 23 | 24 | public static final String DOUBLE_ASTERISK = "**"; 25 | 26 | public static final String DOUBLE_QUOTE = "\""; 27 | 28 | public static final char DOUBLE_QUOTE_CHAR = '\"'; 29 | 30 | public static final String EMPTY = BLANK; 31 | 32 | public static final String EQUALS = "="; 33 | 34 | public static final String FORWARD_SLASH = "/"; 35 | 36 | public static final String PERIOD = "."; 37 | 38 | public static final String SINGLE_QUOTE = "\'"; 39 | 40 | public static final char SINGLE_QUOTE_CHAR = '\''; 41 | 42 | public static final String SPACE = " "; 43 | 44 | public static final String UNDERSCORE = "_"; 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/liferay/ide/idea/util/init.gradle: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | initscript { 18 | File deps = file('%deps%') 19 | 20 | dependencies { 21 | classpath files { 22 | deps.listFiles() 23 | } 24 | } 25 | } 26 | 27 | allprojects { 28 | apply plugin: com.liferay.blade.gradle.tooling.ProjectInfoPlugin 29 | } -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-JSIntentionPowerPack.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-css.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-database.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-javaee-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-javaee.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-javascript.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-jsp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-sass.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/com.liferay.ide.intellij.plugin-webcomponents.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/pluginIcon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/services/com.liferay.ide.idea.core.WorkspaceProvider: -------------------------------------------------------------------------------- 1 | com.liferay.ide.idea.core.LiferayGradleWorkspaceProvider 2 | com.liferay.ide.idea.core.LiferayMavenWorkspaceProvider -------------------------------------------------------------------------------- /src/main/resources/configurations/springmvc.json: -------------------------------------------------------------------------------- 1 | { 2 | "7.0": { 3 | "springportletmvc": { 4 | "embedded": ["jsp", "thymeleaf"] 5 | } 6 | }, 7 | 8 | "7.1": { 9 | "springportletmvc": { 10 | "embedded": ["jsp", "thymeleaf"], 11 | "provided": ["jsp", "thymeleaf"] 12 | }, 13 | "portletmvc4spring": { 14 | "embedded": ["jsp", "thymeleaf"] 15 | } 16 | }, 17 | 18 | "7.2": { 19 | "springportletmvc": { 20 | "embedded": ["jsp", "thymeleaf"], 21 | "provided": ["jsp", "thymeleaf"] 22 | }, 23 | "portletmvc4spring": { 24 | "embedded": ["jsp", "thymeleaf"] 25 | } 26 | }, 27 | 28 | "7.3": { 29 | "springportletmvc": { 30 | "embedded": ["jsp", "thymeleaf"] 31 | }, 32 | "portletmvc4spring": { 33 | "embedded": ["jsp", "thymeleaf"] 34 | } 35 | }, 36 | 37 | "7.4": { 38 | "springportletmvc": { 39 | "embedded": ["jsp", "thymeleaf"] 40 | }, 41 | "portletmvc4spring": { 42 | "embedded": ["jsp", "thymeleaf"] 43 | } 44 | }, 45 | 46 | "quarterly": { 47 | "springportletmvc": { 48 | "embedded": ["jsp", "thymeleaf"] 49 | }, 50 | "portletmvc4spring": { 51 | "embedded": ["jsp", "thymeleaf"] 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-display_7_0_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 14 | 18 | 19 | 20 | 29 | 32 | 33 | 36 | 37 | 38 | 41 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-display_7_1_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 14 | 18 | 19 | 20 | 29 | 32 | 33 | 36 | 37 | 38 | 41 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-display_7_2_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 14 | 18 | 19 | 20 | 29 | 32 | 33 | 36 | 37 | 38 | 41 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-display_7_3_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 14 | 18 | 19 | 20 | 29 | 32 | 33 | 36 | 37 | 38 | 41 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-display_7_4_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 14 | 18 | 19 | 20 | 29 | 32 | 33 | 36 | 37 | 38 | 41 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-layout-templates_7_0_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-layout-templates_7_1_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-layout-templates_7_2_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-layout-templates_7_3_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-layout-templates_7_4_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-social_7_0_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-social_7_1_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-social_7_2_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-social_7_3_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-social_7_4_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-theme-loader_7_0_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 15 | 20 | 21 | 22 | 28 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-theme-loader_7_1_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 15 | 20 | 21 | 22 | 28 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-theme-loader_7_2_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 15 | 20 | 21 | 22 | 28 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-theme-loader_7_3_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 15 | 20 | 21 | 22 | 28 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-theme-loader_7_4_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 15 | 20 | 21 | 22 | 28 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-user-notification-definitions_7_0_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-user-notification-definitions_7_1_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-user-notification-definitions_7_2_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-user-notification-definitions_7_3_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/definitions/dtd/liferay-user-notification-definitions_7_4_0.dtd: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/definitions/xsd/liferay-custom-sql_7_0_0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/resources/icons/bnd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/src/main/resources/icons/bnd.png -------------------------------------------------------------------------------- /src/main/resources/icons/osgi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/src/main/resources/icons/osgi.png -------------------------------------------------------------------------------- /src/main/resources/icons/portletMVC4Spring_16x16_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/src/main/resources/icons/portletMVC4Spring_16x16_new.png -------------------------------------------------------------------------------- /src/main/resources/libs/gradle-tooling.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/src/main/resources/libs/gradle-tooling.jar -------------------------------------------------------------------------------- /src/main/resources/messages/Messages.properties: -------------------------------------------------------------------------------- 1 | modules.ext.files.title=Create Module Ext Override Files 2 | modules.ext.files.undefined=Unable to identify original module, please push refresh button 3 | modules.ext.override.dialog.title=Select Source Files To Override 4 | modules.ext.override.jar.undefined=Unable to get source jar in current context. 5 | modules.ext.refresh.tip=Refresh current Gradle project 6 | modules.ext.targetPlatform.mention=No Target Platform configuration claimed in gradle.properties. 7 | orderEntry.fix.add.library.to.gradle=Add Liferay library ''{0}'' to gradle 8 | orderEntry.fix.family.add.library.to.gradle=Add Liferay library to gradle 9 | invalid.workspace.location={0}: is not a valid Liferay Gradle Workspace either a valid Liferay Maven Workspace. 10 | modules.workspace.product=Your Liferay Workspace project({0}) is missing a liferay.workspace.product property in gradle.properties. Would you like to configure it now? 11 | directory.project.file.directory=The {0} directory\n 12 | prompt.overwrite.project.file=The {1} file \n''{0}''\nalready exists.\nWould you like to overwrite it? 13 | prompt.enter.project.file.location=Enter {0} file location 14 | description.select.project.file.directory={0} file will be stored in this directory 15 | prompt.new.project.file.name=Enter a file name to create a new {0} {1} 16 | file.location.should.be.absolute={0} location path should be absolute -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/bnd/BndHighlightingAnnotatorTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd; 7 | 8 | import com.intellij.codeInsight.daemon.impl.HighlightInfo; 9 | import com.intellij.lang.annotation.HighlightSeverity; 10 | import com.intellij.openapi.editor.colors.EditorColorsManager; 11 | import com.intellij.openapi.editor.colors.EditorColorsScheme; 12 | import com.intellij.openapi.editor.markup.TextAttributes; 13 | import com.intellij.testFramework.fixtures.BasePlatformTestCase; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * @author Dominik Marks 19 | */ 20 | public class BndHighlightingAnnotatorTest extends BasePlatformTestCase { 21 | 22 | public void testLineCommentHighlighting() { 23 | myFixture.configureByFiles("bnd.bnd"); 24 | 25 | EditorColorsManager editorColorsManager = EditorColorsManager.getInstance(); 26 | 27 | EditorColorsScheme globalScheme = editorColorsManager.getGlobalScheme(); 28 | 29 | TextAttributes lineCommentTextAttributes = globalScheme.getAttributes( 30 | OsgiManifestColorsAndFonts.LINE_COMMENT_KEY); 31 | 32 | List highlightInfos = myFixture.doHighlighting(); 33 | 34 | for (HighlightInfo highlightInfo : highlightInfos) { 35 | if (highlightInfo.getSeverity() == HighlightSeverity.INFORMATION) { 36 | assertEquals(lineCommentTextAttributes, highlightInfo.getTextAttributes(null, globalScheme)); 37 | } 38 | else { 39 | fail("unexpected Highlighting Info found: " + highlightInfo); 40 | } 41 | } 42 | } 43 | 44 | @Override 45 | protected String getTestDataPath() { 46 | return _TEST_DATA_PATH; 47 | } 48 | 49 | private static final String _TEST_DATA_PATH = "testdata/com/liferay/ide/idea/bnd/BndHighlightingAnnotatorTest"; 50 | 51 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/bnd/actions/EnterInBndFileHandlerTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.actions; 7 | 8 | import com.intellij.testFramework.fixtures.BasePlatformTestCase; 9 | 10 | import org.junit.Test; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | public class EnterInBndFileHandlerTest extends BasePlatformTestCase { 16 | 17 | @Test 18 | public void testEnterInBndFileHandler() { 19 | myFixture.configureByFiles("bnd.bnd"); 20 | 21 | myFixture.type('\n'); 22 | 23 | myFixture.checkResultByFile("updated.bnd"); 24 | } 25 | 26 | @Override 27 | protected String getTestDataPath() { 28 | return _TEST_DATA_PATH; 29 | } 30 | 31 | private static final String _TEST_DATA_PATH = "testdata/com/liferay/ide/idea/bnd/actions/EnterInBndFileHandlerTest"; 32 | 33 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/bnd/commenter/BndCommenterTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.commenter; 7 | 8 | import com.intellij.testFramework.fixtures.BasePlatformTestCase; 9 | 10 | /** 11 | * @author Dominik Marks 12 | */ 13 | public class BndCommenterTest extends BasePlatformTestCase { 14 | 15 | public void testEnterInBndFileHandler() { 16 | myFixture.configureByFiles("bnd.bnd"); 17 | 18 | myFixture.performEditorAction("CommentByLineComment"); 19 | 20 | myFixture.checkResultByFile("expected.bnd"); 21 | } 22 | 23 | @Override 24 | protected String getTestDataPath() { 25 | return _TEST_DATA_PATH; 26 | } 27 | 28 | private static final String _TEST_DATA_PATH = "testdata/com/liferay/ide/idea/bnd/commenter/BndCommenterTest"; 29 | 30 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/bnd/formatting/BndFormattingTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.formatting; 7 | 8 | import com.intellij.openapi.command.WriteCommandAction; 9 | import com.intellij.openapi.project.Project; 10 | import com.intellij.psi.PsiFile; 11 | import com.intellij.psi.codeStyle.CodeStyleManager; 12 | import com.intellij.testFramework.fixtures.BasePlatformTestCase; 13 | 14 | import java.util.Arrays; 15 | 16 | import org.junit.Test; 17 | 18 | /** 19 | * @author Dominik Marks 20 | */ 21 | public class BndFormattingTest extends BasePlatformTestCase { 22 | 23 | @Test 24 | public void testFormatter() { 25 | myFixture.configureByFiles("bnd.bnd"); 26 | 27 | Project project = getProject(); 28 | 29 | WriteCommandAction.Builder writeCommandAction = WriteCommandAction.writeCommandAction(project); 30 | 31 | writeCommandAction.run( 32 | () -> { 33 | CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project); 34 | 35 | PsiFile psiFile = myFixture.getFile(); 36 | 37 | codeStyleManager.reformatText(psiFile, Arrays.asList(psiFile.getTextRange())); 38 | }); 39 | 40 | myFixture.checkResultByFile("formatted.bnd"); 41 | } 42 | 43 | @Override 44 | protected String getTestDataPath() { 45 | return _TEST_DATA_PATH; 46 | } 47 | 48 | private static final String _TEST_DATA_PATH = "testdata/com/liferay/ide/idea/bnd/formatting/BndFormattingTest"; 49 | 50 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/bnd/parser/BundleVersionParserTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.bnd.parser; 7 | 8 | import com.intellij.codeInsight.daemon.impl.HighlightInfo; 9 | import com.intellij.testFramework.fixtures.BasePlatformTestCase; 10 | 11 | import java.util.List; 12 | 13 | import org.junit.Test; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public class BundleVersionParserTest extends BasePlatformTestCase { 19 | 20 | @Test 21 | public void testInvalidBundleVersionHighlighting() { 22 | myFixture.configureByText("bnd.bnd", "Bundle-Version: foo.bar\n"); 23 | 24 | List highlightInfos = myFixture.doHighlighting(); 25 | 26 | assertFalse(highlightInfos.isEmpty()); 27 | 28 | HighlightInfo highlightInfo = highlightInfos.get(0); 29 | 30 | assertEquals(highlightInfo.getDescription(), "invalid version \"foo.bar\": non-numeric \"foo\""); 31 | } 32 | 33 | @Test 34 | public void testValidBundleVersionHighlighting() { 35 | myFixture.configureByText("bnd.bnd", "Bundle-Version: 1.0.0\n"); 36 | 37 | List highlightInfos = myFixture.doHighlighting(); 38 | 39 | assertTrue(highlightInfos.isEmpty()); 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/LiferayXmlSchemaProviderTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language; 7 | 8 | import com.intellij.codeInsight.completion.CompletionType; 9 | import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; 10 | 11 | import java.util.List; 12 | 13 | import org.junit.Test; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public class LiferayXmlSchemaProviderTest extends LightJavaCodeInsightFixtureTestCase { 19 | 20 | @Test 21 | public void testCompletion() { 22 | myFixture.configureByFiles("portlet-model-hints.xml"); 23 | myFixture.complete(CompletionType.BASIC, 1); 24 | 25 | List strings = myFixture.getLookupElementStrings(); 26 | 27 | assertTrue(strings.contains("max-length")); 28 | } 29 | 30 | @Override 31 | protected String getTestDataPath() { 32 | return "testdata/com/liferay/ide/idea/language/LiferayXmlSchemaProviderTest"; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/blade/LiferayBladePropertiesImplicitUsageProviderTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.blade; 7 | 8 | import com.intellij.testFramework.fixtures.BasePlatformTestCase; 9 | 10 | import org.junit.Test; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | public class LiferayBladePropertiesImplicitUsageProviderTest extends BasePlatformTestCase { 16 | 17 | @Test 18 | public void testImplicitUsageJavaxPortletTitleInLanguageProperties() { 19 | myFixture.configureByFiles(".blade.properties"); 20 | 21 | //.blade.properties should not show any unused warning, 22 | //even if liferay.version.default is not used explicitly 23 | myFixture.checkHighlighting(); 24 | } 25 | 26 | @Override 27 | protected String getTestDataPath() { 28 | return "testdata/com/liferay/ide/idea/language/blade/LiferayBladePropertiesImplicitUsageProviderTest"; 29 | } 30 | 31 | @Override 32 | protected void setUp() throws Exception { 33 | super.setUp(); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/gradle/LiferayGradlePropertiesImplicitUsageProviderTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.gradle; 7 | 8 | import com.intellij.testFramework.fixtures.BasePlatformTestCase; 9 | 10 | import org.junit.Test; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | public class LiferayGradlePropertiesImplicitUsageProviderTest extends BasePlatformTestCase { 16 | 17 | @Test 18 | public void testImplicitUsageJavaxPortletTitleInLanguageProperties() { 19 | myFixture.configureByFiles("gradle.properties"); 20 | 21 | //gradle.properties should not show any unused warning, 22 | //even if liferay.workspace.modules.dir is not used explicitly 23 | myFixture.checkHighlighting(); 24 | } 25 | 26 | @Override 27 | protected String getTestDataPath() { 28 | return "testdata/com/liferay/ide/idea/language/gradle/LiferayGradlePropertiesImplicitUsageProviderTest"; 29 | } 30 | 31 | @Override 32 | protected void setUp() throws Exception { 33 | super.setUp(); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/resourcebundle/LiferayResourceBundlePropertiesImplicitUsageProviderTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.resourcebundle; 7 | 8 | import com.intellij.lang.properties.codeInspection.unused.UnusedPropertyInspection; 9 | import com.intellij.testFramework.fixtures.BasePlatformTestCase; 10 | 11 | import org.junit.Test; 12 | 13 | /** 14 | * @author Dominik Marks 15 | */ 16 | public class LiferayResourceBundlePropertiesImplicitUsageProviderTest extends BasePlatformTestCase { 17 | 18 | @Test 19 | public void testImplicitUsageArbitraryPropertyInLanguageProperties() { 20 | myFixture.configureByFiles("Language_unused.properties"); 21 | 22 | //Language.properties should show unused warning for other properties 23 | myFixture.checkHighlighting(); 24 | } 25 | 26 | @Test 27 | public void testImplicitUsageJavaxPortletTitleInLanguageProperties() { 28 | myFixture.configureByFiles("Language.properties"); 29 | 30 | //Language.properties should not show any unused warning, 31 | //even if javax.portlet.title.my_portlet is not used explicitly 32 | myFixture.checkHighlighting(); 33 | } 34 | 35 | @Override 36 | protected String getTestDataPath() { 37 | return "testdata/com/liferay/ide/idea/language/resourcebundle" + 38 | "/LiferayResourceBundlePropertiesImplicitUsageProviderTest"; 39 | } 40 | 41 | @Override 42 | protected void setUp() throws Exception { 43 | super.setUp(); 44 | 45 | myFixture.enableInspections(new UnusedPropertyInspection()); 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateColumnInspectionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.codeInsight.intention.IntentionAction; 9 | import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; 10 | 11 | import java.util.List; 12 | import java.util.Objects; 13 | 14 | import org.junit.Test; 15 | 16 | /** 17 | * @author Dominik Marks 18 | */ 19 | public class LiferayServiceXMLDuplicateColumnInspectionTest extends LightJavaCodeInsightFixtureTestCase { 20 | 21 | @Test 22 | public void testDuplicateColumnInspection() { 23 | myFixture.configureByFiles("service.xml"); 24 | 25 | myFixture.checkHighlighting(); 26 | 27 | List allQuickFixes = myFixture.getAllQuickFixes(); 28 | 29 | for (IntentionAction quickFix : allQuickFixes) { 30 | if (Objects.equals(quickFix.getFamilyName(), "Remove entry")) { 31 | myFixture.launchAction(quickFix); 32 | 33 | break; 34 | } 35 | } 36 | 37 | myFixture.checkResultByFile("service_fixed.xml", true); 38 | } 39 | 40 | @Override 41 | protected String getTestDataPath() { 42 | return "testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateColumnInspectionTest"; 43 | } 44 | 45 | @Override 46 | protected void setUp() throws Exception { 47 | super.setUp(); 48 | 49 | myFixture.enableInspections(new LiferayServiceXMLDuplicateColumnInspection()); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateEntityInspectionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.codeInsight.intention.IntentionAction; 9 | import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; 10 | 11 | import java.util.List; 12 | import java.util.Objects; 13 | 14 | import org.junit.Test; 15 | 16 | /** 17 | * @author Dominik Marks 18 | */ 19 | public class LiferayServiceXMLDuplicateEntityInspectionTest extends LightJavaCodeInsightFixtureTestCase { 20 | 21 | @Test 22 | public void testDuplicateEntityInspection() { 23 | myFixture.configureByFiles("service.xml"); 24 | 25 | myFixture.checkHighlighting(); 26 | 27 | List allQuickFixes = myFixture.getAllQuickFixes(); 28 | 29 | for (IntentionAction quickFix : allQuickFixes) { 30 | if (Objects.equals(quickFix.getFamilyName(), "Remove entry")) { 31 | myFixture.launchAction(quickFix); 32 | 33 | break; 34 | } 35 | } 36 | 37 | myFixture.checkResultByFile("service_fixed.xml", true); 38 | } 39 | 40 | @Override 41 | protected String getTestDataPath() { 42 | return "testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateEntityInspectionTest"; 43 | } 44 | 45 | @Override 46 | protected void setUp() throws Exception { 47 | super.setUp(); 48 | 49 | myFixture.enableInspections(new LiferayServiceXMLDuplicateEntityInspection()); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateExceptionInspectionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.codeInsight.intention.IntentionAction; 9 | import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; 10 | 11 | import java.util.List; 12 | import java.util.Objects; 13 | 14 | import org.junit.Test; 15 | 16 | /** 17 | * @author Dominik Marks 18 | */ 19 | public class LiferayServiceXMLDuplicateExceptionInspectionTest extends LightJavaCodeInsightFixtureTestCase { 20 | 21 | @Test 22 | public void testDuplicateExceptionInspection() { 23 | myFixture.configureByFiles("service.xml"); 24 | 25 | myFixture.checkHighlighting(); 26 | 27 | List allQuickFixes = myFixture.getAllQuickFixes(); 28 | 29 | for (IntentionAction quickFix : allQuickFixes) { 30 | if (Objects.equals(quickFix.getFamilyName(), "Remove entry")) { 31 | myFixture.launchAction(quickFix); 32 | 33 | break; 34 | } 35 | } 36 | 37 | myFixture.checkResultByFile("service_fixed.xml", true); 38 | } 39 | 40 | @Override 41 | protected String getTestDataPath() { 42 | return "testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateExceptionInspectionTest"; 43 | } 44 | 45 | @Override 46 | protected void setUp() throws Exception { 47 | super.setUp(); 48 | 49 | myFixture.enableInspections(new LiferayServiceXMLDuplicateExceptionInspection()); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateFinderInspectionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.codeInsight.intention.IntentionAction; 9 | import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; 10 | 11 | import java.util.List; 12 | import java.util.Objects; 13 | 14 | import org.junit.Test; 15 | 16 | /** 17 | * @author Dominik Marks 18 | */ 19 | public class LiferayServiceXMLDuplicateFinderInspectionTest extends LightJavaCodeInsightFixtureTestCase { 20 | 21 | @Test 22 | public void testDuplicateFinderInspection() { 23 | myFixture.configureByFiles("service.xml"); 24 | 25 | myFixture.checkHighlighting(); 26 | 27 | List allQuickFixes = myFixture.getAllQuickFixes(); 28 | 29 | for (IntentionAction quickFix : allQuickFixes) { 30 | if (Objects.equals(quickFix.getFamilyName(), "Remove entry")) { 31 | myFixture.launchAction(quickFix); 32 | 33 | break; 34 | } 35 | } 36 | 37 | myFixture.checkResultByFile("service_fixed.xml", true); 38 | } 39 | 40 | @Override 41 | protected String getTestDataPath() { 42 | return "testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateFinderInspectionTest"; 43 | } 44 | 45 | @Override 46 | protected void setUp() throws Exception { 47 | super.setUp(); 48 | 49 | myFixture.enableInspections(new LiferayServiceXMLDuplicateFinderInspection()); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/service/LiferayServiceXMLEntityUuidInspectionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; 9 | 10 | import org.junit.Test; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | public class LiferayServiceXMLEntityUuidInspectionTest extends LightJavaCodeInsightFixtureTestCase { 16 | 17 | @Test 18 | public void testInvalidUuidInspection() { 19 | myFixture.configureByFiles("service_invalid.xml"); 20 | 21 | myFixture.checkHighlighting(); 22 | } 23 | 24 | @Test 25 | public void testValidUuidInspection() { 26 | myFixture.configureByFiles("service_valid.xml"); 27 | 28 | myFixture.checkHighlighting(); 29 | } 30 | 31 | @Override 32 | protected String getTestDataPath() { 33 | return "testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLEntityUuidInspectionTest"; 34 | } 35 | 36 | @Override 37 | protected void setUp() throws Exception { 38 | super.setUp(); 39 | 40 | myFixture.enableInspections(new LiferayServiceXMLEntityUuidInspection()); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/service/LiferayServiceXMLExceptionNameInspectionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.codeInsight.intention.IntentionAction; 9 | import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; 10 | 11 | import java.util.List; 12 | import java.util.Objects; 13 | 14 | import org.junit.Test; 15 | 16 | /** 17 | * @author Dominik Marks 18 | */ 19 | public class LiferayServiceXMLExceptionNameInspectionTest extends LightJavaCodeInsightFixtureTestCase { 20 | 21 | @Test 22 | public void testExceptionNameInspection() { 23 | myFixture.configureByFiles("service.xml"); 24 | 25 | myFixture.checkHighlighting(); 26 | 27 | List allQuickFixes = myFixture.getAllQuickFixes(); 28 | 29 | for (IntentionAction quickFix : allQuickFixes) { 30 | if (Objects.equals(quickFix.getFamilyName(), "Remove Exception suffix")) { 31 | myFixture.launchAction(quickFix); 32 | } 33 | } 34 | 35 | myFixture.checkResultByFile("service_fixed.xml"); 36 | } 37 | 38 | @Override 39 | protected String getTestDataPath() { 40 | return "testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLExceptionNameInspectionTest"; 41 | } 42 | 43 | @Override 44 | protected void setUp() throws Exception { 45 | super.setUp(); 46 | 47 | myFixture.enableInspections(new LiferayServiceXMLExceptionNameInspection()); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/service/LiferayServiceXMLNamespaceInspectionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; 9 | 10 | import org.junit.Test; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | public class LiferayServiceXMLNamespaceInspectionTest extends LightJavaCodeInsightFixtureTestCase { 16 | 17 | @Test 18 | public void testInvalidNamespaceInspection() { 19 | myFixture.configureByFiles("service_invalid.xml"); 20 | 21 | myFixture.checkHighlighting(); 22 | } 23 | 24 | @Test 25 | public void testValidNamespaceInspection() { 26 | myFixture.configureByFiles("service_valid.xml"); 27 | 28 | myFixture.checkHighlighting(); 29 | } 30 | 31 | @Override 32 | protected String getTestDataPath() { 33 | return "testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLNamespaceInspectionTest"; 34 | } 35 | 36 | @Override 37 | protected void setUp() throws Exception { 38 | super.setUp(); 39 | 40 | myFixture.enableInspections(new LiferayServiceXMLNamespaceInspection()); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/service/LiferayServiceXMLPrimaryKeyColumnInspectionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.service; 7 | 8 | import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; 9 | 10 | import org.junit.Test; 11 | 12 | /** 13 | * @author Dominik Marks 14 | */ 15 | public class LiferayServiceXMLPrimaryKeyColumnInspectionTest extends LightJavaCodeInsightFixtureTestCase { 16 | 17 | @Test 18 | public void testInvalidPrimaryKeyInspection() { 19 | myFixture.configureByFiles("service_invalid.xml"); 20 | 21 | myFixture.checkHighlighting(); 22 | } 23 | 24 | @Test 25 | public void testValidPrimaryKeyInspection() { 26 | myFixture.configureByFiles("service_valid.xml"); 27 | 28 | myFixture.checkHighlighting(); 29 | } 30 | 31 | @Override 32 | protected String getTestDataPath() { 33 | return "testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLPrimaryKeyColumnInspectionTest"; 34 | } 35 | 36 | @Override 37 | protected void setUp() throws Exception { 38 | super.setUp(); 39 | 40 | myFixture.enableInspections(new LiferayServiceXMLPrimaryKeyColumnInspection()); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/test/java/com/liferay/ide/idea/language/tag/LiferayTaglibCSSClassAttributeReferenceContributorTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com 3 | * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 4 | */ 5 | 6 | package com.liferay.ide.idea.language.tag; 7 | 8 | import com.intellij.codeInsight.completion.CompletionType; 9 | import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; 10 | 11 | import java.util.List; 12 | 13 | import org.junit.Test; 14 | 15 | /** 16 | * @author Dominik Marks 17 | */ 18 | public class LiferayTaglibCSSClassAttributeReferenceContributorTest extends LightJavaCodeInsightFixtureTestCase { 19 | 20 | @Test 21 | public void testCompletionCSS() { 22 | myFixture.configureByFiles("view.jsp", "main.css", "liferay-aui.tld"); 23 | myFixture.complete(CompletionType.BASIC, 1); 24 | 25 | List strings = myFixture.getLookupElementStrings(); 26 | 27 | assertTrue(strings.contains("foo")); 28 | } 29 | 30 | public void testCompletionSCSS() { 31 | myFixture.configureByFiles("view.jsp", "custom.scss", "liferay-aui.tld"); 32 | myFixture.complete(CompletionType.BASIC, 1); 33 | 34 | List strings = myFixture.getLookupElementStrings(); 35 | 36 | assertTrue(strings.contains("foo")); 37 | } 38 | 39 | @Override 40 | protected String getTestDataPath() { 41 | return "testdata/com/liferay/ide/idea/language/tag/LiferayTaglibCSSClassAttributeReferenceContributorTest"; 42 | } 43 | 44 | @Override 45 | protected void setUp() throws Exception { 46 | super.setUp(); 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/BndHighlightingAnnotatorTest/bnd.bnd: -------------------------------------------------------------------------------- 1 | #This is a comment 2 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/actions/EnterInBndFileHandlerTest/bnd.bnd: -------------------------------------------------------------------------------- 1 | Import-Package: foo.bar,foo.baz -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/actions/EnterInBndFileHandlerTest/updated.bnd: -------------------------------------------------------------------------------- 1 | Import-Package: foo.bar,\ 2 | foo.baz -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/commenter/BndCommenterTest/bnd.bnd: -------------------------------------------------------------------------------- 1 | Export-Package: foo.bar -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/commenter/BndCommenterTest/expected.bnd: -------------------------------------------------------------------------------- 1 | #Export-Package: foo.bar -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/formatting/BndFormattingTest/bnd.bnd: -------------------------------------------------------------------------------- 1 | Import-Package:foo.bar,\ 2 | bar.baz -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/formatting/BndFormattingTest/formatted.bnd: -------------------------------------------------------------------------------- 1 | Import-Package: foo.bar,\ 2 | bar.baz -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/BasePackageParserTest/com/liferay/test/Foo.java: -------------------------------------------------------------------------------- 1 | package com.liferay.test; 2 | 3 | public class Foo { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/BasePackageParserTest/invalidImportPackage/bnd.bnd: -------------------------------------------------------------------------------- 1 | Import-Package: com.liferay.non.existing 2 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/BasePackageParserTest/resolvePackage/bnd.bnd: -------------------------------------------------------------------------------- 1 | Import-Package: com.liferay.test -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/BasePackageParserTest/validImportPackage/bnd.bnd: -------------------------------------------------------------------------------- 1 | Import-Package: com.liferay.test 2 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/BundleActivatorParserTest/com/liferay/test/Foo.java: -------------------------------------------------------------------------------- 1 | package com.liferay.test; 2 | 3 | public class Foo { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/BundleActivatorParserTest/com/liferay/test/MyBundleActivator.java: -------------------------------------------------------------------------------- 1 | package com.liferay.test; 2 | 3 | import org.osgi.framework.BundleActivator; 4 | 5 | public class MyBundleActivator implements BundleActivator { 6 | 7 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/BundleActivatorParserTest/invalid/bnd.bnd: -------------------------------------------------------------------------------- 1 | Bundle-Activator: com.liferay.test.Foo -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/BundleActivatorParserTest/org/osgi/framework/BundleActivator.java: -------------------------------------------------------------------------------- 1 | package org.osgi.framework; 2 | 3 | public interface BundleActivator { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/BundleActivatorParserTest/valid/bnd.bnd: -------------------------------------------------------------------------------- 1 | Bundle-Activator: com.liferay.test.MyBundleActivator -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ClassReferenceParserTest/classReferenceContributor/bnd.bnd: -------------------------------------------------------------------------------- 1 | Test-Cases: com.liferay.test. -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ClassReferenceParserTest/com/liferay/test/Foo.java: -------------------------------------------------------------------------------- 1 | package com.liferay.test; 2 | 3 | public class Foo { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ClassReferenceParserTest/invalidClassReference/bnd.bnd: -------------------------------------------------------------------------------- 1 | Test-Cases: com.liferay.test.NonExisting -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ClassReferenceParserTest/resolveClass/bnd.bnd: -------------------------------------------------------------------------------- 1 | Test-Cases: com.liferay.test.Foo -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ClassReferenceParserTest/validClassReference/bnd.bnd: -------------------------------------------------------------------------------- 1 | Test-Cases: com.liferay.test.Foo -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ExportPackageParserTest/com/liferay/foo/Bar.java: -------------------------------------------------------------------------------- 1 | package com.liferay.foo; 2 | 3 | public class Bar { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ExportPackageParserTest/com/liferay/test/Foo.java: -------------------------------------------------------------------------------- 1 | package com.liferay.test; 2 | 3 | public class Foo { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ExportPackageParserTest/invalidExportPackage/bnd.bnd: -------------------------------------------------------------------------------- 1 | Export-Package: com.liferay.non.existing -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ExportPackageParserTest/invalidExportPackageUses/bnd.bnd: -------------------------------------------------------------------------------- 1 | Export-Package: com.liferay.test;uses:="com.liferay.non.existing" -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ExportPackageParserTest/resolvePackage/bnd.bnd: -------------------------------------------------------------------------------- 1 | Export-Package: com.liferay.test -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ExportPackageParserTest/resolvePackageUses/bnd.bnd: -------------------------------------------------------------------------------- 1 | Export-Package: com.liferay.test;uses:="com.liferay.foo" -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ExportPackageParserTest/validExportPackage/bnd.bnd: -------------------------------------------------------------------------------- 1 | Export-Package: com.liferay.test -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/ExportPackageParserTest/validExportPackageUses/bnd.bnd: -------------------------------------------------------------------------------- 1 | Export-Package: com.liferay.test;uses:="com.liferay.foo" -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/FileReferenceParserTest/configs/main.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/testdata/com/liferay/ide/idea/bnd/parser/FileReferenceParserTest/configs/main.js -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/FileReferenceParserTest/fileReferenceContributor/bnd.bnd: -------------------------------------------------------------------------------- 1 | Liferay-JS-Config: / -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/FileReferenceParserTest/invalidFileReference/bnd.bnd: -------------------------------------------------------------------------------- 1 | Liferay-JS-Config: /non/existing.js -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/FileReferenceParserTest/resolveFile/bnd.bnd: -------------------------------------------------------------------------------- 1 | Liferay-JS-Config: /configs/main.js -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/parser/FileReferenceParserTest/validFileReference/bnd.bnd: -------------------------------------------------------------------------------- 1 | Liferay-JS-Config: /configs/main.js -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/com/liferay/test/Bar.java: -------------------------------------------------------------------------------- 1 | package com.liferay.test; 2 | 3 | public class Bar { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/com/liferay/test/Bar_Renamed.java: -------------------------------------------------------------------------------- 1 | package com.liferay.test; 2 | 3 | public class Bar { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/com/liferay/test/Baz.java: -------------------------------------------------------------------------------- 1 | package com.liferay.test; 2 | 3 | public class Baz { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/com/liferay/test/Foo.java: -------------------------------------------------------------------------------- 1 | package com.liferay.test; 2 | 3 | public class Foo { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/com/liferay/test/Foo_Renamed.java: -------------------------------------------------------------------------------- 1 | package com.liferay.renamed; 2 | 3 | public class Foo { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/testRenameClassInsideBnd/bnd.bnd: -------------------------------------------------------------------------------- 1 | Test-Cases: com.liferay.test.Foo -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/testRenameClassInsideClass/bnd.bnd: -------------------------------------------------------------------------------- 1 | Test-Cases: com.liferay.test.Baz -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/testRenameClassInsideClass/bnd_renamed.bnd: -------------------------------------------------------------------------------- 1 | Test-Cases: com.liferay.test.Foo -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/testRenamePackageInsideBnd/bnd.bnd: -------------------------------------------------------------------------------- 1 | Import-Package: com.liferay.test -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/testRenamePackageInsideClass/bnd.bnd: -------------------------------------------------------------------------------- 1 | Import-Package: com.liferay.test -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/bnd/psi/impl/BndHeaderValuePartManipulatorTest/testRenamePackageInsideClass/bnd_renamed.bnd: -------------------------------------------------------------------------------- 1 | Import-Package: com.liferay.renamed -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/LiferayXmlFileReferenceContributorTest/META-INF/resource-actions/custom.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/testdata/com/liferay/ide/idea/language/LiferayXmlFileReferenceContributorTest/META-INF/resource-actions/custom.xml -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/LiferayXmlFileReferenceContributorTest/META-INF/resource-actions/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/LiferayXmlFileReferenceContributorTest/custom_jsps/foo.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/testdata/com/liferay/ide/idea/language/LiferayXmlFileReferenceContributorTest/custom_jsps/foo.txt -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/LiferayXmlFileReferenceContributorTest/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/LiferayXmlFileReferenceContributorTest/liferay-hook.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/LiferayXmlFileReferenceContributorTest/my_resources.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/testdata/com/liferay/ide/idea/language/LiferayXmlFileReferenceContributorTest/my_resources.xml -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/LiferayXmlSchemaProviderTest/portlet-model-hints.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 150 9 | 10 | 11 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/blade/LiferayBladePropertiesImplicitUsageProviderTest/.blade.properties: -------------------------------------------------------------------------------- 1 | liferay.version.default=7.2 -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/gradle/LiferayGradlePropertiesImplicitUsageProviderTest/gradle.properties: -------------------------------------------------------------------------------- 1 | liferay.workspace.modules.dir=modules -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/javascript/LiferayJSPredefinedLibraryProviderTest/aui.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | 4 | Li 5 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/javascript/LiferayJSPredefinedLibraryProviderTest/com.liferay.frontend.js.web.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/testdata/com/liferay/ide/idea/language/javascript/LiferayJSPredefinedLibraryProviderTest/com.liferay.frontend.js.web.jar -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/javascript/LiferayJSPredefinedLibraryProviderTest/main.js: -------------------------------------------------------------------------------- 1 | Li -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/javascript/LiferayJSPredefinedLibraryProviderTest/view.jsp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/jsp/LiferayJspDebuggerSourceFinderAdapterTest/com.liferay.journal.web.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/testdata/com/liferay/ide/idea/language/jsp/LiferayJspDebuggerSourceFinderAdapterTest/com.liferay.journal.web.jar -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/jsp/LiferayJspDebuggerSourceFinderAdapterTest/com.liferay.login.web.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/testdata/com/liferay/ide/idea/language/jsp/LiferayJspDebuggerSourceFinderAdapterTest/com.liferay.login.web.jar -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/osgi/ComponentPropertiesCompletionContributorTest/MultiServiceComponent.java: -------------------------------------------------------------------------------- 1 | import org.osgi.service.component.annotations.Component; 2 | import com.liferay.portal.kernel.portlet.bridges.mvc.MVCActionCommand; 3 | import com.liferay.portal.kernel.search.IndexerPostProcessor; 4 | 5 | @Component( 6 | property = { 7 | "" 8 | }, 9 | service = {MVCActionCommand.class, IndexerPostProcessor.class} 10 | ) 11 | public class MultiServiceComponent { 12 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/osgi/ComponentPropertiesCompletionContributorTest/MyComponent.java: -------------------------------------------------------------------------------- 1 | import org.osgi.service.component.annotations.Component; 2 | 3 | @Component( 4 | property = { 5 | "" 6 | }, 7 | service = java.lang.Object.class 8 | ) 9 | public class MyComponent { 10 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/osgi/ComponentPropertiesCompletionContributorTest/SinglePropertyComponent.java: -------------------------------------------------------------------------------- 1 | import org.osgi.service.component.annotations.Component; 2 | 3 | @Component( 4 | property = "", 5 | service = java.lang.Object.class 6 | ) 7 | public class SinglePropertyComponent { 8 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/osgi/ComponentPropertiesCompletionContributorTest/com/liferay/portal/kernel/portlet/bridges/mvc/MVCActionCommand.java: -------------------------------------------------------------------------------- 1 | package com.liferay.portal.kernel.portlet.bridges.mvc; 2 | 3 | public interface MVCActionCommand { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/osgi/ComponentPropertiesCompletionContributorTest/com/liferay/portal/kernel/search/IndexerPostProcessor.java: -------------------------------------------------------------------------------- 1 | package com.liferay.portal.kernel.search; 2 | 3 | public interface IndexerPostProcessor { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/osgi/ComponentPropertiesCompletionContributorTest/osgi.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/testdata/com/liferay/ide/idea/language/osgi/ComponentPropertiesCompletionContributorTest/osgi.jar -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/osgi/LiferayOsgiImplicitUsageProviderTest/MyComponent.java: -------------------------------------------------------------------------------- 1 | import org.osgi.service.component.annotations.Reference; 2 | 3 | public class MyComponent { 4 | 5 | @Reference 6 | private org.osgi.service.component.annotations.ConfigurationPolicy foo; 7 | 8 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/osgi/LiferayOsgiImplicitUsageProviderTest/MyServiceWrapper.java: -------------------------------------------------------------------------------- 1 | import org.osgi.service.component.annotations.Component; 2 | import com.liferay.portal.kernel.service.ServiceWrapper; 3 | 4 | @Component( 5 | immediate = true, 6 | service = ServiceWrapper.class 7 | ) 8 | public class MyServiceWrapper implements ServiceWrapper { 9 | 10 | public MyServiceWrapper() { 11 | } 12 | 13 | public MyServiceWrapper(Object wrappedService) { 14 | System.out.println(wrappedService); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/osgi/LiferayOsgiImplicitUsageProviderTest/com/liferay/portal/kernel/service/ServiceWrapper.java: -------------------------------------------------------------------------------- 1 | package com.liferay.portal.kernel.service; 2 | 3 | public interface ServiceWrapper { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/osgi/LiferayOsgiImplicitUsageProviderTest/osgi.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liferay/liferay-intellij-plugin/7bd4a5a2c5c20bf4e8e94270ba2c462a770c8c4f/testdata/com/liferay/ide/idea/language/osgi/LiferayOsgiImplicitUsageProviderTest/osgi.jar -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/resourcebundle/LiferayResourceBundlePropertiesImplicitUsageProviderTest/Language.properties: -------------------------------------------------------------------------------- 1 | javax.portlet.title.my_portlet=foo -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/resourcebundle/LiferayResourceBundlePropertiesImplicitUsageProviderTest/Language_unused.properties: -------------------------------------------------------------------------------- 1 | foo=bar 2 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/resourcebundle/ResourceBundleReferenceProviderTest/MyResourceBundleLoader.java: -------------------------------------------------------------------------------- 1 | import java.util.ResourceBundle; 2 | 3 | public class MyResourceBundleLoader { 4 | 5 | private static final ResourceBundle resourceBundle = ResourceBundle.getBundle("content."); 6 | 7 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/resourcebundle/ResourceBundleReferenceProviderTest/content/Language.properties: -------------------------------------------------------------------------------- 1 | javax.portlet.title.my_portlet=foo -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/resourcebundle/ResourceBundleReferenceProviderTest/content/Language_en.properties: -------------------------------------------------------------------------------- 1 | javax.portlet.title.my_portlet=foo -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/resourcebundle/ResourceBundleReferenceProviderTest/java/util/ResourceBundle.java: -------------------------------------------------------------------------------- 1 | package java.util; 2 | 3 | public class ResourceBundle { 4 | 5 | public static ResourceBundle getBundle(String name) { 6 | return null; 7 | } 8 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceJavaImplLineMarkerProviderTest/com/liferay/ide/model/impl/MyModelImpl.java: -------------------------------------------------------------------------------- 1 | package com.liferay.ide.model.impl; 2 | 3 | public class MyModelImpl { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceJavaImplLineMarkerProviderTest/service.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | my_namespace 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateColumnInspectionTest/service.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | 9 | "myModelId" type="long" primary="true" /> 10 | "myModelId" type="long" primary="true" /> 11 | 12 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateColumnInspectionTest/service_fixed.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateEntityInspectionTest/service.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | "MyModel"> 8 | 9 | 10 | "MyModel"> 11 | 12 | 13 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateEntityInspectionTest/service_fixed.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateExceptionInspectionTest/service.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | AccountName 9 | AccountName 10 | 11 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateExceptionInspectionTest/service_fixed.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | AccountName 9 | 10 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateFinderInspectionTest/service.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | 9 | "ModelId" return-type="Collection"> 10 | 11 | 12 | "ModelId" return-type="Collection"> 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLDuplicateFinderInspectionTest/service_fixed.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLEntityUuidInspectionTest/service_invalid.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | "true"> 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLEntityUuidInspectionTest/service_valid.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLExceptionNameInspectionTest/service.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | AccountName 9 | AddressCityException 10 | 11 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLExceptionNameInspectionTest/service_fixed.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | AccountName 9 | AddressCity 10 | 11 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLLineMarkerProviderTest/com/liferay/ide/model/impl/MyModelImpl.java: -------------------------------------------------------------------------------- 1 | package com.liferay.ide.model.impl; 2 | 3 | public class MyModelImpl { 4 | 5 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLLineMarkerProviderTest/service.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | my_namespace 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLNamespaceInspectionTest/service_invalid.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 1-Namespace 7 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLNamespaceInspectionTest/service_valid.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | _1_Namespace 7 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLPrimaryKeyColumnInspectionTest/service_invalid.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | 9 | "true" /> 10 | 11 | 12 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/service/LiferayServiceXMLPrimaryKeyColumnInspectionTest/service_valid.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Portal 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibCSSClassAttributeReferenceContributorTest/custom.scss: -------------------------------------------------------------------------------- 1 | .foo { 2 | color: green; 3 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibCSSClassAttributeReferenceContributorTest/main.css: -------------------------------------------------------------------------------- 1 | .foo { 2 | color: green; 3 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibCSSClassAttributeReferenceContributorTest/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibClassNameReferenceContributorTest/MyObject.java: -------------------------------------------------------------------------------- 1 | public class MyObject { 2 | 3 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibClassNameReferenceContributorTest/com/liferay/ide/model/MyOuter.java: -------------------------------------------------------------------------------- 1 | package com.liferay.ide.model; 2 | 3 | public interface MyOuter { 4 | 5 | interface MyInner { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibClassNameReferenceContributorTest/inner.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibClassNameReferenceContributorTest/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibJavascriptLanguageInjectorTest/aui-validator-custom.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | 4 | function(val, fieldNode, ruleValue) { 5 | a 6 | } 7 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibJavascriptLanguageInjectorTest/aui-validator-required.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | 4 | function(val, fieldNode, ruleValue) { 5 | a 6 | } 7 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibJavascriptLanguageInjectorTest/custom.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | 4 | a 5 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibJavascriptLanguageInjectorTest/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibModelContextJavaBeanReferenceProviderTest/com/liferay/ide/model/MyModel.java: -------------------------------------------------------------------------------- 1 | package com.liferay.ide.model; 2 | 3 | public class MyModel { 4 | 5 | public String getName() { 6 | return null; 7 | } 8 | 9 | public String getDescription() { 10 | return null; 11 | } 12 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibModelContextJavaBeanReferenceProviderTest/com/liferay/ide/model/MySecondModel.java: -------------------------------------------------------------------------------- 1 | package com.liferay.ide.model; 2 | 3 | public class MySecondModel { 4 | 5 | public String getSecondaryDescription() { 6 | return null; 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibModelContextJavaBeanReferenceProviderTest/model-attribute-precedence.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibModelContextJavaBeanReferenceProviderTest/model-attribute.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibModelContextJavaBeanReferenceProviderTest/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibResourceBundleReferenceContributorTest/Language.properties: -------------------------------------------------------------------------------- 1 | lang=baz -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibResourceBundleReferenceContributorTest/edit.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> 2 | 3 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibResourceBundleReferenceContributorTest/foo.properties: -------------------------------------------------------------------------------- 1 | foo=bar -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibResourceBundleReferenceContributorTest/invalid.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> 2 | 3 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibResourceBundleReferenceContributorTest/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> 2 | 3 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibSearchContainerJavaBeanReferenceContributorTest/com/liferay/ide/model/MyModel.java: -------------------------------------------------------------------------------- 1 | package com.liferay.ide.model; 2 | 3 | public class MyModel { 4 | 5 | public String getName() { 6 | return null; 7 | } 8 | 9 | public String getDescription() { 10 | return null; 11 | } 12 | } -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibSearchContainerJavaBeanReferenceContributorTest/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibStrictQuoteEscapingInspectionTest/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> 2 | 3 | "<%=String.valueOf("foo")%>" /> 4 | 5 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibStrictQuoteEscapingInspectionTest/view_fixed.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibStringConcatInspectionTest/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | <% 4 | String bar = "bar"; 5 | %> 6 | "foo<%=bar%>" /> -------------------------------------------------------------------------------- /testdata/com/liferay/ide/idea/language/tag/LiferayTaglibStringConcatInspectionTest/view_fixed.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> 2 | 3 | <% 4 | String bar = "bar"; 5 | %> 6 | --------------------------------------------------------------------------------