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 | *******************************************************************************/ |
| 11 | package org.eclipse.wst.css.core.util; |
| 12 | |
| 13 | |
| 14 | |
| 15 | import org.eclipse.wst.css.core.document.ICSSStyleDeclaration; |
| 16 | import org.eclipse.wst.css.core.internal.document.CSSStyleDeclarationFactoryContext; |
| 17 | |
| 18 | |
| 19 | /** |
| 20 | * |
| 21 | */ |
| 22 | public class CSSStyleDeclarationFactory extends CSSStyleDeclarationFactoryContext { |
| 23 | |
| 24 | private static CSSStyleDeclarationFactory fInstance = null; |
| 25 | |
| 26 | /** |
| 27 | * CSSStyleDeclarationFactory constructor comment. |
| 28 | */ |
| 29 | private CSSStyleDeclarationFactory() { |
| 30 | super(); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @return org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclaration |
| 35 | * @param decl |
| 36 | * org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclaration |
| 37 | */ |
| 38 | public ICSSStyleDeclaration createStyleDeclaration(ICSSStyleDeclaration decl) { |
| 39 | if (decl == null) { |
| 40 | return null; |
| 41 | } |
| 42 | // 11/22/2004, nsd, nothing's done with this variable |
| 43 | // ICSSStyleDeclaration newNode = createStyleDeclaration(); |
| 44 | |
| 45 | // 05/11/2004, dmw, unnecessary cast, looks like it was always |
| 46 | // returning null! |
| 47 | // so something is probably amiss |
| 48 | // if (!(newNode instanceof ICSSDocument)) { |
| 49 | return null; |
| 50 | // } |
| 51 | // fOwnerDocument = newNode; |
| 52 | // cloneChildNodes(decl, newNode); |
| 53 | // return newNode; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * |
| 58 | */ |
| 59 | public synchronized static CSSStyleDeclarationFactory getInstance() { |
| 60 | if (fInstance == null) { |
| 61 | fInstance = new CSSStyleDeclarationFactory(); |
| 62 | } |
| 63 | return fInstance; |
| 64 | } |
| 65 | } |