### Eclipse Workspace Patch 1.0
#P org.jboss.tools.vpe.html.test
Index: src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java
===================================================================
--- src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java	(revision 30896)
+++ src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java	(working copy)
@@ -126,8 +126,8 @@
 		performContentTest("components/core/map.html"); //$NON-NLS-1$
 	}
 
-	public void testObject() throws Throwable {
-		performContentTest("components/core/object.html"); //$NON-NLS-1$
+	public void testObjectEmbed() throws Throwable {
+		performContentTest("components/core/object-embed.html"); //$NON-NLS-1$
 	}
 	
 	public void testParam() throws Throwable {
@@ -387,10 +387,6 @@
 		performContentTest("components/other/center.html"); //$NON-NLS-1$
 	}
 	
-	public void testEmbed() throws Throwable {
-		performContentTest("components/other/embed.html"); //$NON-NLS-1$
-	}
-	
 	public void testFont() throws Throwable {
 		performContentTest("components/other/font.html"); //$NON-NLS-1$
 	}
Index: resources/htmlTest/WebContent/pages/components/core/object-embed.html
===================================================================
--- resources/htmlTest/WebContent/pages/components/core/object-embed.html	(revision 0)
+++ resources/htmlTest/WebContent/pages/components/core/object-embed.html	(revision 0)
@@ -0,0 +1,18 @@
+<html>
+<body>
+Abc
+	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+		codebase="http://download.macromedia.com/pub/shockwave/
+cabs/flash/swflash.cab#version=6,0,40,0"
+		width="468" height="60" id="object1">
+		<param name="movie" value="example.swf" />
+		<param name="quality" value="high" />
+		<param name="bgcolor" value="#ffffff" />
+		<embed src="http://www.tizag.com/pics/example.swf" quality="high"
+			bgcolor="#ffffff" width="468" height="60" name="mymoviename" align=""
+			type="application/x-shockwave-flash"
+			pluginspage="http://www.macromedia.com/go/getflashplayer">
+	</object>
+Def
+</body>
+</html>
Index: resources/htmlTest/WebContent/pages/components/core/object-embed.html.xml
===================================================================
--- resources/htmlTest/WebContent/pages/components/core/object-embed.html.xml	(revision 0)
+++ resources/htmlTest/WebContent/pages/components/core/object-embed.html.xml	(revision 0)
@@ -0,0 +1,13 @@
+<tests>
+	<test id="object1">
+		<DIV CLASS="vpe-text" STYLE="display: inline-block; width: 468px; height: 60px;">
+			<OBJECT WIDTH="468" HEIGHT="60" ID="object1">
+				<DIV CLASS="vpe-text" STYLE="display: inline-block; width: 468px; height: 60px;">
+					<EMBED WIDTH="468" HEIGHT="60" ALIGN=""
+						PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" SRC="http://www.tizag.com/pics/example.swf">
+					</EMBED>
+				</DIV>
+			</OBJECT>
+		</DIV>
+	</test>
+</tests>
\ No newline at end of file
#P org.jboss.tools.vpe
Index: src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- src/org/jboss/tools/vpe/editor/util/HTML.java	(revision 30896)
+++ src/org/jboss/tools/vpe/editor/util/HTML.java	(working copy)
@@ -20,6 +20,7 @@
 	private HTML() {
 	}
 
+	public static final String TAG_EMBED = "embed"; //$NON-NLS-1$
 	public static final String TAG_HTML = "html"; //$NON-NLS-1$
 	public static final String TAG_HEAD = "head"; //$NON-NLS-1$
 	public static final String TAG_BODY = "body"; //$NON-NLS-1$
@@ -51,6 +52,7 @@
 	public static final String TAG_INPUT = "input"; //$NON-NLS-1$
 	public static final String TAG_BUTTON = "button"; //$NON-NLS-1$
 	public static final String TAG_OL = "ol"; //$NON-NLS-1$
+	public static final String TAG_OBJECT = "object"; //$NON-NLS-1$
 	public static final String TAG_UL = "ul"; //$NON-NLS-1$
 	public static final String TAG_CODE = "code"; //$NON-NLS-1$
 	public static final String TAG_PRE = "pre"; //$NON-NLS-1$
#P org.jboss.tools.vpe.html
Index: src/org/jboss/tools/vpe/html/template/HtmlObjectTemplate.java
===================================================================
--- src/org/jboss/tools/vpe/html/template/HtmlObjectTemplate.java	(revision 0)
+++ src/org/jboss/tools/vpe/html/template/HtmlObjectTemplate.java	(revision 0)
@@ -0,0 +1,28 @@
+package org.jboss.tools.vpe.html.template;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.tools.vpe.editor.util.HTML;
+
+/**
+ * Template for {@code <object>} tag.
+ * 
+ * @author Yahor Radtsevich
+ */
+public class HtmlObjectTemplate extends HtmlFlashAbstractTemplate {
+	List<String> ATTRIBUTES_TO_BE_COPIED = Arrays.asList(
+			"align", "height", "hspace", "vspace",  //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
+			"width", "id", "dir");					//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+
+	@Override
+	public String getTagName() {
+		return HTML.TAG_OBJECT;
+	}
+
+	@Override
+	public List<String> getAttributesToBeCopied() {
+		return ATTRIBUTES_TO_BE_COPIED;
+	}
+
+}
Index: src/org/jboss/tools/vpe/html/template/HtmlEmbedTemplate.java
===================================================================
--- src/org/jboss/tools/vpe/html/template/HtmlEmbedTemplate.java	(revision 0)
+++ src/org/jboss/tools/vpe/html/template/HtmlEmbedTemplate.java	(revision 0)
@@ -0,0 +1,28 @@
+package org.jboss.tools.vpe.html.template;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.tools.vpe.editor.util.HTML;
+
+/**
+ * Template for {@code <embed>} tag.
+ * 
+ * @author Yahor Radtsevich
+ */
+public class HtmlEmbedTemplate extends HtmlFlashAbstractTemplate {
+	List<String> ATTRIBUTES_TO_BE_COPIED = Arrays.asList(
+			"align", "height", "hidden", "hspace",	 //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
+			"pluginspage", "src", "vspace", "width");//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
+
+	@Override
+	public String getTagName() {
+		return HTML.TAG_EMBED;
+	}
+
+	@Override
+	public List<String> getAttributesToBeCopied() {
+		return ATTRIBUTES_TO_BE_COPIED;
+	}
+
+}
Index: templates/vpe-templates-html.xml
===================================================================
--- templates/vpe-templates-html.xml	(revision 30896)
+++ templates/vpe-templates-html.xml	(working copy)
@@ -1420,9 +1420,8 @@
 	</vpe:tag>
 
 	<vpe:tag name="object" case-sensitive="no">
-	<vpe:template children="yes" modify="no">
-		<vpe:copy
-			attrs="align,height,hspace,vspace,width,id,dir" />
+	<vpe:template children="yes" modify="no"
+			class="org.jboss.tools.vpe.html.template.HtmlObjectTemplate">
 		<vpe:dnd>
 			<vpe:drop container="yes">
 				<vpe:container-child tag-name="param" />
@@ -1434,10 +1433,9 @@
 	</vpe:tag>
 	
 	<vpe:tag name="embed" case-sensitive="no">
-	<vpe:template children="yes" modify="no">
-		<vpe:copy
-			attrs="align,height,hidden,hspace,pluginspage,src,vspace,width" />
-	</vpe:template>
+		<vpe:template children="yes" modify="no"
+				class="org.jboss.tools.vpe.html.template.HtmlEmbedTemplate">
+		</vpe:template>
 	</vpe:tag>
 
 	<vpe:tag name="ol" case-sensitive="no">
Index: src/org/jboss/tools/vpe/html/template/HtmlFlashAbstractTemplate.java
===================================================================
--- src/org/jboss/tools/vpe/html/template/HtmlFlashAbstractTemplate.java	(revision 0)
+++ src/org/jboss/tools/vpe/html/template/HtmlFlashAbstractTemplate.java	(revision 0)
@@ -0,0 +1,70 @@
+package org.jboss.tools.vpe.html.template;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Base template for {@code <object>} and {@code <embed>} tags.
+ * 
+ * @author Yahor Radtsevich
+ */
+public abstract class HtmlFlashAbstractTemplate extends VpeAbstractTemplate {
+	@Override
+	public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+			nsIDOMDocument visualDocument) {
+		Element sourceElement = (Element) sourceNode;
+		nsIDOMElement wrapper = VisualDomUtil
+				.createBorderlessContainer(visualDocument, HTML.TAG_DIV);
+		String wrapperStyle = "display:inline-block;";  //$NON-NLS-1$
+		if (sourceElement.hasAttribute(HTML.ATTR_WIDTH)) {
+			try {
+				int width = Integer.parseInt(sourceElement.getAttribute(HTML.ATTR_WIDTH));
+				wrapperStyle = VpeStyleUtil.setSizeInStyle(wrapperStyle,
+						HTML.STYLE_PARAMETER_WIDTH, width);
+			} catch (NumberFormatException e) {
+			}
+		}
+		if (sourceElement.hasAttribute(HTML.ATTR_HEIGHT)) {
+			try {
+				int height = Integer.parseInt(sourceElement.getAttribute(HTML.ATTR_HEIGHT));
+				wrapperStyle = VpeStyleUtil.setSizeInStyle(wrapperStyle,
+						HTML.STYLE_PARAMETER_HEIGHT, height);
+			} catch (NumberFormatException e) {
+			}
+		}
+
+		wrapper.setAttribute(HTML.ATTR_STYLE, wrapperStyle);
+		
+		nsIDOMElement objectElement = visualDocument.createElement(getTagName());
+		wrapper.appendChild(objectElement);
+		VisualDomUtil.copyAttributes(sourceElement, objectElement, getAttributesToBeCopied());
+
+		VpeChildrenInfo childrenInfo = new VpeChildrenInfo(objectElement);
+		NodeList children = sourceElement.getChildNodes();
+		for (int i = 0; i < children.getLength(); i++) {
+			childrenInfo.addSourceChild(children.item(i));
+		}
+
+		VpeCreationData creationData = new VpeCreationData(wrapper);
+		creationData.addChildrenInfo(childrenInfo);
+
+		return creationData;
+	}
+	
+	public abstract String getTagName();
+	public abstract List<String> getAttributesToBeCopied();
+
+}
