woproject/projects/wolips/plugins/org.objectstyle.wolips.htmleditor/java/org/objectstyle/wolips/htmleditor/editor/contentmodel WebObjectsHCMDocImpl.java,1.1,1.2 WebObjectsElementCollection.java,1.2,1.3 WebObjectsComplexTypeDefinitionFactory.java,1.1,1.2 WebObjectsHTML40Namespace.java,1.1,1.2 HedWEBOBJECT.java,1.2,1.3

[email protected]
Newsgroups gmane.comp.web.webobjects.woproject.cvs
Message-ID <[email protected]>
Update of /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.htmleditor/java/org/objectstyle/wolips/htmleditor/editor/contentmodel
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16238/java/org/objectstyle/wolips/htmleditor/editor/contentmodel

Modified Files:
	WebObjectsHCMDocImpl.java WebObjectsElementCollection.java 
	WebObjectsComplexTypeDefinitionFactory.java 
	WebObjectsHTML40Namespace.java HedWEBOBJECT.java 
Log Message:
documentation, etc added so that the code could be attached to the WTP bug report

Index: WebObjectsHCMDocImpl.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.htmleditor/java/org/objectstyle/wolips/htmleditor/editor/contentmodel/WebObjectsHCMDocImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- WebObjectsHCMDocImpl.java	29 Oct 2005 17:22:15 -0000	1.1
+++ WebObjectsHCMDocImpl.java	27 Dec 2005 21:52:30 -0000	1.2
@@ -25,7 +25,10 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
 
 /**
- * CMDocument implementation for the HTML.
+ * CMDocument implementation for the HTML that only exists to wire up 
+ * WebObjectsElementCollection instead of ElementCollection.
+ * 
+ * @author mschrag
  */
 public class WebObjectsHCMDocImpl extends CMNodeImpl implements HTMLCMDocument {
 

Index: WebObjectsElementCollection.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.htmleditor/java/org/objectstyle/wolips/htmleditor/editor/contentmodel/WebObjectsElementCollection.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- WebObjectsElementCollection.java	8 Nov 2005 13:12:54 -0000	1.2
+++ WebObjectsElementCollection.java	27 Dec 2005 21:52:30 -0000	1.3
@@ -6,6 +6,11 @@
 import org.eclipse.wst.html.core.internal.contentmodel.ElementCollection;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
 
+/**
+ * ElementCollection subclass that adds WebObjects as a known block tag.
+ *  
+ * @author mschrag
+ */
 public class WebObjectsElementCollection extends ElementCollection implements WebObjectsHTML40Namespace.ElementName {
   private static String[] fNamesWithWebObject;
   

Index: WebObjectsComplexTypeDefinitionFactory.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.htmleditor/java/org/objectstyle/wolips/htmleditor/editor/contentmodel/WebObjectsComplexTypeDefinitionFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- WebObjectsComplexTypeDefinitionFactory.java	8 Nov 2005 13:12:54 -0000	1.1
+++ WebObjectsComplexTypeDefinitionFactory.java	27 Dec 2005 21:52:30 -0000	1.2
@@ -1,8 +1,5 @@
 package org.objectstyle.wolips.htmleditor.editor.contentmodel;
 
-import java.util.HashSet;
-import java.util.Set;
-
 import org.eclipse.wst.html.core.internal.contentmodel.CMContentImpl;
 import org.eclipse.wst.html.core.internal.contentmodel.CMGroupImpl;
 import org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition;
@@ -11,23 +8,24 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
 
+/**
+ * Custom implementation of ComplexTypeDefinitionFactory that hooks into each CTD 
+ * and adds support for it to contain 1 or more webobject tags.
+ * 
+ * @author mschrag
+ */
 public class WebObjectsComplexTypeDefinitionFactory extends ComplexTypeDefinitionFactory {
-  private Set myAlreadyConvertedDefs;
-
   public WebObjectsComplexTypeDefinitionFactory() {
-    myAlreadyConvertedDefs = new HashSet();
   }
 
   protected ComplexTypeDefinition createUncachedTypeDefinition(String _definitionName, ElementCollection _elementCollection) {
     ComplexTypeDefinition def = super.createUncachedTypeDefinition(_definitionName, _elementCollection);
-    if (!myAlreadyConvertedDefs.contains(_definitionName)) {
-      CMGroupImpl content = (CMGroupImpl) def.getContent();
-      CMGroupImpl wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
-      content.appendChild(wrap);
-      CMNode dec = _elementCollection.getNamedItem(WebObjectsHTML40Namespace.ElementName.WEBOBJECT);
-      if (dec != null) {
-        wrap.appendChild(dec);
-      }
+    CMGroupImpl content = (CMGroupImpl) def.getContent();
+    CMGroupImpl wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
+    content.appendChild(wrap);
+    CMNode dec = _elementCollection.getNamedItem(WebObjectsHTML40Namespace.ElementName.WEBOBJECT);
+    if (dec != null) {
+      wrap.appendChild(dec);
     }
     return def;
   }

Index: WebObjectsHTML40Namespace.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.htmleditor/java/org/objectstyle/wolips/htmleditor/editor/contentmodel/WebObjectsHTML40Namespace.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- WebObjectsHTML40Namespace.java	8 Nov 2005 13:12:54 -0000	1.1
+++ WebObjectsHTML40Namespace.java	27 Dec 2005 21:52:30 -0000	1.2
@@ -2,6 +2,11 @@
 
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 
+/**
+ * Adds a constant for the WebObject tag name.
+ * 
+ * @author mschrag
+ */
 public interface WebObjectsHTML40Namespace extends HTML40Namespace {
   public static interface ElementName extends HTML40Namespace.ElementName {
     public static final String WEBOBJECT = "WEBOBJECT"; //$NON-NLS-1$

Index: HedWEBOBJECT.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.htmleditor/java/org/objectstyle/wolips/htmleditor/editor/contentmodel/HedWEBOBJECT.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- HedWEBOBJECT.java	8 Nov 2005 13:12:54 -0000	1.2
+++ HedWEBOBJECT.java	27 Dec 2005 21:52:30 -0000	1.3
@@ -25,7 +25,12 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
- * WEBOBJECT.
+ * WEBOBJECT.  Right now this is a FlowContainer, which behaves basically
+ * like a DIV tag.  This is not strictly correct since DIV can't contain
+ * a TR, TD, etc.  So eventually this will change to be something slightly
+ * different that can basically contain any tag.
+ * 
+ * @author mschrag
  */
 public class HedWEBOBJECT extends HedFlowContainer {
 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.