Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgkessler2010-03-09 23:44:24 +0000
committergkessler2010-03-09 23:44:24 +0000
commitce4d172523c219c62b89c5eb82655b9799d94ab2 (patch)
tree97d9ac772b5eed700d3b506241359396554a3bad
parent642b2ebd4e6617bcee83da4dc64c9994cbb4058d (diff)
downloadwebtools.jsf-ce4d172523c219c62b89c5eb82655b9799d94ab2.tar.gz
webtools.jsf-ce4d172523c219c62b89c5eb82655b9799d94ab2.tar.xz
webtools.jsf-ce4d172523c219c62b89c5eb82655b9799d94ab2.zip
Updated thread-safe PaletteItemMgr using ITagRegistries. Palette now also reacts to tag libs coming and going from the classpath.
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java
index 03b28b26e..456e58f23 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java
@@ -170,15 +170,37 @@ public final class CompositeTagRegistryFactory
_contentType = contentType;
}
- IProject getProject()
+ /**
+ * @return project
+ */
+ public IProject getProject()
{
return _project;
}
- IContentType getContentType()
+ /**
+ * @return content type
+ */
+ public IContentType getContentType()
{
return _contentType;
}
+
+ public boolean equals(final Object o) {
+ if (o instanceof TagRegistryIdentifier) {
+ final TagRegistryIdentifier other = (TagRegistryIdentifier)o;
+ final int otherProjectHash = other.getProject() != null ? other.getProject().hashCode() : 0;
+ final int thisProjectHash = getProject() != null ? getProject().hashCode() : 0;
+ if (otherProjectHash == thisProjectHash &&
+ other.getContentType().equals(this.getContentType()))
+ return true;
+ }
+ return false;
+ }
+
+ public int hashCode() {
+ return (getProject() != null ? getProject().hashCode() : 0) + 7*_contentType.hashCode();
+ }
}

Back to the top