blob: e381ed3a0913388a10fa10d38994b207afb642da [file] [log] [blame]
nitind958d79a2004-11-23 19:23:00 +00001/*******************************************************************************
2 * Copyright (c) 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
david_williams56777022005-04-11 06:21:55 +000011package org.eclipse.wst.html.core.internal.contentmodel;
nitind958d79a2004-11-23 19:23:00 +000012
13
14
15import java.util.Arrays;
16
david_williams4ad020f2005-04-18 08:00:30 +000017import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
david_williamsc06c86f2005-03-18 18:23:41 +000018import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
nitind958d79a2004-11-23 19:23:00 +000019
20/**
21 * COL.
22 */
23final class HedCOL extends HedEmpty {
24
25 /**
26 */
27 public HedCOL(ElementCollection collection) {
28 super(HTML40Namespace.ElementName.COL, collection);
29 // LAYOUT_BLOCK.
30 // Because, COL is GROUP_BLOCK in the C++DOM/DTDParser.cpp.
31 layoutType = LAYOUT_BLOCK;
32 }
33
34 /**
35 * COL.
36 * %attrs;
37 * (span NUMBER 1)
38 * (width %MultiLength; #IMPLIED) ... should be defined locally.
39 * %cellhalign;
40 * %cellvalign;
41 */
42 protected void createAttributeDeclarations() {
43 if (attributes != null)
44 return; // already created.
45 if (attributeCollection == null)
46 return; // fatal
47
48 attributes = new CMNamedNodeMapImpl();
49
50 // %attrs;
51 attributeCollection.getAttrs(attributes);
52
53 // (span NUMBER 1)
54 String[] names = {HTML40Namespace.ATTR_NAME_SPAN};
55 attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
56
57 // (width %MultiLength; #IMPLIED) ... should be defined locally.
58 HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MULTI_LENGTH);
59 HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
60 attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
61
62 // %cellhalign;
63 attributeCollection.getCellhalign(attributes);
64 // %cellvalign;
65 attributeCollection.getCellvalign(attributes);
66 }
67}