nitind | b0f7b26 | 2004-11-23 19:12:23 +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.jst.jsp.core.internal.parser.internal; |
| 12 | |
| 13 | import org.eclipse.jst.jsp.core.internal.parser.JSPDirectiveStructuredDocumentRegion; |
david_williams | 4ad020f | 2005-04-18 08:00:30 +0000 | [diff] [blame] | 14 | import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion; |
nitind | b0f7b26 | 2004-11-23 19:12:23 +0000 | [diff] [blame] | 15 | import org.eclipse.wst.xml.core.internal.parser.XMLStructuredRegionFactory; |
| 16 | |
| 17 | /** |
| 18 | * A simple class to generate instances of StructuredRegions. |
| 19 | */ |
| 20 | public class JSPStructuredRegionFactory extends XMLStructuredRegionFactory { |
| 21 | |
| 22 | public static IStructuredDocumentRegion createRegion(int type) { |
| 23 | IStructuredDocumentRegion instance = null; |
| 24 | switch (type) { |
| 25 | case JSP_DIRECTIVE : |
| 26 | instance = new JSPDirectiveStructuredDocumentRegion(); |
| 27 | break; |
| 28 | default : |
| 29 | instance = XMLStructuredRegionFactory.createRegion(type); |
| 30 | } |
| 31 | return instance; |
| 32 | } |
| 33 | |
| 34 | } |