Author: vrubezhny
Date: 2011-07-27 11:55:16 -0400 (Wed, 27 Jul 2011)
New Revision: 33251
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java
Log:
JBIDE-9087
Support of Bundles bean in CDI projects with Seam International module.
Check for Seam3 International Module presence is added to all needed entries
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java 2011-07-27
15:54:48 UTC (rev 33250)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java 2011-07-27
15:55:16 UTC (rev 33251)
@@ -119,9 +119,7 @@
return null;
IBundleModel bundleModel = BundleModelFactory.getBundleModel(project);
- if (bundleModel == null)
- return null;
- IResourceBundle[] bundles = findResourceBundles(bundleModel);
+ IResourceBundle[] bundles = bundleModel == null ? null :
findResourceBundles(bundleModel);
if (bundles == null)
return null;
@@ -149,14 +147,21 @@
public ELResolutionImpl resolveELOperand(ELExpression operand,
ELContext context, boolean returnEqualedVariablesOnly) {
- IResourceBundle[] bundles = new IResourceBundle[0];
- if(context instanceof IPageContext) {
- IBundleModel bundleModel =
BundleModelFactory.getBundleModel(context.getResource().getProject());
- if (bundleModel != null) {
- bundles = findResourceBundles(bundleModel);
- }
- }
+ IProject project = context == null ? null :
+ context.getResource() == null ? null :
+ context.getResource().getProject();
+ if (project == null)
+ return null;
+
+ if (!CDICorePlugin.getCDI(project,
true).getExtensionManager().isCDIExtensionAvailable(CDISeamCorePlugin.CDI_INTERNATIONAL_RUNTIME_EXTENTION))
+ return null;
+
+ IBundleModel bundleModel =
BundleModelFactory.getBundleModel(context.getResource().getProject());
+ IResourceBundle[] bundles = bundleModel == null ? null :
findResourceBundles(bundleModel);
+ if (bundles == null)
+ return null;
+
try {
return resolveELOperand(context.getResource(), operand, returnEqualedVariablesOnly,
bundles);
} catch (StringIndexOutOfBoundsException e) {
Show replies by date