blob: a9de98ac4188f21232a26f71e30ee5d4fd2225a3 [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_williams63219a22005-04-10 01:59:51 +000011package org.eclipse.wst.css.core.internal.metamodelimpl;
nitind958d79a2004-11-23 19:23:00 +000012
david_williams63219a22005-04-10 01:59:51 +000013import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
14import org.eclipse.wst.css.core.internal.metamodel.CSSMMStyleSheet;
nitind958d79a2004-11-23 19:23:00 +000015
16class CSSMMStyleSheetImpl extends CSSMMNodeImpl implements CSSMMStyleSheet {
17
18
19 public CSSMMStyleSheetImpl() {
20 super();
21 }
22
23 public String getType() {
24 return TYPE_STYLE_SHEET;
25 }
26
27 public String getName() {
28 return NAME_NOT_AVAILABLE;
29 }
30
31 /*
32 * @see CSSMMNodeImpl#canContain(CSSMMNode)
33 */
34 boolean canContain(CSSMMNode child) {
35 if (child == null) {
36 return false;
37 }
38 String type = child.getType();
39 return (type == TYPE_CHARSET_RULE || type == TYPE_IMPORT_RULE || type == TYPE_PAGE_RULE || type == TYPE_MEDIA_RULE || type == TYPE_FONT_FACE_RULE || type == TYPE_STYLE_RULE);
40 }
41
42 short getError() {
43 if (getChildCount() == 0) {
44 return MetaModelErrors.ERROR_NO_CHILD;
45 }
46 else {
47 return MetaModelErrors.NO_ERROR;
48 }
49 }
50}