nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 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_williams | 5677702 | 2005-04-11 06:21:55 +0000 | [diff] [blame] | 11 | package org.eclipse.wst.html.core.internal.contentmodel; |
nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 12 | |
| 13 | |
| 14 | |
| 15 | import java.util.Arrays; |
| 16 | |
david_williams | 4ad020f | 2005-04-18 08:00:30 +0000 | [diff] [blame] | 17 | import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace; |
david_williams | c06c86f | 2005-03-18 18:23:41 +0000 | [diff] [blame] | 18 | import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration; |
nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 19 | |
| 20 | /** |
| 21 | * COL. |
| 22 | */ |
| 23 | final 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 | } |