Author: vrubezhny
Date: 2011-07-27 16:46:25 -0400 (Wed, 27 Jul 2011)
New Revision: 33269
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/MessagePropertyELSegmentImpl.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
Log:
JBIDE-9087
Support of Bundles bean in CDI projects with Seam International module.
Text labels are fixed for Messages EL hyperlinks
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java 2011-07-27
19:31:12 UTC (rev 33268)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java 2011-07-27
20:46:25 UTC (rev 33269)
@@ -34,6 +34,9 @@
public static String RENAME_MESSAGE_PROPERTY_PROCESSOR_CAN_NOT_FIND_MESSAGE_PROPERTY;
public static String Open;
+ public static String OpenBundle;
+ public static String OpenBundleProperty;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, ElCoreMessages.class);
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties 2011-07-27
19:31:12 UTC (rev 33268)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties 2011-07-27
20:46:25 UTC (rev 33269)
@@ -27,3 +27,6 @@
RENAME_MESSAGE_PROPERTY_PROCESSOR_CAN_NOT_FIND_MESSAGE_PROPERTY=Can not find message:
''{0}''.
Open=Open ''{0}''
+
+OpenBundle=Open bundle ''{0}''
+OpenBundleProperty=Open property ''{0}'' of bundle
''{1}''
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/MessagePropertyELSegmentImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/MessagePropertyELSegmentImpl.java 2011-07-27
19:31:12 UTC (rev 33268)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/MessagePropertyELSegmentImpl.java 2011-07-27
20:46:25 UTC (rev 33269)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,12 +10,15 @@
******************************************************************************/
package org.jboss.tools.common.el.core.resolver;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.el.core.ElCoreMessages;
+import org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine;
import org.jboss.tools.common.el.core.parser.LexicalToken;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.FindObjectHelper;
@@ -110,8 +113,17 @@
public String getLabel() {
XModelObject p = o;
while(p != null && p.getFileType() < XModelObject.FILE) p =
p.getParent();
+
+ // Improve label - add a locale for a resource bundle
+ String baseName = getBaseName();
+ String propertyName = isBundle() ? null :
AbstractELCompletionEngine.trimQuotes(getToken().getText());
+ if (propertyName == null)
+ return MessageFormat.format(ElCoreMessages.OpenBundle, baseName);
+
+ return MessageFormat.format(ElCoreMessages.OpenBundleProperty, propertyName,
baseName);
+
//improve label - now it returns file name, with locale
- return p.getAttributeValue("name");
+// return p.getAttributeValue("name");
}
@Override
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-07-27
19:31:12 UTC (rev 33268)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-07-27
20:46:25 UTC (rev 33269)
@@ -547,10 +547,11 @@
segment.setMessagePropertySourceReference(h.getStart(), name.length());
IFile propFile = (IFile)p.getAdapter(IFile.class);
- if(propFile == null)
- continue;
- segment.setMessageBundleResource(propFile);
+ if(propFile != null)
+ segment.setMessageBundleResource(propFile);
}
+ segment.setBaseName(variable.basename);
+ segment.setBundleOnlySegment(false);
}
}
}
Show replies by date