Author: scabanovich
Date: 2008-03-27 12:43:17 -0400 (Thu, 27 Mar 2008)
New Revision: 7152
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
Log:
JBIDE-1258
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2008-03-27
16:38:10 UTC (rev 7151)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2008-03-27
16:43:17 UTC (rev 7152)
@@ -119,13 +119,15 @@
if(javaDeclaration != null) return javaDeclaration.getPrecedence();
return 20;
}
+
+ static Set<ISeamComponentMethod> EMPTY = new
HashSet<ISeamComponentMethod>();
/**
* @see org.jboss.tools.seam.core.ISeamComponent#getMethods()
*/
public Set<ISeamComponentMethod> getMethods() {
ISeamJavaComponentDeclaration javaDeclaration = getJavaDeclaration();
- return (javaDeclaration == null) ? null : javaDeclaration.getMethods();
+ return (javaDeclaration == null) ? EMPTY : javaDeclaration.getMethods();
}
/**
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java 2008-03-27
16:38:10 UTC (rev 7151)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java 2008-03-27
16:43:17 UTC (rev 7152)
@@ -74,8 +74,8 @@
IResource r1 = resources.get(s);
if(r1 == null || !r2.equals(r1)) return true;
long l1 = r1.getLocalTimeStamp();
- long l2 = timestamps.get(s);
- if(l1 != l2) return true;
+ Long l2 = timestamps.get(s);
+ if(l2 == null || l1 != l2.longValue()) return true;
}
return false;
@@ -101,6 +101,15 @@
String b = s.getValue().getValue();
names.add(b);
}
+ } else if(v instanceof ISeamValueString) {
+ ISeamValueString s = (ISeamValueString)v;
+ if(s.getValue() == null) continue;
+ String b = s.getValue().getValue();
+ if(b == null || b.length() == 0) continue;
+ String[] bi = b.split(",");
+ for (int i = 0; i < bi.length; i++) {
+ names.add(bi[i].trim());
+ }
}
}
if(ds.size() == 0) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2008-03-27
16:38:10 UTC (rev 7151)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2008-03-27
16:43:17 UTC (rev 7152)
@@ -1547,13 +1547,8 @@
}
public void postBuild() {
- Set<ISeamFactory> fff =
getFactoriesByName("org.jboss.seam.international.messages");
- if(fff.size() > 0) {
- ISeamFactory m = fff.iterator().next();
- if(m instanceof SeamMessages) {
- SeamMessages sm = (SeamMessages)m;
- sm.revalidate();
- }
+ if(factories.messages != null) {
+ factories.messages.revalidate();
}
}
@@ -1754,10 +1749,12 @@
class FactoryStorage {
protected Set<ISeamFactory> allFactories = new HashSet<ISeamFactory>();
Map<IPath, Set<ISeamFactory>> factoriesBySource = new HashMap<IPath,
Set<ISeamFactory>>();
+ SeamMessages messages = null;
public void clear() {
allFactories.clear();
factoriesBySource.clear();
+ messages = null;
}
public Set<ISeamFactory> getFactoriesBySource(IPath path) {
@@ -1776,6 +1773,9 @@
fs.add(f);
}
addVariable(f);
+ if(f instanceof SeamMessages) {
+ messages = (SeamMessages)f;
+ }
}
public void removeFactory(ISeamFactory f) {
@@ -1791,6 +1791,9 @@
}
}
removeVariable(f);
+ if(f == messages) {
+ messages = null;
+ }
}
public Set<ISeamFactory> removePath(IPath path) {
@@ -1799,6 +1802,7 @@
for (ISeamFactory f: fs) {
allFactories.remove(f);
removeVariable(f);
+ if(f == messages) messages = null;
}
factoriesBySource.remove(path);
return fs;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2008-03-27
16:38:10 UTC (rev 7151)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2008-03-27
16:43:17 UTC (rev 7152)
@@ -26,6 +26,8 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.event.ISeamValue;
+import org.jboss.tools.seam.core.event.ISeamValueString;
import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamProperty;
import org.jboss.tools.seam.internal.core.SeamValueList;
@@ -37,6 +39,7 @@
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.ScannerException;
+import org.jboss.tools.seam.internal.core.scanner.java.ValueInfo;
/**
* @author Viacheslav Kabanovich
@@ -229,6 +232,30 @@
vl.addValue(v);
}
p.setValue(vl);
+
+ //Sometimes there is an attribute for the same property
+ SeamProperty pa = (SeamProperty)component.getProperty(cname);
+ if(pa != null) {
+ ISeamValue v = pa.getValue();
+ if(v instanceof ISeamValueString) {
+ ISeamValueString s = (ISeamValueString)v;
+ if(s.getValue() != null) {
+ String ss = s.getValue().getValue();
+ if(ss != null && ss.length() > 0) {
+ String[] qs = ss.split(",");
+ for (int i = 0; i < qs.length; i++) {
+ SeamValueString vi = new SeamValueString();
+ vi.setId(pa.getId());
+ ValueInfo info = new ValueInfo();
+ info.setValue(qs[i]);
+ vi.setValue(info);
+ vl.addValue(vi);
+ }
+ }
+ }
+ }
+ }
+
} else {
//this is map value
SeamValueMap vm = new SeamValueMap();
Show replies by date