nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
amywu | 923ee60 | 2007-04-10 18:32:07 +0000 | [diff] [blame] | 2 | * Copyright (c) 2004, 2005 IBM Corporation and others. |
nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 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 |
amywu | 923ee60 | 2007-04-10 18:32:07 +0000 | [diff] [blame] | 7 | * |
nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 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; |
| 19 | import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType; |
nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 20 | |
| 21 | /** |
| 22 | * BDO. |
| 23 | */ |
| 24 | final class HedBDO extends HedInlineContainer { |
| 25 | |
| 26 | /** |
| 27 | */ |
| 28 | public HedBDO(ElementCollection collection) { |
| 29 | super(HTML40Namespace.ElementName.BDO, collection); |
| 30 | // CORRECT_EMPTY - GROUP_COMPACT |
| 31 | correctionType = CORRECT_EMPTY; |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * %coreattrs; |
| 36 | * (lang %LanguageCode; #IMPLIED) |
| 37 | * (dir (ltr|rtl) #REQUIRED) ... should be defined locally. |
| 38 | */ |
| 39 | protected void createAttributeDeclarations() { |
| 40 | if (attributes != null) |
| 41 | return; // already created. |
| 42 | if (attributeCollection == null) |
| 43 | return; // fatal |
| 44 | |
| 45 | attributes = new CMNamedNodeMapImpl(); |
| 46 | |
| 47 | // %coreattrs; |
| 48 | attributeCollection.getCore(attributes); |
| 49 | |
| 50 | String[] names = {HTML40Namespace.ATTR_NAME_LANG}; |
| 51 | attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator()); |
| 52 | |
| 53 | // (dir (ltr|rtl) #REQUIRED) ... should be defined locally. |
| 54 | HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM); |
| 55 | String[] values = {HTML40Namespace.ATTR_VALUE_LTR, HTML40Namespace.ATTR_VALUE_RTL}; |
| 56 | atype.setEnumValues(values); |
| 57 | |
| 58 | HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_DIR, atype, CMAttributeDeclaration.REQUIRED); |
| 59 | attributes.putNamedItem(HTML40Namespace.ATTR_NAME_DIR, attr); |
| 60 | } |
amywu | 923ee60 | 2007-04-10 18:32:07 +0000 | [diff] [blame] | 61 | } |