Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'docs/org.eclipse.wst.wsdl.ui.doc.user/tasks/tsetprtt.html')
-rw-r--r--docs/org.eclipse.wst.wsdl.ui.doc.user/tasks/tsetprtt.html179
1 files changed, 0 insertions, 179 deletions
diff --git a/docs/org.eclipse.wst.wsdl.ui.doc.user/tasks/tsetprtt.html b/docs/org.eclipse.wst.wsdl.ui.doc.user/tasks/tsetprtt.html
deleted file mode 100644
index d3c0d5275..000000000
--- a/docs/org.eclipse.wst.wsdl.ui.doc.user/tasks/tsetprtt.html
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Setting a port type" />
-<meta name="abstract" content="A port type is a named set of abstract operations and the abstract messages involved. Each operation refers to an input message and output messages. A port type is referenced by a binding object. Each binding references exactly one port type. Since each port refers to exactly one binding, each port has exactly one port type." />
-<meta name="description" content="A port type is a named set of abstract operations and the abstract messages involved. Each operation refers to an input message and output messages. A port type is referenced by a binding object. Each binding references exactly one port type. Since each port refers to exactly one binding, each port has exactly one port type." />
-<meta content="WSDL, setting port types, Web services" name="DC.subject" />
-<meta content="WSDL, setting port types, Web services" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsetprtt" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Setting a port type</title>
-</head>
-<body id="tsetprtt"><a name="tsetprtt"><!-- --></a>
-
-
-<h1 class="topictitle1">Setting a port type</h1>
-
-
-
-<div><p>A port type is a named set of abstract operations and the abstract
-messages involved. Each operation refers to an input message and output messages.
-A port type is referenced by a binding object. Each binding references exactly
-one port type. Since each port refers to exactly one binding, each port has
-exactly one port type.</p>
-
-<div class="section"><p>You can create a port type by right clicking in any blank space
-in the Design view and selecting <span class="uicontrol">Add PortType</span>. As a
-convenience you can also add a port type via a binding. This allows you to
-create a port type and modify the binding to reference the new port type in
-one action. You can either create a new port type for your binding, re-use
-an existing one, or import one.</p>
-</div>
-
-</div>
-
-<div class="nested1" id="createporttype"><a name="createporttype"><!-- --></a>
-<h2 class="topictitle2">Create a new port type for a binding</h2>
-
-<div>
-<div class="section"><p>If you want to create a new port type for your binding, follow
-these steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Design view, right-click on a binding object (note that
-port must reference a binding) and click <strong>Set Port Type &gt; New PortType</strong>.</span>
-</li>
-
-<li class="stepexpand"><span>Type the name of the port type in the <strong>Name</strong> field.</span>
- The name should be unique name among all port types defined within in
-the enclosing WSDL document. Click <strong>OK</strong>. To select the new port type,
-click the port type object.</li>
-
-<li class="stepexpand"><span>In the Properties view, type any information about the port type
-you wish the user to read in the <strong>Documentation</strong> pane.</span></li>
-
-</ol>
-
-<div class="section"><p> <strong>Tip</strong>: You can also create a new port type for your binding
-using the Outline view.</p>
-<p>Once you have created a port type, you can add
-operations to it, which can send and receive messages.</p>
-</div>
-
-</div>
-
-</div>
-
-<div class="nested1" id="reuseporttype"><a name="reuseporttype"><!-- --></a>
-<h2 class="topictitle2">Reuse a port type for a binding</h2>
-
-<div>
-<div class="section"><p>If you want to reuse a port type for your binding, follow these
-steps:</p>
-</div>
-
-<ol>
-<li><span>In the Design view, right-click on a binding object (note that
-port must reference a binding) and click <strong>Set Port Type &gt; Existing PortType</strong>.</span>
-</li>
-
-<li><span>In the <strong>Name</strong> field, type a search string to filter the list
-or leave the field blank to view all.</span></li>
-
-<li><span>You can change the scope of the list by selecting one of the following
-options:</span>
-<ul>
-<li><strong>Workspace</strong>. Lists the port types available in your workspace.</li>
-
-<li><strong>Enclosing Project</strong>. Lists the port types available in the project
-that contains your file.</li>
-
-<li><strong>Current Resource</strong>. Lists the port types available in your current
-file.</li>
-
-<li><strong>Working Sets</strong>. Lists the port types available in a specified
-set of files. To specify a working set, click <strong>Choose</strong>. You can select
-files from an existing working set or create a new working set. Once you have
-selected the files, click <strong>OK</strong>.</li>
-
-</ul>
-
-</li>
-
-<li><span>The existing port types will be listed. Select one and click <strong>OK</strong>.</span>
-</li>
-
-</ol>
-
-</div>
-
-</div>
-
-<div class="nested1" id="importporttype"><a name="importporttype"><!-- --></a>
-<h2 class="topictitle2">Import a port type for a binding</h2>
-
-<div>
-<div class="section"><p>If you want to import an existing port type for your binding,
-follow these steps:</p>
-</div>
-
-<ol>
-<li><span>In the Design view, right-click on a binding object (note that
-port must reference a binding) and click <strong>Set Port Type &gt; Existing PortType.</strong></span>
-</li>
-
-<li><span>In the <strong>Name</strong> field, type a search string to filter the list
-or leave the field blank to view all.</span></li>
-
-<li><span>You can import a port type by selecting one of the following options:</span>
-<ul>
-<li><strong>Workspace</strong>. Lists the port types available in your workspace.</li>
-
-<li><strong>Enclosing Project</strong>. Lists the port types available in the project
-that contains your file.</li>
-
-<li><strong>Working Sets</strong>. Lists the port types available in a specified
-set of files. To specify a working set, click <strong>Choose</strong>. You can select
-files from an existing working set or create a new working set. Once you have
-selected the files, click <strong>OK</strong>.</li>
-
-</ul>
-
-</li>
-
-<li><span>The port types will be listed. Select one and click <strong>OK</strong>.
-In the Design view, click the port type object.</span></li>
-
-<li><span>In the Properties view, type any information about the port type
-you wish the user to read in the <strong>Documentation</strong> pane.</span></li>
-
-</ol>
-
-</div>
-
-<div>
-<div class="linklist"><strong>Related concepts</strong><br />
-
-<div><a href="../concepts/cwsdled.html" title="The WSDL editor allows you to easily and graphically create, modify, view, and validate WSDL files.">Editing WSDL files with the WSDL Editor</a></div></div>
-
-<div class="linklist"><strong>Related tasks</strong><br />
-
-<div><a href="tcrtwsdl.html" title="You can create a new, empty WSDL file, then edit it using the WSDL editor.">Creating a new WSDL file</a></div>
-<div><a href="tedtwsdl.html" title="Once you have created a WSDL file, you can edit it in the WSDL editor. You can also import WSDL files you have created into the workbench and edit them in the WSDL editor.">Editing WSDL files</a></div></div>
-</div>
-</div>
-
-
-</body>
-</html> \ No newline at end of file

Back to the top

tyle='width: 4.0%;'/> -rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMContentWrapperImpl.java56
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMDocumentWrapperImpl.java216
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMElementDeclarationWrapperImpl.java128
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMGroupWrapperImpl.java112
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMNodeWrapperImpl.java79
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibIndexListener.java17
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibRecord.java22
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibRecordEvent.java22
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java72
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JarRecord.java40
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ProjectDescription.java717
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ServletRecord.java41
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TLDRecord.java38
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TagDirRecord.java51
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java272
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibIndex.java435
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/URLRecord.java46
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java251
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDataTypeImpl.java100
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java675
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentImpl.java444
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java454
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMNamedNodeMapImpl.java85
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMNodeListImpl.java63
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java919
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDFunctionImpl.java151
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDInitParamImpl.java64
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDListenerImpl.java40
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDValidatorImpl.java58
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDVariableImpl.java101
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TaglibTracker.java45
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/AbstractContentDescriber.java208
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/AbstractResourceEncodingDetector.java260
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/ContentDescriberForJSP.java56
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/HeadParserToken.java44
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IContentDescriptionForJSP.java25
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java99
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizer.java1323
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizerConstants.java21
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java257
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/NullMemento.java38
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/DocumentFactoryForJSP.java54
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/DocumentLoaderForJSP.java549
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterFactory.java101
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java608
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcher.java23
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherFactory.java58
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherImpl.java124
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/SetupParticipantForJSP.java40
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/CompilationUnitHelper.java48
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/EscapedTextUtil.java87
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IJSPTranslation.java83
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSP2ServletNameUtil.java134
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java94
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPProblemRequestor.java88
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java561
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java247
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapterFactory.java78
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java299
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java112
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java1785
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java439
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/IndexWorkspaceJob.java162
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager.java501
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPPathIndexer.java109
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java226
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchParticipant.java117
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchScope.java127
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java569
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JavaSearchDocumentDelegate.java71
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/NullModelManager.java518
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/NullSearchDocument.java44
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPCodeRegion.java54
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPDirectiveStructuredDocumentRegion.java34
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPReParser.java384
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java435
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPParserRegionFactory.java37
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPStructuredRegionFactory.java34
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java3599
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/tasks/JSPTaskTagSeeker.java22
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/NullStructuredDocumentPartitioner.java121
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/StructuredTextPartitionerForJSP.java543
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/CommonXML.java82
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java492
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/EmbeddedTypeStateData.java40
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/JSPModelLoader.java563
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/ModelHandlerForJSP.java75
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAdapterImpl.java25
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAssociationProvider.java26
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryCMProvider.java74
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryImpl.java120
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/ModelQueryAdapterFactoryForJSP.java150
-rw-r--r--bundles/org.eclipse.wst.css.core/.classpath7
-rw-r--r--bundles/org.eclipse.wst.css.core/.cvsignore5
-rw-r--r--bundles/org.eclipse.wst.css.core/.options2
-rw-r--r--bundles/org.eclipse.wst.css.core/.project28
-rw-r--r--bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.core.prefs48
-rw-r--r--bundles/org.eclipse.wst.css.core/build.properties22
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd132
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml826
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml2258
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml146
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml614
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties34
-rw-r--r--bundles/org.eclipse.wst.css.core/plugin.properties19
-rw-r--r--bundles/org.eclipse.wst.css.core/plugin.xml97
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/CSSCorePlugin.java20
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/ICSSModelAdapter.java24
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IModelProvideAdapter.java35
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleDeclarationAdapter.java25
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSelectorAdapter.java33
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSheetAdapter.java41
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSheetListAdapter.java41
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CSSCleanupStrategy.java98
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CSSCleanupStrategyImpl.java191
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CleanupProcessorCSS.java131
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSAccess.java26
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSAttr.java40
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSCharsetRule.java23
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSDocument.java98
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSImportRule.java34
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSMediaRule.java22
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSModel.java49
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNamedNodeMap.java26
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNode.java94
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNodeList.java31
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSPageRule.java28
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSPrimitiveValue.java46
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSRuleContainer.java60
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelector.java67
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorCombinator.java29
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorItem.java32
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorList.java62
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSimpleSelector.java77
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleDeclItem.java73
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleDeclaration.java46
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleRule.java28
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleSheet.java47
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSValue.java26
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSValueList.java35
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICounter.java49
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/IDOMImplementationCSS.java28
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/IDocumentStyle.java62
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/event/ICSSStyleListener.java32
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/event/ICSSStyleNotifier.java40
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/format/CSSSourceFormatter.java49
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/format/FormatProcessorCSS.java112
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java144
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties31
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java156
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/AbstractContentDescriber.java208
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/AbstractResourceEncodingDetector.java260
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSHeadTokenizer.java1355
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSHeadTokenizerConstants.java19
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSResourceEncodingDetector.java146
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/ContentDescriberForCSS.java23
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/EncodingGuesser.java173
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/HeadParserToken.java44
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/IntStack.java99
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/NullMemento.java38
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java34
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java266
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java164
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java198
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java89
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java1369
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java220
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java417
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java86
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java122
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java81
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java48
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java76
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java151
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java93
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java1077
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java183
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java76
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java234
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java244
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java155
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java268
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java677
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java122
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java1281
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java416
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java583
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java298
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java48
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java559
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java38
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java110
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java56
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java374
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java257
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java58
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java84
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java45
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java427
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java76
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java42
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java212
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java335
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java281
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java265
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java258
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java69
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java306
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java110
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java625
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java79
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java128
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/DOMCSSImpl.java54
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/MediaListImpl.java166
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RGBColorImpl.java108
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RectImpl.java122
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/StyleSheetListImpl.java44
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/ByteUtil.java228
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java126
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java87
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/CSSEmbededStyleNotifyAdapter.java60
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/CSSStyleEventDeliverer.java155
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/CSSStyleNotifyAdapter.java174
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java974
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrChangeContext.java29
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrFormatter.java165
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSFormatUtil.java165
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatter.java48
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatterFactory.java81
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceGenerator.java61
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CharsetRuleFormatter.java188
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CompoundRegion.java52
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CounterFormatter.java316
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DeclContainerFormatter.java118
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java126
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FontFaceRuleFormatter.java97
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FormatRegion.java71
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FunctionFormatter.java187
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/ImportRuleFormatter.java345
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaListFormatter.java216
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java394
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PageRuleFormatter.java193
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PrimitiveValueFormatter.java271
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RGBFormatter.java44
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RectFormatter.java44
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java394
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclarationFormatter.java253
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleRuleFormatter.java166
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleSheetFormatter.java273
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/UnknownRuleFormatter.java86
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCategoryImpl.java75
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCharsetRuleImpl.java45
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMContainerImpl.java63
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMDescriptorImpl.java75
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFontFaceRuleImpl.java45
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFunctionImpl.java96
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMImportRuleImpl.java44
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMKeywordImpl.java75
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMMediaRuleImpl.java41
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNodeImpl.java148
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNumberImpl.java52
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPageRuleImpl.java50
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPropertyImpl.java76
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPseudoClassImpl.java33
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPseudoElementImpl.java33
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMSelectorExpressionImpl.java49
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMSelectorImpl.java81
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStringImpl.java86
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleRuleImpl.java50
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleSheetImpl.java50
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMUnitImpl.java108
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMetaModelImpl.java95
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileImpl.java158
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileTest.java73
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/MetaModelErrors.java30
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/NodePool.java171
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/ProfileHandler.java283
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/ProfileKeywords.java58
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/ProfileLoader.java72
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/RegistryReader.java112
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/ValueCollector.java50
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/XMLReaderUtil.java38
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSRegionUtil.java51
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSSourceParser.java284
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSStructuredDocumentRegionFactory.java27
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java1221
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/regions/CSSContextRegion.java23
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/regions/CSSTextRegionFactory.java34
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/tasks/CSSTaskTagSeeker.java40
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentReParser.java451
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentRegionFactory.java39
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java169
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/rules/StructuredTextPartitionerForCSS.java35
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMCategory.java16
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMCharsetRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMContainer.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMDescriptor.java20
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMFontFaceRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMFunction.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMImportRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMKeyword.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMMediaRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMNode.java51
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMNumber.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMPageRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMProperty.java22
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMSelector.java29
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMString.java17
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMStyleRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMStyleSheet.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMMUnit.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSMetaModel.java37
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSProfile.java31
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/CSSProfileRegistry.java69
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSFunctionID.java22
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSKeywordID.java261
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSMMTypeCollector.java62
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSMediaGroupID.java29
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSMetaModelFinder.java51
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSMetaModelTraverser.java92
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSMetaModelUtil.java120
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSNumberID.java23
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSProfileFinder.java105
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSPropertyID.java137
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSStringID.java22
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/metamodel/util/CSSUnitID.java34
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/modelhandler/CSSModelLoader.java54
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/modelhandler/ModelHandlerForCSS.java56
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/parser/CSSRegionContexts.java76
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/parser/CSSTextParser.java101
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/parser/CSSTextToken.java23
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/preferences/CSSModelPreferenceNames.java32
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/preferences/CSSPreferenceHelper.java270
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/AbstractCssTraverser.java204
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/CSSClassTraverser.java114
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/CSSLinkConverter.java191
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/CSSPathService.java81
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/CSSSelectorListFactory.java35
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/CSSStyleDeclarationFactory.java65
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/CSSUtil.java335
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/ImportRuleCollector.java71
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/ImportedCollector.java61
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/RegionIterator.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/SelectionCollector.java76
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/SelectorValidator.java97
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/SelectorsCollector.java101
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/URLHelper.java210
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/URLModelProviderCSS.java388
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BackgroundPositionXSubStyleAdapter.java142
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BackgroundPositionYSubStyleAdapter.java150
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BackgroundShorthandAdapter.java179
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BorderBottomShorthandAdapter.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BorderColorShorthandAdapter.java158
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BorderLeftShorthandAdapter.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BorderRightShorthandAdapter.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BorderShorthandAdapter.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BorderStyleShorthandAdapter.java130
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BorderTopShorthandAdapter.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/BorderWidthShorthandAdapter.java130
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/CSSPropertyContext.java2997
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/ClipBottomSubStyleAdapter.java53
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/ClipLeftSubStyleAdapter.java53
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/ClipRightSubStyleAdapter.java53
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/ClipSubStyleAdapter.java132
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/ClipTopSubStyleAdapter.java53
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/FontShorthandAdapter.java240
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/ICSS2Properties.java127
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/IShorthandAdapter.java31
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/ISubPropertyAdapter.java29
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/ListStyleShorthandAdapter.java110
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/MarginShorthandAdapter.java129
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/PaddingShorthandAdapter.java129
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/declaration/ValueData.java45
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSS2Properties.java1666
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSCharsetRule.java54
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSFontFaceRule.java31
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSImportRule.java47
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSMediaRule.java84
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSPageRule.java47
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSPrimitiveValue.java313
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSRule.java102
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSRuleList.java50
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSStyleDeclaration.java163
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSStyleRule.java48
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSStyleSheet.java94
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSUnknownRule.java26
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSValue.java76
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/CSSValueList.java54
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/Counter.java42
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/DOMImplementationCSS.java45
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/DocumentCSS.java57
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/ElementCSSInlineStyle.java36
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/RGBColor.java54
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/Rect.java48
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/css/ViewCSS.java51
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/stylesheets/DocumentStyle.java38
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/stylesheets/LinkStyle.java35
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/stylesheets/MediaList.java93
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/stylesheets/StyleSheet.java100
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/stylesheets/StyleSheetList.java49
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/views/AbstractView.java31
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/w3c/dom/views/DocumentView.java33
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.classpath7
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.cvsignore5
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.project26
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.core.prefs69
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.pde.prefs12
-rw-r--r--bundles/org.eclipse.wst.dtd.core/README.txt1
-rw-r--r--bundles/org.eclipse.wst.dtd.core/build.properties22
-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gifbin136 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gifbin366 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gifbin196 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gifbin585 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gifbin156 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gifbin124 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gifbin316 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gifbin366 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gifbin339 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gifbin341 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gifbin382 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gifbin369 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gifbin358 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gifbin3357 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/newdtd_wiz.gifbin3294 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gifbin177 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gifbin141 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gifbin145 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gifbin145 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gifbin139 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gifbin147 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gifbin91 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gifbin149 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gifbin140 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gifbin149 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gifbin349 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gifbin356 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gifbin140 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gifbin135 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gifbin146 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/plugin.properties127
-rw-r--r--bundles/org.eclipse.wst.dtd.core/plugin.xml80
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Attribute.java370
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeEnumList.java72
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeList.java115
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMBasicNode.java163
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMGroupNode.java421
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMNode.java134
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMRepeatableNode.java80
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Comment.java75
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDFile.java649
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDNode.java334
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDPlugin.java22
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDResource.java57
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Element.java197
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Entity.java325
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ExternalNode.java243
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Logger.java20
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NamedTopLevelNode.java134
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NodeList.java94
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Notation.java30
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ParameterEntityReference.java113
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/TopLevelNode.java85
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Unrecognized.java39
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/builder/delegates/DTDTaskTagSeeker.java25
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/content/AbstractContentDescriber.java208
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/content/ContentDescriberForDTD.java29
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/contenttype/ContentTypeIdForDTD.java31
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/document/DTDModel.java29
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/document/DTDModelImpl.java271
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/AbstractResourceEncodingDetector.java260
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/DTDDocumentCharsetDetector.java60
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/DTDDocumentLoader.java64
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/NullMemento.java38
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/event/IDTDFileListener.java24
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/event/NodesEvent.java32
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePlugin.java110
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Logger.java143
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.java41
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java33
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java84
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/DTDModelDumper.java40
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/DTDModelLoader.java47
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/ModelHandlerForDTD.java46
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegion.java32
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionFactory.java26
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionParser.java262
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionTypes.java76
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/rules/StructuredTextPartitionerForDTD.java42
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/DTDTokenizer.java1429
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/Token.java61
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/Yytoken.java90
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/dtd.flex312
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDBatchNodeDelete.java57
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDExternalReferenceRemover.java145
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDModelUpdater.java134
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDNotationReferenceRemover.java92
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDReferenceUpdater.java191
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDSAXParser.java170
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDUniqueNameHelper.java91
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDVisitor.java105
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/LabelValuePair.java30
-rw-r--r--bundles/org.eclipse.wst.html.core/.classpath7
-rw-r--r--bundles/org.eclipse.wst.html.core/.cvsignore5
-rw-r--r--bundles/org.eclipse.wst.html.core/.options2
-rw-r--r--bundles/org.eclipse.wst.html.core/.project28
-rw-r--r--bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.core.prefs48
-rw-r--r--bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs12
-rw-r--r--bundles/org.eclipse.wst.html.core/build.properties22
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref.xml294
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref_de.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref_es.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref_fr.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref_it.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref_ja.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref_ko.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref_pt_BR.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref_zh_CN.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref_zh_TW.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/plugin.properties15
-rw-r--r--bundles/org.eclipse.wst.html.core/plugin.xml216
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/HTML40Namespace.java675
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/HTMLCMProperties.java116
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/HTMLCorePlugin.java19
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/HTMLFilesPreferenceNames.java34
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/HTMLFormatContraints.java35
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/PreferenceNames.java35
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/cleanup/AbstractNodeCleanupHandler.java87
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/cleanup/CSSTextNodeCleanupHandler.java86
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/cleanup/ElementNodeCleanupHandler.java635
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/cleanup/HTMLCleanupHandlerFactory.java119
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/cleanup/HTMLCleanupProcessorImpl.java45
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/cleanup/JSPElementNodeCleanupHandler.java22
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/cleanup/NodeCleanupHandler.java22
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/commentelement/handlers/CommentElementHandlerForSSI.java164
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/AttributeCollection.java1295
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CMContentImpl.java58
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CMGroupImpl.java83
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CMNamedNodeMapImpl.java99
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CMNamespaceImpl.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CMNodeImpl.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CMNodeListImpl.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/ComplexTypeDefinition.java76
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/ComplexTypeDefinitionFactory.java185
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdAddress.java71
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdColumnGroup.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdDl.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdEmbed.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdFieldset.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdFlowContainer.java55
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdFrameset.java93
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdHead.java176
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdHtml.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdInlineContainer.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdLiContainer.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdMap.java72
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdNoframesContent.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdOptionContainer.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdParamContainer.java71
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdSelect.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdTable.java128
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdTableCellContainer.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/CtdTrContainer.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/DeclCollection.java238
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/ElementCollection.java886
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/EntityCollection.java837
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HCMDocImpl.java92
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLAttrDeclImpl.java122
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLAttributeDeclaration.java24
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLCMDataType.java66
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLCMDataTypeImpl.java125
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLCMDocument.java37
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLCMDocumentFactory.java60
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLCMNode.java32
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLElemDeclImpl.java377
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLElementDeclaration.java81
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLEntityDeclImpl.java76
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLEntityDeclaration.java22
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HTMLPropertyDeclaration.java105
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedA.java100
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedADDRESS.java58
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedAPPLET.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedAREA.java61
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedBASE.java50
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedBASEFONT.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedBDO.java61
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedBGSOUND.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedBLOCKQUOTE.java63
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedBODY.java96
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedBR.java51
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedBUTTON.java102
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedCAPTION.java48
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedCENTER.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedCOL.java67
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedCOLGROUP.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedDD.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedDIV.java63
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedDL.java64
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedDT.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedEMBED.java94
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedEmpty.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedFIELDSET.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedFONT.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedFORM.java93
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedFRAME.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedFRAMESET.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedFlowContainer.java26
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedFontStyle.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedHEAD.java78
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedHR.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedHTML.java81
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedHeading.java86
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedIFRAME.java76
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedIMG.java89
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedINPUT.java122
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedISINDEX.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedInlineContainer.java29
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedLABEL.java94
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedLEGEND.java54
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedLI.java71
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedLINK.java63
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedListItemContainer.java30
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedMAP.java53
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedMARQUEE.java81
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedMENU.java90
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedMETA.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedMarkChanges.java50
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedNOBR.java33
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedNOEMBED.java42
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedNOFRAMES.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedNOSCRIPT.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedOBJECT.java86
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedOL.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedOPTGROUP.java55
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedOPTION.java66
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedP.java106
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedPARAM.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedPRE.java92
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedPcdata.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedPhrase.java42
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedQ.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSCRIPT.java81
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSELECT.java79
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSPAN.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSSIBase.java50
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSSIConfig.java48
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSSIEcho.java46
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSSIExec.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSSIFlastmod.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSSIFsize.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSSIInclude.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSSIPrintenv.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSSISet.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedSTYLE.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedScripts.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedTABLE.java91
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedTEXTAREA.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedTITLE.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedTR.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedTableBody.java73
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedTableCell.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedUL.java73
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/HedWBR.java32
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/JCMDocImpl.java79
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/JSP11Namespace.java112
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/JSPCMDocument.java29
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/JSPElementCollection.java897
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/PropertyProvider.java23
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/PropertyProviderFactory.java359
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/AttributeCollection.java324
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CHCMDocImpl.java95
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CHTMLNamespace.java152
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CMContentImpl.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CMGroupImpl.java83
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CMNamedNodeMapImpl.java97
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CMNodeImpl.java64
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CMNodeListImpl.java61
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/ComplexTypeDefinition.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/ComplexTypeDefinitionFactory.java146
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CtdAddress.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CtdDl.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CtdFlowContainer.java55
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CtdHead.java175
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CtdHtml.java79
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CtdInlineContainer.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CtdLiContainer.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CtdOptionContainer.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/CtdSelect.java64
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/DeclCollection.java238
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/ElementCollection.java495
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/EntityCollection.java837
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HTMLAttrDeclImpl.java118
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HTMLCMDataTypeImpl.java126
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HTMLCMNode.java32
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HTMLElemDeclImpl.java380
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HTMLEntityDeclImpl.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedA.java99
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedADDRESS.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedBASE.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedBLOCKQUOTE.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedBODY.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedBR.java51
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedCENTER.java55
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedDD.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedDIV.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedDL.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedDT.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedEmpty.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedFORM.java92
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedFlowContainer.java26
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedHEAD.java71
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedHR.java75
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedHTML.java81
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedHeading.java85
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedIMG.java88
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedINPUT.java108
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedInlineContainer.java29
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedLI.java58
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedListItemContainer.java30
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedMENU.java87
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedMETA.java67
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedOL.java58
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedOPTION.java63
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedP.java105
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedPRE.java91
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedPcdata.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedSELECT.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedSSIBase.java52
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedSSIConfig.java45
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedSSIEcho.java43
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedSSIExec.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedSSIFlastmod.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedSSIFsize.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedSSIInclude.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedSSIPrintenv.java48
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedSSISet.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedTEXTAREA.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedTITLE.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/HedUL.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/PropertyProvider.java26
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/chtml/PropertyProviderFactory.java363
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contentmodel/ssi/SSICMDocumentFactory.java158
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/contenttype/ContentTypeIdForHTML.java29
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/DocumentStyleImpl.java96
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/ElementStyleImpl.java73
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLConverter.java302
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeAdapter.java303
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeAdapterFactory.java136
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeConstants.java19
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeEntry.java126
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeRegistry.java139
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeRegistryReader.java107
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLModelParserAdapter.java354
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLModelParserAdapterFactory.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/MetaData.java28
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/MetaDataAdapter.java283
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/TagScanner.java166
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/UnknownTagAdapter.java82
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/XMLStyleModelImpl.java67
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/encoding/HTMLDocumentCharsetDetector.java42
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/encoding/HTMLDocumentLoader.java166
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/encoding/HTMLModelLoader.java114
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/format/EmbeddedCSSFormatter.java90
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/format/HTMLElementFormatter.java333
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/format/HTMLFormatContraintsImpl.java42
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/format/HTMLFormatProcessorImpl.java60
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/format/HTMLFormatter.java650
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/format/HTMLFormatterFactory.java108
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/format/HTMLTextFormatter.java281
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/format/SpaceConverter.java233
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/AbstractCSSModelAdapter.java105
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/AbstractStyleSheetAdapter.java238
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/CSSQueryContext.java137
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/CSSQueryDeclarationData.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/CSSQueryTraverser.java115
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/CSSQueryValueData.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/HTMLDocumentAdapter.java398
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/HTMLStyleSelectorAdapter.java154
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/HTMLStyleSelectorAdapterFactory.java81
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/LinkElementAdapter.java276
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/StyleAdapterFactory.java162
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/StyleAttrAdapter.java248
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/StyleElementAdapter.java411
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/StyleListener.java22
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/URLHelper.java33
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/URLModelProvider.java446
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java143
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties40
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java144
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractContentDescriber.java208
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java260
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.java24
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java173
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java1690
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java20
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java187
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HeadParserToken.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java99
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java38
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/rules/StructuredTextPartitionerForHTML.java204
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelhandler/EmbeddedHTML.java139
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelhandler/ModelHandlerForHTML.java55
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/CMAttributeDeclarationBuddySystem.java67
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/CMDocumentForBuddySystem.java119
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/CMElementDeclarationBuddySystem.java201
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/CMNamedNodeMapForBuddySystem.java109
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/CMNodeBuddySystem.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/DocumentQuery.java200
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/ElementDeclarationAdapter.java29
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/ElementDeclarationAdapterFactory.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/HMQUtil.java121
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/HTMLElementDeclarationAdapter.java54
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/HTMLModelQueryAssociationProvider.java54
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/HTMLModelQueryCMProvider.java100
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/HTMLModelQueryImpl.java140
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java51
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/ModelQueryAdapterFactoryForHTML.java155
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/modelquery/XHTMLAssociationProvider.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/preferences/HTMLContentBuilder.java71
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/AbstractErrorInfo.java40
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/CMUtil.java200
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/CompositeValidator.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/DocumentPropagatingValidator.java58
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/ElementPropagatingValidator.java50
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/ErrorInfo.java26
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/ErrorInfoImpl.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/ErrorState.java41
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/FMUtil.java103
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/HTMLAttributeValidator.java207
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/HTMLDocumentContentValidator.java194
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/HTMLElementAncestorValidator.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/HTMLElementContentValidator.java178
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/HTMLSimpleDocumentValidator.java39
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/HTMLSimpleValidator.java42
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/HTMLValidationAdapterFactory.java72
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/MessageFactory.java254
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/NamespaceValidator.java127
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/NullValidator.java34
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/PrimeValidator.java25
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/SMUtil.java36
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/Segment.java64
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/validate/SyntaxValidator.java345
-rw-r--r--bundles/org.eclipse.wst.sse.core/.classpath7
-rw-r--r--bundles/org.eclipse.wst.sse.core/.cvsignore5
-rw-r--r--bundles/org.eclipse.wst.sse.core/.options15
-rw-r--r--bundles/org.eclipse.wst.sse.core/.project28
-rw-r--r--bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.jdt.core.prefs69
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex286
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java977
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd23
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt0
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt6
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex285
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.java1206
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizerGenJava.cmd23
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexerr.txt0
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexout.txt8
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer/JSPHeadTokenizer.jFlex294
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer/JSPHeadTokenizer.java1327
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer/JSPHeadTokenizerGenJava.cmd25
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer/jflexerr.txt0
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer/jflexout.txt8
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex100
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java594
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJava.cmd25
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJavaJFlex14.cmd25
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexerr.txt0
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexout.txt6
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.jFlex268
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.java905
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizerGenJava.cmd28
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexerr.txt0
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexout.txt8
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/oldXMLHeadTokenizer.skeleton263
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/JSModel/build.txt3
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/JSModel/ecmalexeronly.sablegrammar676
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/JSModel/sablecc-2.16.2.zipbin471573 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/JSModel/sableccgrammars-1.2.1.jarbin94295 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.java1948
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex495
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd7
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.sh15
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/README11
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JFlex/COPYRIGHT303
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JFlex/README.sed5
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.java3599
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex2558
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.java1882
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex1323
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.cmd3
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.sh7
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexj.cmd3
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexx.cmd3
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse351
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse.readme6
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/build.xml69
-rw-r--r--bundles/org.eclipse.wst.sse.core/README.txt2
-rw-r--r--bundles/org.eclipse.wst.sse.core/build.properties22
-rw-r--r--bundles/org.eclipse.wst.sse.core/doc/book.css106
-rw-r--r--bundles/org.eclipse.wst.sse.core/doc/com_ibm_sse_model_builderparticipant.html47
-rw-r--r--bundles/org.eclipse.wst.sse.core/doc/schema.css66
-rw-r--r--bundles/org.eclipse.wst.sse.core/plugin.properties31
-rw-r--r--bundles/org.eclipse.wst.sse.core/plugin.xml61
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/builderparticipant.exsd118
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/formatProcessors.exsd114
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/AbstractAdapterFactory.java80
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/AbstractModelLoader.java499
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/AbstractNotifier.java232
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/AbstractStructuredModel.java1595
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/AdapterFactory.java44
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/DocumentChanged.java60
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/FactoryRegistry.java175
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IFactoryRegistry.java58
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IModelLifecycleListener.java25
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IModelLoaderExtension.java26
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IModelManager.java326
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IModelManagerListener.java37
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IModelManagerPlugin.java38
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IModelStateListener.java58
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IModelStateListenerExtended.java30
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/INodeAdapter.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/INodeNotifier.java71
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IStateMemento.java22
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IStructuredModel.java397
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/IndexedRegion.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/LifecycleNotificationManager.java123
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/ModelDumper.java34
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/ModelLifecycleEvent.java115
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/ModelLoader.java81
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/ModelManagerImpl.java1748
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/ModelPlugin.java31
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/ModelStateMemento.java111
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/NullModelManager.java504
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/PropagatingAdapter.java34
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/PropagatingAdapterFactory.java27
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java57
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/builder/IBuilderDelegate.java60
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/builder/IBuilderModelProvider.java42
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/builder/IBuilderParticipant.java124
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/cleanup/AbstractCleanupProcessor.java241
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/cleanup/AbstractStructuredCleanupProcessor.java456
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/cleanup/CleanupProcessor.java88
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/cleanup/IStructuredCleanupHandler.java23
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/cleanup/IStructuredCleanupPreferences.java56
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/cleanup/IStructuredCleanupProcessor.java109
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/cleanup/StructuredCleanupPreferences.java135
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/cleanup/StructuredContentCleanupHandler.java20
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/cleanup/StructuredContentCleanupHandlerImpl.java50
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/contentmodel/CMDocType.java21
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/contentmodel/CMDocumentTracker.java32
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/contentmodel/CMNodeWrapper.java21
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/contentmodel/ContentModelAdapter.java56
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/contentmodel/NullContentModel.java101
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/contenttype/ContentTypeIdForCSS.java29
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/AbstractDocumentLoader.java396
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/DocumentReader.java125
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/IDocumentCharsetDetector.java22
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/IDocumentLoader.java72
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/IDocumentLoaderForFileBuffers.java27
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/IEncodedDocument.java31
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/IExecutionDelegate.java20
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/ILockable.java30
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/StructuredDocumentFactory.java83
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/StructuredDocumentLoader.java141
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/AboutToBeChangeEvent.java29
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/IModelAboutToBeChangedListener.java26
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/IStructuredDocumentListener.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/NewDocumentContentEvent.java29
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/NewDocumentEvent.java81
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/NewModelEvent.java26
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/NoChangeEvent.java72
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/RegionChangedEvent.java48
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/RegionsReplacedEvent.java48
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/StructuredDocumentEvent.java127
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/events/StructuredDocumentRegionsReplacedEvent.java44
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/exceptions/ResourceAlreadyExists.java40
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/exceptions/ResourceInUse.java40
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/exceptions/SourceEditingException.java85
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/exceptions/SourceEditingRuntimeException.java89
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/filebuffers/BasicStructuredDocumentFactory.java75
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/format/AbstractStructuredFormatProcessor.java479
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/format/IStructuredContentFormatter.java19
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/format/IStructuredFormatContraints.java27
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/format/IStructuredFormatPreferences.java27
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/format/IStructuredFormatProcessor.java107
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/format/IStructuredFormatter.java30
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/format/StructuredFormatContraints.java44
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/format/StructuredFormatPreferences.java43
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java513
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/JSPAwareAdapterFactory.java22
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java175
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ModelManagerPluginRegistryReader.java170
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NoCancelProgressMonitor.java35
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NotImplementedException.java37
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NullMemento.java38
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java192
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePluginResources.properties69
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/builder/BuilderModelProvider.java179
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/builder/BuilderParticipantRegistryReader.java150
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/builder/StructuredDocumentBuilder.java575
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/NullStructuredDocumentPartitioner.java115
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/TextUtilities.java73
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistry.java35
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryImpl.java120
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryReader.java71
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java279
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistryReader.java106
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerUtility.java50
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/PluginContributedFactoryReader.java126
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ContextRegion.java242
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ForeignRegion.java88
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java2614
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java688
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CharSequenceReader.java127
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CoreNodeList.java132
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/DocumentInternalStateRule.java56
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/GenericPositionManager.java401
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IExecutionDelegatable.java20
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IRegionComparible.java20
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java179
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java427
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java1660
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionEnumeration.java87
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionIterator.java115
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentSequentialRewriteTextStore.java132
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentTextStore.java189
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/SubSetTextStore.java127
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java223
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommandImpl.java138
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCompoundCommandImpl.java261
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java617
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/modelhandler/AbstractModelHandler.java72
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/modelhandler/EmbeddedTypeHandler.java63
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/modelhandler/IDocumentTypeHandler.java42
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/modelhandler/IModelHandler.java43
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/modelquery/ModelQueryAdapter.java32
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/modelquery/ModelQueryAdapterImpl.java76
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/modelquery/MovableModelQuery.java23
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/BlockMarker.java107
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/BlockTagParser.java32
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/BlockTokenizer.java58
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/IBlockedStructuredDocumentRegion.java24
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/JSPCapableParser.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/RegionParser.java52
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/StructuredDocumentRegionHandler.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/StructuredDocumentRegionHandlerExtension.java20
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/StructuredDocumentRegionParser.java24
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/StructuredDocumentRegionParserExtension.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/parser/TagMarker.java80
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/participants/AbstractBuilderParticipant.java183
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/participants/TaskTagSeeker.java468
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/preferences/CommonModelPreferenceNames.java161
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/preferences/PreferenceChangeListener.java24
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/DeleteEqualPositionUpdater.java66
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredDocument.java199
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredDocumentRegion.java96
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredDocumentRegionList.java31
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredTextPartitioner.java47
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredTextReParser.java41
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/ITextRegion.java82
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/ITextRegionCollection.java59
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/ITextRegionContainer.java27
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/ITextRegionList.java43
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/SimpleStructuredRegion.java91
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/SimpleStructuredTypedRegion.java87
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/StructuredRegion.java27
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/StructuredTypedRegion.java24
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/rules/StructuredTextPartitioner.java609
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/undo/CommandCursorPosition.java66
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/undo/IDocumentSelectionMediator.java35
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/undo/IStructuredTextUndoManager.java155
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/undo/StructuredTextCommand.java34
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/undo/UndoDocumentEvent.java45
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/Assert.java166
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/Debug.java221
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/DocumentInputStream.java108
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/JarUtilities.java210
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/PathHelper.java148
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/ProjectResolver.java228
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/ResourceUtil.java69
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/ScriptLanguageKeys.java39
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/StringUtils.java742
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/TextUtilities.java63
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/URIResolver.java82
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/Utilities.java130
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/validate/ValidationAdapter.java31
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/validate/ValidationMessage.java69
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/validate/ValidationReporter.java24
-rw-r--r--bundles/org.eclipse.wst.xml.core/.classpath7
-rw-r--r--bundles/org.eclipse.wst.xml.core/.cvsignore5
-rw-r--r--bundles/org.eclipse.wst.xml.core/.options2
-rw-r--r--bundles/org.eclipse.wst.xml.core/.project27
-rw-r--r--bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.core.prefs69
-rw-r--r--bundles/org.eclipse.wst.xml.core/README.txt1
-rw-r--r--bundles/org.eclipse.wst.xml.core/build.properties24
-rw-r--r--bundles/org.eclipse.wst.xml.core/plugin.properties17
-rw-r--r--bundles/org.eclipse.wst.xml.core/plugin.xml114
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/.cvsignore1
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/Logger.java22
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/NameValidator.java29
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/XMLModelPlugin.java21
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/XMLPreferenceNames.java51
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/builder/delegates/XMLTaskTagSeeker.java41
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/cleanup/CleanupProcessorXML.java90
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/cleanup/ElementNodeCleanupHandler.java556
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/cleanup/NodeCleanupHandler.java70
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/cleanup/XMLCleanupPreferences.java54
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/cleanup/XMLCleanupPreferencesImpl.java142
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/commentelement/CommentElementAdapter.java126
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/commentelement/CommentElementHandler.java107
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/commentelement/impl/BasicCommentElementHandler.java153
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/commentelement/impl/CommentElementConfiguration.java229
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/commentelement/impl/CommentElementRegistry.java84
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/commentelement/util/CommentElementFactory.java65
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/commentelement/util/TagScanner.java196
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/contenttype/ContentTypeIdForXML.java38
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/DocumentLoaderForXML.java131
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/DocumentTypeAdapter.java51
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/InvalidCharacterException.java67
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/JSPTag.java34
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/TagAdapter.java34
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLAttr.java65
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLCharEntity.java37
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLDocument.java66
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLDocumentType.java32
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLElement.java107
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLGenerator.java154
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLModel.java36
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLModelNotifier.java103
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLNamespace.java25
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLNode.java124
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/document/XMLText.java40
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/encoding/XMLDocumentCharsetDetector.java37
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/encoding/XMLDocumentLoader.java78
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/format/CommentNodeFormatter.java99
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/format/DocumentNodeFormatter.java53
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/format/ElementNodeFormatter.java354
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/format/FormatProcessorXML.java108
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/format/IStructuredFormatPreferencesXML.java21
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/format/NodeFormatter.java765
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/format/StructuredFormatPreferencesXML.java27
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/format/TextNodeFormatter.java198
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/DebugAdapterFactory.java81
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/EveryNodeDebugAdapter.java274
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/IDebugAdapter.java19
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/Logger.java157
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java138
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties17
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java260
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java107
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ContentDescriberForXML.java205
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/EncodingParserConstants.java30
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/HeadParserToken.java44
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java99
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/NullMemento.java38
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java156
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java1223
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizerConstants.java24
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java99
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java756
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java140
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CMNodeUtil.java42
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java353
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java183
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentFragmentImpl.java74
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java1072
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapterImpl.java120
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java222
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java1421
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java227
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java89
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java55
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java514
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java809
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeIteratorImpl.java257
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java111
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java138
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java227
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/RangeImpl.java630
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java334
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java348
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionChecker.java143
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java605
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionManagementException.java34
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java548
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java167
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java1107
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLGeneratorImpl.java738
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelContext.java237
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelImpl.java877
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java469
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java2365
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java1647
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/filebuffers/DocumentFactoryForXML.java39
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/BlockStructuredDocumentRegion.java46
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java386
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java97
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/RegionFactory.java49
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java541
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLRegionContexts.java21
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java595
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredDocumentReParser.java125
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredRegionFactory.java42
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java1882
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeEqualsRegion.java92
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeNameRegion.java170
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeValueRegion.java167
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/BlockTextRegion.java36
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/GenericTemplateRegion.java105
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionToStringUtil.java36
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java205
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagCloseRegion.java95
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagNameRegion.java98
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java98
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/WhiteSpaceOnlyRegion.java190
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLCDataTextRegion.java179
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLContentRegion.java179
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserFactory.java25
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserRegion.java111
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java86
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterFactoryImpl.java113
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterImpl.java168
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/XMLStructuredDocumentRegion.java36
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/util/DebugDocument.java104
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java45
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/Propagator.java51
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/ValidationComponent.java50
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/jsp/model/parser/temp/XMLJSPRegionContexts.java59
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/jsp/model/parser/temp/package.html8
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelhandler/EmbeddedXML.java89
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelhandler/ModelHandlerForXML.java63
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelhandler/XMLModelLoader.java93
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelquery/ModelQueryAdapterFactoryForEmbeddedXML.java54
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelquery/ModelQueryAdapterFactoryForXML.java178
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelquery/ModelQueryUtil.java64
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelquery/XMLCatalogIdResolver.java89
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelquery/XMLModelQueryAssociationProvider.java37
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelquery/XMLModelQueryImpl.java38
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/parser/XMLRegionContext.java69
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/rules/StructuredTextPartitionerForXML.java139
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/COPYRIGHT.html100
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/DocumentRange.java39
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/Range.java434
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/RangeException.java50
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/package.html3
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/COPYRIGHT.html100
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/DocumentTraversal.java101
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/NodeFilter.java151
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/NodeIterator.java113
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/TreeWalker.java185
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/package.html3
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.classpath7
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.cvsignore5
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.project28
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs69
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.pde.prefs12
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/build.properties33
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gifbin361 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gifbin376 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gifbin362 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gifbin367 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gifbin336 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gifbin595 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gifbin345 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gifbin232 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gifbin244 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gifbin242 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gifbin117 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/plugin.properties1065
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/plugin.xml312
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/AbstractXSDDataTypeValueExtension.java195
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/AbstractXSDModelQueryContributor.java79
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java201
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlinePage.java382
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditor.java1172
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorAdapter.java27
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorContextIds.java460
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorPlugin.java353
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMenuListener.java2143
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMultiPageEditorPart.java726
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDSelectionManager.java96
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDTextEditor.java424
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDURIConverter.java87
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AbstractAction.java68
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddAttributeAction.java40
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddEnumsAction.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddModelGroupAction.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddSchemaNodeAction.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/BackAction.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAnnotationAction.java55
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAttributeAndRequired.java115
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java365
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateGroupAction.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateIdentityConstraintsAction.java74
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalComplexTypeAction.java68
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalSimpleTypeAction.java85
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleContentAction.java162
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleTypeAction.java68
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DeleteAction.java237
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/GraphRenameAction.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ISchemaEditorActionConstants.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MakeAnonymousGlobal.java66
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ModelMessage.java36
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java182
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/OpenSchemaAction.java64
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ReloadDependenciesAction.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetBaseTypeAction.java384
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetMultiplicityAction.java42
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetTypeAction.java37
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java226
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AbstractCommand.java71
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddAttributeDeclarationCommand.java141
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddComplexTypeDefinitionCommand.java53
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddElementDeclarationCommand.java53
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddModelGroupCommand.java103
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddSimpleTypeDefinitionCommand.java56
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeAnonymousTypeGlobalCommand.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeLocalElementGlobalCommand.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/RenameCommand.java66
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetMultiplicityCommand.java67
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetTypeCommand.java95
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/ComponentSelectionDialog.java447
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentList.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentSelectionProvider.java27
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/ResourceView.java141
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentFinder.java130
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionDialog.java179
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionProvider.java141
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSpecification.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLQuickScan.java144
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentFinder.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionDialog.java28
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionProvider.java346
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDSetTypeHelper.java376
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/BaseDragNodesCommand.java102
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/DragNodesCommand.java77
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/XSDDragAndDropManager.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java63
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java215
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java218
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java162
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java30
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java27
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/BaseGraphicalViewer.java201
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/FigureCanvasKeyboardHandler.java125
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphContextMenuProvider.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphicsConstants.java36
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/LinkedGraphViewer.java163
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/PrintGraphAction.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDChildUtility.java285
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDComponentViewer.java105
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphUtil.java35
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphViewer.java598
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphicalViewerKeyHandler.java352
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDInheritanceViewer.java98
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupChildUtility.java46
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupsViewer.java99
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/BaseEditPart.java86
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/CategoryEditPart.java187
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeDefinitionEditPart.java215
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeInheritedContentEditPart.java150
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComponentViewerRootEditPart.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ElementDeclarationEditPart.java460
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ExpandableGraphNodeEditPart.java189
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/GraphNodeEditPart.java144
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/IFeedbackHandler.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/MessageEditPart.java38
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupDefinitionEditPart.java204
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupEditPart.java187
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RepeatableGraphNodeEditPart.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootComplexTypeDefinitionEditPart.java121
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootModelGroupDefinitionEditPart.java105
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaDirectiveEditPart.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaEditPart.java207
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SimpleTypeDefinitionEditPart.java69
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SubstitutionGroupViewerRootEditPart.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TopLevelComponentEditPart.java316
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TypeEditPart.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/WildcardEditPart.java85
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/XSDEditPartFactory.java102
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComboBoxCellEditorManager.java205
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComponentNameDirectEditManager.java104
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DirectEditPolicyDelegate.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropCommand.java161
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropEditPolicy.java47
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/GraphNodeDragTracker.java34
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SelectionHandlesEditPolicyImpl.java257
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SimpleDirectEditPolicy.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TextCellEditorManager.java74
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TypeReferenceDirectEditManager.java118
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/BogusLayout.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenterLayout.java118
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenteredIconFigure.java39
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ConnectionFigure.java210
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerFigure.java71
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerLayout.java249
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ExpandableGraphNodeFigure.java133
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FillLayout.java161
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FloatableFigure.java29
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeContainerFigure.java29
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeFigure.java184
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/Interactor.java54
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/LabelFigure.java88
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/PostLayoutManager.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RepeatableGraphNodeFigure.java85
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RoundedLineBorder.java67
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/Category.java266
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapter.java27
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapterListener.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/XSDModelAdapterFactory.java511
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateDtd.gifbin605 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateJava.gifbin609 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GraphViewElementRef.gifbin860 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/NewXSD.gifbin3261 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/RegexWizardArrow.gifbin54 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/ValidateXSD.gifbin558 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAll.gifbin88 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnnotate.gifbin594 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAny.gifbin613 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnyAttribute.gifbin384 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAppInfo.gifbin121 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttribute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroup.gifbin235 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroupRef.gifbin361 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeRef.gifbin350 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDChoice.gifbin145 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexContent.gifbin211 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexType.gifbin155 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDDoc.gifbin368 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElement.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElementRef.gifbin585 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDExtension.gifbin101 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDField.gifbin227 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDFile.gifbin361 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalAttribute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalElement.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroup.gifbin205 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroupRef.gifbin347 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDImport.gifbin114 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDInclude.gifbin324 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKey.gifbin323 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKeyRef.gifbin558 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDNotation.gifbin177 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDRedefine.gifbin373 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSelector.gifbin136 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSequence.gifbin91 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleContent.gifbin210 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleEnum.gifbin105 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleList.gifbin347 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimplePattern.gifbin120 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleRestrict.gifbin141 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleType.gifbin150 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleTypeForEditPart.gifbin150 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleUnion.gifbin138 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDUnique.gifbin210 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/back.gifbin873 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/browsebutton.gifbin825 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/forward.gifbin874 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/generate_xml.gifbin612 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/regx_wiz.gifbin3241 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/reloadgrammar.gifbin365 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/sort.gifbin159 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java256
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyAttributePropertySource.java173
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyContentPropertyDescriptor.java155
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyElementPropertySource.java228
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AppInfoPropertySource.java216
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributeGroupRefPropertySource.java172
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributePropertySource.java294
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributesTable.java331
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/BasePropertySource.java126
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ComplexTypePropertySource.java380
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DocumentationPropertySource.java243
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DynamicCellEditor.java1174
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ElementPropertySource.java546
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/EnumerationPropertySource.java131
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/FixedOrDefaultTextPropertyDescriptor.java307
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/GroupRefPropertySource.java229
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ImportPropertySource.java335
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/IncludePropertySource.java238
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/KeyrefPropertySource.java210
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ModelGroupPropertySource.java266
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NamePropertySource.java219
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NotationPropertySource.java186
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/OptionsTextCellEditor.java241
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/PatternPropertySource.java272
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ReadOnlyPropertySource.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaDirectiveHelperPropertySource.java191
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaPropertySource.java530
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertyDescriptor.java209
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertySource.java230
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleRestrictPropertySource.java362
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeListPropertySource.java143
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypePropertySource.java183
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeUnionPropertySource.java494
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/TypesPropertyDescriptor.java1160
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XPathPropertySource.java150
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDComboBoxPropertyDescriptor.java304
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDPropertySheetPage.java119
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDPropertySourceProvider.java285
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSection.java495
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSectionDescriptor.java108
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSection.java595
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSectionDescriptor.java109
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewContentProvider.java289
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSection.java460
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSectionDescriptor.java101
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/CommonDirectivesSection.java157
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSection.java245
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSectionDescriptor.java82
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSection.java434
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSectionDescriptor.java87
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetViewer.java498
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSection.java802
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSectionDescriptor.java87
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSection.java286
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSectionDescriptor.java145
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSection.java144
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSectionDescriptor.java102
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSection.java444
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSectionDescriptor.java169
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationDescriptor.java87
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationSection.java360
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSection.java196
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSectionDescriptor.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSection.java432
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSectionDescriptor.java86
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSection.java125
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSectionDescriptor.java145
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSection.java165
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSectionDescriptor.java85
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSection.java290
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSectionDescriptor.java174
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationDescriptor.java88
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationSection.java206
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentBaseTypeOptionsDialog.java158
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentUnionMemberTypesDialog.java314
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSection.java571
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSectionDescriptor.java91
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSection.java185
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSectionDescriptor.java87
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TextChangeHelper.java102
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesDialog.java726
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSection.java359
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSectionDescriptor.java134
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSection.java118
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSectionDescriptor.java82
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionDescriptorProvider.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionLabelProvider.java169
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDTabbedPropertySheetPage.java140
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbook.java97
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbookPage.java51
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/CategoryAdapter.java168
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAbstractAdapter.java165
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAdapterFactoryLabelProvider.java160
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAnnotationAdapter.java83
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeDeclarationAdapter.java113
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeGroupDefinitionAdapter.java100
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeUseAdapter.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDComplexTypeDefinitionAdapter.java182
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDContentProvider.java305
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDElementDeclarationAdapter.java193
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelAdapterFactoryImpl.java422
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupAdapter.java141
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupDefinitionAdapter.java96
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDNotationDeclarationAdapter.java44
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDParticleAdapter.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaAdapter.java405
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaDirectiveAdapter.java102
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSimpleTypeDefinitionAdapter.java193
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDWildcardAdapter.java112
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/XSDVisitor.java217
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java159
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RefactorActionGroup.java268
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java95
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java139
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java75
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java56
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java199
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseCleanup.java107
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseGlobalCleanup.java29
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeCleanup.java106
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java102
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalElementCleanup.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalGroupCleanup.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalSimpleOrComplexTypeCleanup.java152
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/XSDExternalFileCleanup.java299
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties33
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseRenamer.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameChange.java193
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeGroupRenamer.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeRenamer.java66
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalElementRenamer.java41
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalGroupRenamer.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalSimpleOrComplexTypeRenamer.java91
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/INameUpdating.java28
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java227
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameInputWizardPage.java253
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameRefactoringWizard.java71
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java172
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameSupport.java210
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java110
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java83
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/SchemaPrefixChangeHandler.java212
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/TargetNamespaceChangeHandler.java154
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java171
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java224
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/OpenOnSelectionHelper.java322
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java83
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java815
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java429
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java1103
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaHelper.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java106
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/SetBaseTypeDialog.java180
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java340
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java168
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java965
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java421
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java161
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java65
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java71
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java130
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java371
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/reconcile/DelegatingReconcileValidatorForXSD.java37
-rw-r--r--development/org.eclipse.wst.sse.unittests/.classpath7
-rw-r--r--development/org.eclipse.wst.sse.unittests/.cvsignore5
-rw-r--r--development/org.eclipse.wst.sse.unittests/.project28
-rw-r--r--development/org.eclipse.wst.sse.unittests/plugin.xml37
-rw-r--r--development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java70
-rw-r--r--development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.java51
1678 files changed, 0 insertions, 266208 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/.classpath b/bundles/org.eclipse.jst.jsp.core/.classpath
deleted file mode 100644
index 275b34c699..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.jsp.core/.cvsignore b/bundles/org.eclipse.jst.jsp.core/.cvsignore
deleted file mode 100644
index 2a87a022e4..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-temp.folder
-jspmodel.jar
-dev.properties
-org.eclipse.jst.jsp.core_6.0.0.jar
-build.xml
-org.eclipse.jst.jsp.core_6.0.0.zip
-jspmodelsrc.zip
diff --git a/bundles/org.eclipse.jst.jsp.core/.options b/bundles/org.eclipse.jst.jsp.core/.options
deleted file mode 100644
index 424d005603..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/.options
+++ /dev/null
@@ -1,23 +0,0 @@
-org.eclipse.jst.jsp.core/debug=true
-org.eclipse.jst.jsp.core/debug/tracefilter=
-org.eclipse.jst.jsp.core/debug/jspindexmanager=false
-org.eclipse.jst.jsp.core/debug/jsptranslation=false
-org.eclipse.jst.jsp.core/debug/jspsearch=false
-
-org.eclipse.jst.jsp.core/taglib/resolve=false
-
-
-# org.eclipse.jst.jsp.core.contentmodel.tld.TLDCMDocumentManager._debug
-org.eclipse.jst.jsp.core/debug/tldcmdocument/manager=false
-
-# org.eclipse.jst.jsp.core.contentmodel.tld.CMDocumentFactoryTLD._debug
-org.eclipse.jst.jsp.core/debug/tldcmdocument/factory=false
-
-#org.eclipse.jst.jsp.core.internal.contentmodel/index.ProjectDescription._debugIndexCreation
-org.eclipse.jst.jsp.core/taglib/indexcreation=false
-#org.eclipse.jst.jsp.core.internal.contentmodel/index.ProjectDescription._debugIndexTime
-org.eclipse.jst.jsp.core/taglib/indextime=false
-
-#org.eclipse.jst.jsp.core.text.rules.StructuredTextPartitioner.debugPrefixListener
-org.eclipse.jst.jsp.core/partitioner/prefixlistener=false
-
diff --git a/bundles/org.eclipse.jst.jsp.core/.project b/bundles/org.eclipse.jst.jsp.core/.project
deleted file mode 100644
index 0f10b7a1d8..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsp.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 287fc5f5c2..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,69 +0,0 @@
-#Wed Jan 12 16:11:11 EST 2005
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-eclipse.preferences.version=1
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.incompleteClasspath=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
diff --git a/bundles/org.eclipse.jst.jsp.core/build.properties b/bundles/org.eclipse.jst.jsp.core/build.properties
deleted file mode 100644
index 634f9a48b9..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = plugin.xml,\
- *.jar,\
- jsp.jar,\
- .options,\
- plugin.properties
-src.includes = plugin.xml,\
- build.xml,\
- .options,\
- plugin.properties
-source.jspmodel.jar = src/
diff --git a/bundles/org.eclipse.jst.jsp.core/plugin.properties b/bundles/org.eclipse.jst.jsp.core/plugin.properties
deleted file mode 100644
index 42ae6078b4..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Source JSP Model
-nlFeatureName=Structured Source JSP Model NL Support
-Structured_JSP_Document_Factory_Extension.name=Structured JSP Document Factory Extension
-JSP_Content_Type_Extension_Element.name=JSP Content Type
-JSP_Tag_Content_Type_Extension_Element.name=JSP Tag Content Type
diff --git a/bundles/org.eclipse.jst.jsp.core/plugin.xml b/bundles/org.eclipse.jst.jsp.core/plugin.xml
deleted file mode 100644
index ca3a3f797e..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/plugin.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.jst.jsp.core"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.jst.jsp.core.internal.JSPCorePlugin">
-
- <runtime>
- <library name="jspmodel.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.filebuffers"/>
- <import plugin="org.eclipse.wst.common.encoding"/>
- <import plugin="org.eclipse.wst.html.core"/>
- <import plugin="org.eclipse.wst.xml.core"/>
- <import plugin="org.eclipse.wst.sse.ui"/>
- <import plugin="org.eclipse.wst.sse.core"/>
- <import plugin="org.eclipse.wst.xml.uriresolver"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.wst.common.contentmodel"/>
- <import plugin="org.eclipse.text"/>
- <import plugin="org.eclipse.wst.common.uriresolver"/>
- </requires>
-
-
- <extension
- point="org.eclipse.wst.sse.core.modelHandler">
- <modelHandler
- class="org.eclipse.jst.jsp.core.modelhandler.ModelHandlerForJSP"
- associatedContentTypeId="org.eclipse.jst.jsp.core.jspsource"
- id="org.eclipse.jst.jsp.core.modelhandler">
- </modelHandler>
- </extension>
- <extension
- point="org.eclipse.wst.common.contentmodel.documentFactories">
- <factory
- type="tld"
- class="org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD">
- </factory>
- </extension>
- <extension
- id="org.eclipse.jst.jsp.core.builderdelegate.todo"
- point="org.eclipse.wst.sse.core.builderdelegate">
- <participant
- class="org.eclipse.jst.jsp.core.internal.tasks.JSPTaskTagSeeker"
- contentType="org.eclipse.jst.jsp.core.jspsource">
- </participant>
- </extension>
- <extension point="org.eclipse.core.filebuffers.documentCreation"
- id="org.eclipse.jst.jsp.core.documentfactories"
- name="%Structured_JSP_Document_Factory_Extension.name">
- <factory
- contentTypeId="org.eclipse.jst.jsp.core.jspsource"
- class="org.eclipse.wst.sse.core.filebuffers.BasicStructuredDocumentFactory"/>
- </extension>
- <extension point="org.eclipse.core.filebuffers.documentSetup"
- id="org.eclipse.jst.jsp.core.documentsetup"
- name="Structured JSP Document Setup participant">
- <participant
- contentTypeId="org.eclipse.jst.jsp.core.jspsource"
- class="org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController"/>
- </extension>
- <extension
- point="org.eclipse.team.core.fileTypes">
- <fileTypes
- type="text"
- extension="jsp">
- </fileTypes>
- <fileTypes
- type="text"
- extension="jspf"/>
- <fileTypes
- type="text"
- extension="jspx"/>
- <fileTypes
- type="text"
- extension="jsf">
- </fileTypes>
- <fileTypes
- type="text"
- extension="jsv">
- </fileTypes>
- <fileTypes
- type="text"
- extension="jtpl">
- </fileTypes>
- <fileTypes
- type="text"
- extension="tld"/>
- <fileTypes
- type="text"
- extension="tag"/>
- <fileTypes
- type="text"
- extension="tagx"/>
- <fileTypes
- type="text"
- extension="tagf"/>
- </extension>
- <extension
- point="org.eclipse.wst.sse.core.formatProcessors">
- <processor
- class="org.eclipse.wst.html.core.format.HTMLFormatProcessorImpl"
- contentTypeId="org.eclipse.jst.jsp.core.jspsource">
- </processor>
- </extension>
-
- <extension
- point="org.eclipse.core.runtime.contentTypes">
- <!-- associate JSP file types -->
- <content-type
- file-extensions="jsp,jspf,jsf,jsv,jtpl,jspx"
- priority="high"
- name="%JSP_Content_Type_Extension_Element.name"
- id="jspsource"
- base-type="org.eclipse.core.runtime.text"
- default-charset="ISO-8859-1">
- <describer class="org.eclipse.jst.jsp.core.internal.contenttype.ContentDescriberForJSP"/>
- </content-type>
- <!-- associate JSP 2.0 Tag file types -->
- <content-type
- file-extensions="tag,tagx,tagf"
- priority="high"
- name="%JSP_Tag_Content_Type_Extension_Element.name"
- id="tagsource"
- base-type="org.eclipse.jst.jsp.core.jspsource"
- default-charset="UTF-8">
- </content-type>
- <!-- associate .tld files with the XML content type -->
- <file-association
- content-type="org.eclipse.core.runtime.xml"
- file-extensions="tld"/>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSP11Namespace.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSP11Namespace.java
deleted file mode 100644
index a92bc94dee..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSP11Namespace.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core;
-
-
-/**
- * JSP 1.1 Namespace
- */
-public interface JSP11Namespace {
-
- public static interface ElementName {
- // Element names
- public static final String SCRIPTLET = "jsp:scriptlet"; //$NON-NLS-1$
- public static final String EXPRESSION = "jsp:expression"; //$NON-NLS-1$
- public static final String DECLARATION = "jsp:declaration"; //$NON-NLS-1$
- public static final String DIRECTIVE_PAGE = "jsp:directive.page"; //$NON-NLS-1$
- public static final String DIRECTIVE_INCLUDE = "jsp:directive.include"; //$NON-NLS-1$
- public static final String DIRECTIVE_TAGLIB = "jsp:directive.taglib"; //$NON-NLS-1$
- public static final String USEBEAN = "jsp:useBean"; //$NON-NLS-1$
- public static final String SETPROPERTY = "jsp:setProperty"; //$NON-NLS-1$
- public static final String GETPROPERTY = "jsp:getProperty"; //$NON-NLS-1$
- public static final String INCLUDE = "jsp:include"; //$NON-NLS-1$
- public static final String FORWARD = "jsp:forward"; //$NON-NLS-1$
- public static final String PLUGIN = "jsp:plugin"; //$NON-NLS-1$
- public static final String PARAMS = "jsp:params"; //$NON-NLS-1$
- public static final String FALLBACK = "jsp:fallback"; //$NON-NLS-1$
- public static final String PARAM = "jsp:param"; //$NON-NLS-1$
- public static final String ROOT = "jsp:root"; //$NON-NLS-1$
- public static final String TEXT = "jsp:text"; //$NON-NLS-1$
- }
-
- public static final String JSP11_URI = ""; //$NON-NLS-1$
- public static final String JSP_TAG_PREFIX = "jsp"; //$NON-NLS-1$
- // attribute names
- // directive.page
- public static final String ATTR_NAME_LANGUAGE = "language"; //$NON-NLS-1$
- public static final String ATTR_NAME_EXTENDS = "extends"; //$NON-NLS-1$
- public static final String ATTR_NAME_CONTENT_TYPE = "contentType"; //$NON-NLS-1$
- public static final String ATTR_NAME_IMPORT = "import"; //$NON-NLS-1$
- public static final String ATTR_NAME_SESSION = "session"; //$NON-NLS-1$
- public static final String ATTR_NAME_BUFFER = "buffer"; //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOFLUSH = "autoFlush"; //$NON-NLS-1$
- public static final String ATTR_NAME_IS_THREAD_SAFE = "isThreadSafe"; //$NON-NLS-1$
- public static final String ATTR_NAME_INFO = "info"; //$NON-NLS-1$
- public static final String ATTR_NAME_ERROR_PAGE = "errorPage"; //$NON-NLS-1$
- public static final String ATTR_NAME_IS_ERROR_PAGE = "isErrorPage"; //$NON-NLS-1$
- public static final String ATTR_NAME_PAGE_ENCODING = "pageEncoding"; //$NON-NLS-1$
- // directive.include
- public static final String ATTR_NAME_FILE = "file"; //$NON-NLS-1$
- // directive.taglib
- public static final String ATTR_NAME_URI = "uri"; //$NON-NLS-1$
- public static final String ATTR_NAME_PREFIX = "prefix"; //$NON-NLS-1$
- // useBean
- public static final String ATTR_NAME_ID = "id"; //$NON-NLS-1$
- public static final String ATTR_NAME_SCOPE = "scope"; //$NON-NLS-1$
- public static final String ATTR_NAME_CLASS = "class"; //$NON-NLS-1$
- public static final String ATTR_NAME_BEAN_NAME = "beanName"; //$NON-NLS-1$
- public static final String ATTR_NAME_TYPE = "type"; //$NON-NLS-1$
- // setProperty
- public static final String ATTR_NAME_NAME = "name"; //$NON-NLS-1$
- public static final String ATTR_NAME_PROPERTY = "property"; //$NON-NLS-1$
- public static final String ATTR_NAME_VALUE = "value"; //$NON-NLS-1$
- public static final String ATTR_NAME_PARAM = "param"; //$NON-NLS-1$
- // include
- public static final String ATTR_NAME_PAGE = "page"; //$NON-NLS-1$
- public static final String ATTR_NAME_FLUSH = "flush"; //$NON-NLS-1$
- // plugin
- public static final String ATTR_NAME_CODE = "code"; //$NON-NLS-1$
- public static final String ATTR_NAME_CODEBASE = "codebase"; //$NON-NLS-1$
- public static final String ATTR_NAME_ALIGN = "align"; //$NON-NLS-1$
- public static final String ATTR_NAME_ARCHIVE = "archive"; //$NON-NLS-1$
- public static final String ATTR_NAME_HEIGHT = "height"; //$NON-NLS-1$
- public static final String ATTR_NAME_HSPACE = "hspace"; //$NON-NLS-1$
- public static final String ATTR_NAME_JREVERSION = "jreversion"; //$NON-NLS-1$
- public static final String ATTR_NAME_VSPACE = "vspace"; //$NON-NLS-1$
- public static final String ATTR_NAME_WIDTH = "width"; //$NON-NLS-1$
- public static final String ATTR_NAME_NSPLUGINURL = "nspluginurl"; //$NON-NLS-1$
- public static final String ATTR_NAME_IEPLUGINURL = "iepluginurl"; //$NON-NLS-1$
- // root
- public static final String ATTR_NAME_XMLNS_JSP = "xmlns:jsp"; //$NON-NLS-1$
- public static final String ATTR_NAME_VERSION = "version"; //$NON-NLS-1$
- // attribute values
- public static final String ATTR_VALUE_TRUE = "true"; //$NON-NLS-1$
- public static final String ATTR_VALUE_FALSE = "false"; //$NON-NLS-1$
- public static final String ATTR_VALUE_JAVA = "java"; //$NON-NLS-1$
- public static final String ATTR_VALUE_CT_DEFAULT = "text/html; charset=ISO-8859-1";//D195366 //$NON-NLS-1$
- public static final String ATTR_VALUE_BUFSIZ_DEFAULT = "8kb"; //$NON-NLS-1$
- public static final String ATTR_VALUE_PAGE = "page"; //$NON-NLS-1$
- public static final String ATTR_VALUE_SESSION = "session"; //$NON-NLS-1$
- public static final String ATTR_VALUE_REQUEST = "request"; //$NON-NLS-1$
- public static final String ATTR_VALUE_APPLICATION = "application"; //$NON-NLS-1$
- public static final String ATTR_VALUE_BEAN = "bean"; //$NON-NLS-1$
- public static final String ATTR_VALUE_APPLET = "applet"; //$NON-NLS-1$
- public static final String ATTR_VALUE_TOP = "top"; //$NON-NLS-1$
- public static final String ATTR_VALUE_MIDDLE = "middle"; //$NON-NLS-1$
- public static final String ATTR_VALUE_BOTTOM = "bottom"; //$NON-NLS-1$
- public static final String ATTR_VALUE_LEFT = "left"; //$NON-NLS-1$
- public static final String ATTR_VALUE_RIGHT = "right"; //$NON-NLS-1$
- public static final String ATTR_VALUE_JVER11 = "1.1"; //$NON-NLS-1$
- public static final String ATTR_VALUE_XMLNS_JSP = "http://java.sun.com/JSP/Page"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSP12Namespace.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSP12Namespace.java
deleted file mode 100644
index 5c241efe75..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSP12Namespace.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core;
-
-/**
- * Names for JSP 1.2 spec.
- * Currently, it is just the same as JSP11Namespace in org.eclipse.jst.jsp.core.
- */
-public interface JSP12Namespace extends JSP11Namespace {
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSP20Namespace.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSP20Namespace.java
deleted file mode 100644
index 236bcf2901..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSP20Namespace.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core;
-
-/**
- * New names for JSP 2.0 spec.
- */
-
-public interface JSP20Namespace extends JSP12Namespace {
- public static interface ElementName extends JSP12Namespace.ElementName {
- String DIRECTIVE_TAG = "jsp:directive.tag"; //$NON-NLS-1$
- String DIRECTIVE_ATTRIBUTE = "jsp:directive.attribute"; //$NON-NLS-1$
- String DIRECTIVE_VARIABLE = "jsp:directive.variable"; //$NON-NLS-1$
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/Logger.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/Logger.java
deleted file mode 100644
index 82641dc5bc..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/Logger.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core;
-
-/**
- * @deprecated moved to internal package because only this plugin should be
- * using this Logger class.
- *
- * will be removed in M4
- */
-public class Logger extends org.eclipse.jst.jsp.core.internal.Logger {
- // see org.eclipse.jst.jsp.core.internal.Logger
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/PageDirectiveAdapter.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/PageDirectiveAdapter.java
deleted file mode 100644
index 910e0a5569..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/PageDirectiveAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core;
-
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.ui.contentproperties.IContentSettingsListener;
-
-/**
- * Classes which implement this interface have two responsibilities.
- * One is to provide
- * and embedded factory registry for JSP Aware INodeAdapter Factories
- * to use. The other is to monitor page directives and if
- * a change in embedded type is is made, it will signal
- * the structuredModel that it needs to reinitialize itself.
- */
-public interface PageDirectiveAdapter extends INodeAdapter, IContentSettingsListener {
-
- public String getContentType();
-
- public String getLanguage();
-
- /**
- * This setter method should be called once, shortly after
- * initialization.
- */
- void setEmbeddedType(EmbeddedTypeHandler handler);
-
- EmbeddedTypeHandler getEmbeddedType();
-
- /**
- * This method is to give this adapter a chance to use
- * the AdapterFactores from the EmbeddedTypeHandler
- * to adapt the node. Its to be used by JSPAwareAdapterFactories
- * to (potentially) adapt nodes from the embedded content type.
- */
- INodeAdapter adapt(INodeNotifier notifier, Object type);
-
- void addEmbeddedFactory(AdapterFactory factory);
-
- /**
- * Method setLanguage.
- * @param language
- */
- void setLanguage(String language);
-
- INodeNotifier getTarget();
-
- public void release(Object key);
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP11TLDNames.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP11TLDNames.java
deleted file mode 100644
index 8d57dc4655..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP11TLDNames.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-public interface JSP11TLDNames {
-
- String TAGLIB = "taglib"; //$NON-NLS-1$
-
- String CONTENT_JSP = "JSP"; //$NON-NLS-1$
- String CONTENT_EMPTY = "empty"; //$NON-NLS-1$
- String CONTENT_TAGDEPENDENT = "tagdependent"; //$NON-NLS-1$
-
- String TAG = "tag"; //$NON-NLS-1$
- String JSPVERSION = "jspversion"; //$NON-NLS-1$
- String TLIBVERSION = "tlibversion"; //$NON-NLS-1$
- String SHORTNAME = "shortname"; //$NON-NLS-1$
- String URI = "uri"; //$NON-NLS-1$
- String URN = "urn"; //$NON-NLS-1$
- String INFO = "info"; //$NON-NLS-1$
-
- String NAME = "name"; //$NON-NLS-1$
- String TEICLASS = "teiclass"; //$NON-NLS-1$
- String TAGCLASS = "tagclass"; //$NON-NLS-1$
- String BODYCONTENT = "bodycontent"; //$NON-NLS-1$
- String ATTRIBUTE = "attribute"; //$NON-NLS-1$
-
- String ID = "id"; //$NON-NLS-1$
- String REQUIRED = "required"; //$NON-NLS-1$
- String RTEXPRVALUE = "rtexprvalue"; //$NON-NLS-1$
-
- String PREFIX = "prefix"; //$NON-NLS-1$
-
- String INCLUDE = "include"; //$NON-NLS-1$
- String FILE = "file"; //$NON-NLS-1$
-
- String TRUE = "true"; //$NON-NLS-1$
- String FALSE = "false"; //$NON-NLS-1$
- String YES = "yes"; //$NON-NLS-1$
- String NO = "no"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP12TLDNames.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP12TLDNames.java
deleted file mode 100644
index 7bf8b4bdf5..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP12TLDNames.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-public interface JSP12TLDNames {
-
- String TAGLIB = JSP11TLDNames.TAGLIB;
-
- String CONTENT_JSP = JSP11TLDNames.CONTENT_JSP;
- String CONTENT_EMPTY = JSP11TLDNames.CONTENT_EMPTY;
- String CONTENT_TAGDEPENDENT = JSP11TLDNames.CONTENT_TAGDEPENDENT;
-
- String TAG = JSP11TLDNames.TAG;
- String JSP_VERSION = "jsp-version"; //$NON-NLS-1$
- String TLIB_VERSION = "tlib-version"; //$NON-NLS-1$
- String SHORT_NAME = "short-name"; //$NON-NLS-1$
- String URI = JSP11TLDNames.URI;
- String URN = JSP11TLDNames.URN;
-
- String NAME = JSP11TLDNames.NAME;
- String TEI_CLASS = "tei-class"; //$NON-NLS-1$
- String TAG_CLASS = "tag-class"; //$NON-NLS-1$
- String BODY_CONTENT = "body-content"; //$NON-NLS-1$
- String ATTRIBUTE = JSP11TLDNames.ATTRIBUTE;
-
- String ID = JSP11TLDNames.ID;
- String REQUIRED = JSP11TLDNames.REQUIRED;
- String RTEXPRVALUE = JSP11TLDNames.RTEXPRVALUE;
-
- String PREFIX = JSP11TLDNames.PREFIX;
-
- String INCLUDE = JSP11TLDNames.INCLUDE;
- String FILE = JSP11TLDNames.FILE;
-
- String TRUE = JSP11TLDNames.TRUE;
- String FALSE = JSP11TLDNames.FALSE;
- String YES = JSP11TLDNames.YES;
- String NO = JSP11TLDNames.NO;
-
- /*
- * @since JSP 1.2
- */
- String DESCRIPTION = "description"; //$NON-NLS-1$
- String DISPLAY_NAME = "display-name"; //$NON-NLS-1$
- String SMALL_ICON = "small-icon"; //$NON-NLS-1$
- String LARGE_ICON = "large-icon"; //$NON-NLS-1$
-
-
- String VALIDATOR = "validator"; //$NON-NLS-1$
- String VALIDATOR_CLASS = "validator-class"; //$NON-NLS-1$
- String VALIDATOR_INIT_PARAM = "init-param"; //$NON-NLS-1$
- String VALIDATOR_PARAM_NAME = "param-name"; //$NON-NLS-1$
- String VALIDATOR_PARAM_VALUE = "param-value"; //$NON-NLS-1$
-
-
- String LISTENER = "listener"; //$NON-NLS-1$
- String LISTENER_CLASS = "listener-class"; //$NON-NLS-1$
-
- String VARIABLE = "variable"; //$NON-NLS-1$
- String VARIABLE_NAME_GIVEN = "name-given"; //$NON-NLS-1$
- String VARIABLE_NAME_FROM_ATTRIBUTE = "name-from-attribute"; //$NON-NLS-1$
- String VARIABLE_CLASS = "variable-class"; //$NON-NLS-1$
- String VARIABLE_DECLARE = "declare"; //$NON-NLS-1$
- String VARIABLE_SCOPE = "scope"; //$NON-NLS-1$
- String VARIABLE_SCOPE_NESTED = "NESTED"; //$NON-NLS-1$
- String VARIABLE_SCOPE_AT_BEGIN = "AT_BEGIN"; //$NON-NLS-1$
- String VARIABLE_SCOPE_AT_END = "AT_END"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP20TLDNames.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP20TLDNames.java
deleted file mode 100644
index 7de03c7b32..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP20TLDNames.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-/*nlsXXX*/
-public interface JSP20TLDNames extends JSP12TLDNames {
- String CONTENT_SCRIPTLESS = "scriptless"; //$NON-NLS-1$
- String EXAMPLE = "example"; //$NON-NLS-1$
- String FRAGMENT = "fragment"; //$NON-NLS-1$
- String FUNCTION = "function"; //$NON-NLS-1$
- String FUNCTION_CLASS = "function-class"; //$NON-NLS-1$
- String FUNCTION_EXTENSION = "function-extension"; //$NON-NLS-1$
- String FUNCTION_SIGNATURE = "function-signature"; //$NON-NLS-1$
- String ICON = "icon"; //$NON-NLS-1$
- String PATH = "path"; //$NON-NLS-1$
- String TAG_EXTENSION = "tag-extension"; //$NON-NLS-1$
- String TAG_FILE = "tag-file"; //$NON-NLS-1$
-
- String TAGDIR = "tagdir"; //$NON-NLS-1$
-
- String TAGLIB_EXTENSION = "taglib-extension"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDAttributeDeclaration.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDAttributeDeclaration.java
deleted file mode 100644
index 335b1608b8..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDAttributeDeclaration.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-
-
-import org.eclipse.wst.common.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-
-/**
- * Represents an attribute definition from a TLD
- */
-public interface TLDAttributeDeclaration extends CMAttributeDeclaration {
-
- /**
- * a description of the attribute
- * @return String
- * @since JSP 2.0
- */
- String getDescription();
-
- /**
- * the attribute's name
- * @since JSP 1.1
- */
- String getId();
-
- CMDocument getOwnerDocument();
-
- /**
- * whether the attribute's value may be dynamically calculated at runtime by an expression
- * @since JSP 1.1
- */
- String getRtexprvalue();
-
- /**
- * the type of the attribute's value
- * @since JSP 1.2
- */
- String getType();
-
- /**
- * whether this attribute is a fragment
- *
- * @return boolean
- */
- boolean isFragment();
-
- /**
- * if the attribute is required or optional
- * @since JSP 1.1
- */
- boolean isRequired();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDDocument.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDDocument.java
deleted file mode 100644
index 04b72890fb..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDDocument.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-import java.util.List;
-
-import org.eclipse.wst.common.contentmodel.CMDocument;
-
-public interface TLDDocument extends CMDocument {
-
- String CM_KIND = "Content Model Kind"; //$NON-NLS-1$
- String JSP_TLD = "JSP Tag Library Descriptor"; //$NON-NLS-1$
-
- /**
- * @since JSP 2.0
- *
- * @return
- */
- String getBaseLocation();
-
- /**
- * @return String - The contents of the "description" element of a JSP 1.2 tag library descriptor; a simple string describing the "use" of this taglib, should be user discernable.
- * @since JSP 1.2
- */
- String getDescription();
-
- /**
- * @return String - The contents of the "display-name" element of a JSP 1.2 tag library descriptor; it is a short name that is intended to be displayed by tools
- * @since JSP 1.2
- */
- String getDisplayName();
-
- /**
- * @return List - A list of extension elements describing the tag library
- * @since JSP 2.0
- */
- List getExtensions();
-
- /**
- * @return List - A list of TLDFunctions describing the declared functions
- * @since JSP 2.0
- */
- List getFunctions();
-
- /**
- * @return String - The contents of the "info" element of a JSP 1.1 tag library descriptor; a simple string describing the "use" of this taglib, should be user discernable.
- * @since JSP 1.1
- */
- String getInfo();
-
- /**
- * @return String - The version of JSP the tag library depends upon
- * @since JSP 1.1
- */
- String getJspversion();
-
- /**
- * @return String - The contents of the "large-icon" element of a JSP 1.2 tag library descriptor; optional large-icon that can be used by tools
- * @since JSP 1.2
- */
- String getLargeIcon();
-
- /**
- * @since JSP 1.2
- * @return List - a List of TLDListeners
- */
- List getListeners();
-
- /**
- * @return String - A simple default short name that could be used by a JSP authoring tool to create names with a mnemonic value; for example, it may be used as the preferred prefix value in taglib directives
- * @since JSP 1.1
- */
- String getShortname();
-
- /**
- * @return String - The contents of the "small-icon" element of a JSP 1.2 tag library descriptor; optional small-icon that can be used by tools
- * @since JSP 1.2
- */
- String getSmallIcon();
-
- /**
- * @return String - The version of the tag library (it's implementation)
- * @since JSP 1.1
- */
- String getTlibversion();
-
- /**
- * @return String - the URI declared within the descriptor
- * @since JSP 1.1
- */
- String getUri();
-
- /**
- * @since JSP 1.2
- */
- TLDValidator getValidator();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDElementDeclaration.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDElementDeclaration.java
deleted file mode 100644
index 8ca165e20d..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDElementDeclaration.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-import java.util.List;
-
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-
-public interface TLDElementDeclaration extends CMElementDeclaration {
-
- /**
- * The body content type
- *
- * @since JSP 1.1
- */
- String getBodycontent();
-
- /**
- * Optional tag-specific information
- *
- * @since JSP 1.2
- */
- String getDescription();
-
- /**
- * A short name that is intended to be displayed by tools
- *
- * @since JSP 1.2
- */
- String getDisplayName();
-
- /**
- * Optional informal description of an example of a use of this tag
- *
- * @since JSP 2.0
- */
- String getExample();
-
- /**
- * Zero or more extensions that provide extra information about this tag,
- * for tool consumption
- *
- * @since JSP 2.0
- */
- List getExtensions();
-
- /**
- * Optional tag-specific information
- *
- * @since JSP 1.1
- */
- String getInfo();
-
- /**
- * Name of an optional large icon that can be used by tools
- *
- * @since JSP 1.2
- */
- String getLargeIcon();
-
- CMDocument getOwnerDocument();
-
- /**
- * Where to find the .tag file implementing this action, relative to the
- * root of the web application or the root of the JAR file for a tag
- * library packaged in a JAR. This must begin with /WEB-INF/tags if the
- * .tag file resides in the WAR, or /META-INF/tags if the .tag file
- * resides in a JAR.
- *
- *
- * @return the path to the .tag(x) file as defined in the .tld file, null
- * if internal to the .tld
- * @since JSP 2.0
- */
- String getPath();
-
- /**
- * Name of an optional small icon that can be used by tools
- *
- * @since JSP 1.2
- */
- String getSmallIcon();
-
- /**
- * The name of the tag handler class implementing
- * javax.servlet.jsp.tagext.Tag
- *
- * @since JSP 1.1
- */
- String getTagclass();
-
- /**
- * The name of an optional subclass of
- * javax.servlet.jsp.tagext.TagExtraInfo
- *
- * @since JSP 1.1
- */
- String getTeiclass();
-
- /**
- * @since JSP 1.2
- * @return List of TLDVariables
- */
- List getVariables();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDFunction.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDFunction.java
deleted file mode 100644
index 917efa763f..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDFunction.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-import java.util.List;
-
-import org.eclipse.wst.common.contentmodel.CMDocument;
-
-public interface TLDFunction {
-
- String getClassName();
-
- String getDescription();
-
- String getDisplayName();
-
- String getExample();
-
- List getExtensions();
-
- String getIcon();
-
- String getName();
-
- CMDocument getOwnerDocument();
-
- String getSignature();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDInitParam.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDInitParam.java
deleted file mode 100644
index 19ada7207e..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDInitParam.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-
-/**
- * A name/value pair as an initialization param along with a description
- * @since JSP 1.2
- */
-public interface TLDInitParam {
- String getDescription();
-
- /**
- * The param-name element contains the name of a parameter.
- */
- String getName();
-
- /**
- * The param-value element contains the name of a parameter.
- */
- String getValue();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDListener.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDListener.java
deleted file mode 100644
index ecbd0f8123..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDListener.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-
-/**
- * Defines an optional event listener object to be instantiated and registered automatically
- * @since JSP 1.2
- */
-public interface TLDListener {
- String getListenerClass();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDValidator.java
deleted file mode 100644
index 0463bc15f8..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDValidator.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-import java.util.List;
-
-
-/**
- * Defines an optional validator that can be used to validate the conformance of a JSP page to using this tag library
- * @since JSP 1.2
- */
-public interface TLDValidator {
- /**
- * @return List - a List of TLDInitParams
- */
- List getInitParams();
-
- String getValidatorClass();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDVariable.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDVariable.java
deleted file mode 100644
index ec10a92144..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDVariable.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-/**
- * Information on the scripting variables defined by this tag.
- * @since JSP 1.2
- */
-public interface TLDVariable {
-
- /**
- * Whether the variable is declared or not, true is the default.
- */
- boolean getDeclare();
-
- String getDescription();
-
- /**
- * The name of an attribute whose (translation time) value will give the name of the variable.
- */
- String getNameFromAttribute();
-
- /**
- * The variable name given as a constant
- */
- String getNameGiven();
-
- /**
- * The scope of the scripting variable defined.
- */
- String getScope();
-
- /**
- * Name of the class of the variable, java.lang.String if null
- */
- String getVariableClass();
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/URIResolverProvider.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/URIResolverProvider.java
deleted file mode 100644
index d11fa98dba..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/URIResolverProvider.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.contentmodel.tld;
-
-/**
- * @deprecated - will be removed in M4
- */
-
-import org.eclipse.wst.sse.core.util.URIResolver;
-
-public interface URIResolverProvider {
-
- URIResolver getResolver();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contenttype/ContentTypeIdForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contenttype/ContentTypeIdForJSP.java
deleted file mode 100644
index a82ca33df7..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contenttype/ContentTypeIdForJSP.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.jst.jsp.core.contenttype;
-
-/**
- * This class, with its one field, is a convience to provide compile-time
- * safety when refering to a contentType ID. The value of the contenttype id
- * field must match what is specified in plugin.xml file.
- */
-
-public class ContentTypeIdForJSP {
- /*
- * The value of the contenttype id field must match what is specified in
- * plugin.xml file. Note: this value is intentially not declared as final,
- * so it will not be inlined.
- */
- public static String ContentTypeID_JSP = "org.eclipse.jst.jsp.core.jspsource"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/IJSPHeadContentDetector.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/IJSPHeadContentDetector.java
deleted file mode 100644
index 303c4e0275..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/IJSPHeadContentDetector.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.encoding;
-
-import java.io.IOException;
-
-import org.eclipse.wst.sse.core.document.IDocumentCharsetDetector;
-
-public interface IJSPHeadContentDetector extends IDocumentCharsetDetector {
- String getContentType() throws IOException;
-
- String getLanguage() throws IOException;
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentHeadContentDetector.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentHeadContentDetector.java
deleted file mode 100644
index 491d4ef5c7..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentHeadContentDetector.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.encoding;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.contenttype.JSPResourceEncodingDetector;
-import org.eclipse.wst.sse.core.document.DocumentReader;
-
-/**
- * This class parses beginning portion of JSP file to get attributes in page
- * directiive
- *
- */
-public class JSPDocumentHeadContentDetector extends JSPResourceEncodingDetector implements IJSPHeadContentDetector {
-
- public JSPDocumentHeadContentDetector() {
- super();
- }
-
- public void set(IDocument document) {
- set(new DocumentReader(document, 0));
-
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentLoader.java
deleted file mode 100644
index 251fa02d62..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentLoader.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.encoding;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jst.jsp.core.JSP11Namespace;
-import org.eclipse.jst.jsp.core.PageDirectiveAdapter;
-import org.eclipse.jst.jsp.core.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.internal.document.PageDirectiveWatcherFactory;
-import org.eclipse.jst.jsp.core.internal.parser.JSPReParser;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP;
-import org.eclipse.wst.common.encoding.CodedReaderCreator;
-import org.eclipse.wst.common.encoding.ContentTypeEncodingPreferences;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.PropagatingAdapter;
-import org.eclipse.wst.sse.core.document.AbstractDocumentLoader;
-import org.eclipse.wst.sse.core.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.document.StructuredDocumentFactory;
-import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistry;
-import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistryImpl;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.sse.core.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.modelquery.ModelQueryAdapter;
-import org.eclipse.wst.sse.core.parser.JSPCapableParser;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.parser.TagMarker;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.util.Assert;
-import org.eclipse.wst.xml.core.document.XMLDocument;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.w3c.dom.Document;
-
-public class JSPDocumentLoader extends AbstractDocumentLoader {
- private final static String DEFAULT_LANGUAGE = "java"; //$NON-NLS-1$
- private final static String DEFAULT_MIME_TYPE = "text/html"; //$NON-NLS-1$
- private final static String SPEC_DEFAULT_ENCODING = "ISO-8859-1"; //$NON-NLS-1$
-
- protected static IFile getFileFor(IStructuredModel model) {
- if (model == null)
- return null;
- String path = model.getBaseLocation();
- if (path == null || path.length() == 0) {
- Object id = model.getId();
- if (id == null)
- return null;
- path = id.toString();
- }
- // TODO needs rework for linked resources
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile file = root.getFileForLocation(new Path(path));
- return file;
- }
-
- private EmbeddedTypeRegistry fEmbeddedContentTypeRegistry;
-
- public JSPDocumentLoader() {
- super();
- }
-
- private void addNestablePrefix(JSPSourceParser parser, String tagName) {
- TagMarker bm = new TagMarker(tagName);
- parser.addNestablePrefix(bm);
- }
-
- synchronized public IEncodedDocument createNewStructuredDocument(IFile iFile) throws IOException, CoreException {
- IStructuredDocument structuredDocument = null;
- try {
- structuredDocument = createCodedDocument(iFile);
-
- EmbeddedTypeHandler embeddedType = getEmbeddedType(iFile);
- if (embeddedType != null)
- embeddedType.initializeParser((JSPCapableParser) structuredDocument.getParser());
-
- fFullPreparedReader.reset();
- setDocumentContentsFromReader(structuredDocument, fFullPreparedReader);
-
- }
- finally {
- if (fFullPreparedReader != null) {
- fFullPreparedReader.close();
- }
- }
- return structuredDocument;
- }
-
- private IStructuredDocument createCodedDocument(IFile iFile) throws CoreException, UnsupportedEncodingException, IOException {
- IStructuredDocument structuredDocument = (IStructuredDocument) createNewStructuredDocument();
-
- getCodedReaderCreator().set(iFile);
-
- fFullPreparedReader = getCodedReaderCreator().getCodedReader();
- fEncodingMemento = getCodedReaderCreator().getEncodingMemento();
-
- structuredDocument.setEncodingMemento(getCodedReaderCreator().getEncodingMemento());
-
- return structuredDocument;
- }
-
- public IEncodedDocument createNewStructuredDocument(String filename, InputStream inputStream) throws UnsupportedEncodingException, IOException {
- if (filename == null && inputStream == null) {
- throw new IllegalArgumentException("can not have both null filename and inputstream"); //$NON-NLS-1$
- }
- IEncodedDocument structuredDocument = createNewStructuredDocument();
- CodedReaderCreator codedReaderCreator = new CodedReaderCreator();
- try {
- codedReaderCreator.set(filename, inputStream);
- fFullPreparedReader = codedReaderCreator.getCodedReader();
- fEncodingMemento = codedReaderCreator.getEncodingMemento();
- structuredDocument.setEncodingMemento(fEncodingMemento);
- // the fact that file is null means this method/code path is no
- // good for JSP fragments
- EmbeddedTypeHandler embeddedType = getEmbeddedType((IFile) null);
- fFullPreparedReader.reset();
- if (embeddedType != null)
- embeddedType.initializeParser((JSPCapableParser) ((IStructuredDocument) structuredDocument).getParser());
- setDocumentContentsFromReader(structuredDocument, fFullPreparedReader);
- }
- catch (CoreException e) {
- // impossible in this context
- throw new Error(e);
- }
- finally {
- if (fFullPreparedReader != null) {
- fFullPreparedReader.close();
- }
- }
- return structuredDocument;
-
- }
-
- /**
- * Method getDefaultDocumentPartitioner.
- *
- * @return IDocumentPartitioner
- */
- public IDocumentPartitioner getDefaultDocumentPartitioner() {
- return new StructuredTextPartitionerForJSP();
- }
-
- /**
- * Method getDefaultMimeType.
- *
- * @return String
- */
- private String getDefaultMimeType() {
- return DEFAULT_MIME_TYPE;
- }
-
- /**
- * @see com.ibm.sed.model.AbstractDumper#getDocumentEncodingDetector()
- */
- public IDocumentCharsetDetector getDocumentEncodingDetector() {
- if (fDocumentEncodingDetector == null) {
- fDocumentEncodingDetector = new JSPDocumentHeadContentDetector();
- }
- return fDocumentEncodingDetector;
- }
-
- /**
- * Gets the embeddedContentTypeRegistry.
- *
- * @return Returns a EmbeddedContentTypeRegistry
- */
- private EmbeddedTypeRegistry getEmbeddedContentTypeRegistry() {
- if (fEmbeddedContentTypeRegistry == null) {
- fEmbeddedContentTypeRegistry = EmbeddedTypeRegistryImpl.getInstance();
- }
- return fEmbeddedContentTypeRegistry;
- }
-
- private EmbeddedTypeHandler getEmbeddedType(IStructuredModel model) {
- Document doc = ((XMLModel) model).getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) ((INodeNotifier) doc).getAdapterFor(PageDirectiveAdapter.class);
- EmbeddedTypeHandler embeddedHandler = pageDirectiveAdapter.getEmbeddedType();
- return embeddedHandler;
- }
-
- /**
- * Determine the MIME content type specified in a page directive. This
- * should appear "as early as possible in the JSP page" according to the
- * JSP v1.2 specification.
- */
- private EmbeddedTypeHandler getEmbeddedType(IFile file) throws UnsupportedEncodingException, CoreException, IOException {
- EmbeddedTypeHandler handler = null;
- if (fFullPreparedReader == null) {
- handler = getJSPDefaultEmbeddedType();
- }
- else {
- String mimeType = null;
-
- IDocumentCharsetDetector jspProvider = getDocumentEncodingDetector();
- jspProvider.set(getFullPreparedReader());
- if (jspProvider instanceof IJSPHeadContentDetector) {
- mimeType = ((IJSPHeadContentDetector) jspProvider).getContentType();
- }
-
- EmbeddedTypeRegistry reg = getEmbeddedContentTypeRegistry();
- if (mimeType == null || mimeType.length() == 0) {
- handler = getJSPDefaultEmbeddedType();
- }
- else {
- handler = reg.getTypeFor(mimeType);
- }
- }
- return handler;
- }
-
- /**
- * For JSP files, text/html is the default content type. This may want
- * this different for types like jsv (jsp for voice xml) For now, hard
- * code to new instance. In future, should get instance from registry.
- * Specification cites HTML as the default contentType.
- */
- private EmbeddedTypeHandler getJSPDefaultEmbeddedType() {
- EmbeddedTypeRegistry reg = getEmbeddedContentTypeRegistry();
- return reg.getTypeFor(getDefaultMimeType());
- }
-
- /**
- * Method getLanguage.
- *
- * @param model
- * @return String
- */
- private String getLanguage(IStructuredModel model) throws IOException {
- String result = null;
- // first check the model (document itself) to see if contains
- result = getLanguageFromStructuredDocument(model.getStructuredDocument());
- // Note: if model contains an unsupported
- // language, we'll even return it,
- // since who knows what future holds.
-
- // always return something
- if (result == null) {
- result = DEFAULT_LANGUAGE;
- }
- return result;
- }
-
- /**
- * Method getLanguageFromStructuredDocument.
- *
- * @param structuredDocument
- * @return String
- */
- private String getLanguageFromStructuredDocument(IDocument document) throws IOException {
- if (document == null)
- return null;
- String result = null;
- // bascially same algorithm as get encoding or
- // get content type from structuredDocument.
- IJSPHeadContentDetector localHeadParser = (IJSPHeadContentDetector) getDocumentEncodingDetector();
- // we can be assured that its already been
- // parsed. If not call parseHeaderForPageDirective()
- // before calling getLanguage;
- localHeadParser.set(document);
- result = localHeadParser.getLanguage();
- return result;
- }
-
- public RegionParser getParser() {
- // remember, the Loader
- // will need to finish initialization of parser
- // based on "embedded content"
- JSPSourceParser parser = new JSPSourceParser();
- // add default nestable tag list
- addNestablePrefix(parser, JSP11Namespace.JSP_TAG_PREFIX);
- return parser;
- }
-
- protected String getPreferredNewLineDelimiter() {
- return ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForJSP.ContentTypeID_JSP);
- }
-
- /**
- * Specification cites ISO-8859-1/Latin-1 as the default charset.
- */
- protected String getSpecDefaultEncoding() {
- return SPEC_DEFAULT_ENCODING;
- }
-
- /**
- * This is "reinitialize" since there should always be at least the
- * default one assigned, before we start checking the stream
- */
- private void initCloneOfEmbeddedType(IStructuredModel model, EmbeddedTypeHandler oldEmbeddedContentType, EmbeddedTypeHandler newEmbeddedContentType) throws IOException {
- // check program logic
- Assert.isNotNull(oldEmbeddedContentType, "Program error: invalid call during model initialization"); //$NON-NLS-1$
- // once we know the embedded content type, we need to set it in the
- // PageDirectiveAdapter ... the order of initialization is
- // critical here, the doc must have been created, but its contents not
- // set
- // yet,
- // and all factories must have been set up also.
- XMLModel domModel = (XMLModel) model;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- XMLDocument document = domModel.getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getAdapterFor(PageDirectiveAdapter.class);
- // ==> // PropagatingAdapter propagatingAdapter = (PropagatingAdapter)
- // ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
- // ==> // ModelQueryAdapter modelQueryAdapter = (ModelQueryAdapter)
- // ((INodeNotifier) document).getAdapterFor(ModelQueryAdapter.class);
- // because, even in the clone case, the model has been paritally
- // intialized
- // with
- // the old embedded type (during createModel), we need to unitialize
- // parts of it, based on the old (or default) ones
- oldEmbeddedContentType.uninitializeFactoryRegistry(model.getFactoryRegistry());
- oldEmbeddedContentType.uninitializeParser((JSPCapableParser) structuredDocument.getParser());
- // remember, embedded type factories are automatically cleared when
- // embededType changed
- pageDirectiveAdapter.setEmbeddedType(newEmbeddedContentType);
- if (newEmbeddedContentType != null) {
- newEmbeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
- newEmbeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
- }
- // adding language here, in this convienent central
- // location, but some obvious renaming or refactoring
- // wouldn't hurt, in future.
- // I needed to add this language setting for JSP Fragment support
- // Note: this is the one that counts, since at this point,
- // the model has an ID, so we can look up IFile, etc.
- String language = getLanguage(model);
- if (language != null && language.length() > 0) {
- pageDirectiveAdapter.setLanguage(language);
- }
- }
-
- /**
- * Method initEmbeddedType.
- */
- private void initEmbeddedType(IStructuredModel model) {
- initializeEmbeddedTypeFromDefault(model);
- }
-
- /**
- * Method initEmbeddedType.
- */
- private void initEmbeddedType(IStructuredModel oldModel, IStructuredModel newModel) throws IOException {
- EmbeddedTypeHandler existingEmbeddedType = getEmbeddedType(oldModel);
- EmbeddedTypeHandler newEmbeddedContentType = existingEmbeddedType.newInstance();
- if (existingEmbeddedType == null) {
- initEmbeddedType(newModel);
- }
- else {
- //initEmbeddedType(newModel);
- initCloneOfEmbeddedType(newModel, existingEmbeddedType, newEmbeddedContentType);
- }
- setLanguageInPageDirective(newModel);
- }
-
- /**
- * This is "initialize" since is always assumes it hasn't been initalized
- * yet.
- */
- private void initializeEmbeddedType(IStructuredModel model, EmbeddedTypeHandler embeddedContentType) {
- // check program logic
- Assert.isNotNull(embeddedContentType, "Program error: invalid call during model initialization"); //$NON-NLS-1$
- // once we know the embedded content type, we need to set it in the
- // PageDirectiveAdapter ... the order of initialization is
- // critical here, the doc must have been created, but its contents not
- // set
- // yet,
- // and all factories must have been set up also.
- XMLModel domModel = (XMLModel) model;
- XMLDocument document = domModel.getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getAdapterFor(PageDirectiveAdapter.class);
- pageDirectiveAdapter.setEmbeddedType(embeddedContentType);
- embeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- embeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
- // adding language here, in this convienent central
- // location, but some obvious renaming or refactoring
- // wouldn't hurt, in future.
- // I needed to add this language setting for JSP Fragment support
- // Note: I don't think this attempted init counts for much.
- // I think its always executed when model is very first
- // being initialized, and doesn't even have content
- // or an ID yet. I thought I'd leave, since it wouldn't
- // hurt, in case its called in other circumstances.
- // String language = getLanguage(model);
- // pageDirectiveAdapter.setLanguage(language);
- }
-
- /**
- * This init method is for the case where we are creating an empty model,
- * which we always do.
- */
- private void initializeEmbeddedTypeFromDefault(IStructuredModel model) {
- EmbeddedTypeHandler embeddedContentType = getJSPDefaultEmbeddedType();
- initializeEmbeddedType(model, embeddedContentType);
- }
-
- /**
- * This method must return a new instance of IStructuredDocument, that has
- * been initialized with appropriate parser. For many loaders, the
- * (default) parser used is known for any input. For others, the correct
- * parser (and its initialization) is normall dependent on the content of
- * the file. This no-argument method should assume "empty input" and would
- * therefore return the default parser for the default contentType. If the
- * parser is to handle tag libraries, it must have a TaglibSupport object
- * with a valid URIResolver and this IStructuredDocument attached to it
- * before the contents are set on the IStructuredDocument.
- */
- protected IEncodedDocument newEncodedDocument() {
- IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
- ((BasicStructuredDocument) structuredDocument).setReParser(new JSPReParser());
- // structuredDocument.setDocumentPartitioner(new
- // JSPJavaDocumentPartioner());
- // even though this is an "empty model" ... we want it to have at
- // least
- // the
- // default embeddeded content type handler
- EmbeddedTypeHandler embeddedType = getJSPDefaultEmbeddedType();
- embeddedType.initializeParser((JSPCapableParser) structuredDocument.getParser());
- return structuredDocument;
- }
-
- public IDocumentLoader newInstance() {
- return new JSPDocumentLoader();
- }
-
- protected void preLoadAdapt(IStructuredModel structuredModel) {
- XMLModel domModel = (XMLModel) structuredModel;
- //
- // document must have already been set for this to
- // work.
- Document document = domModel.getDocument();
- Assert.isNotNull(document);
- // if there is a model in the adapter, this will adapt it to
- // first node. After that the PropagatingAdater spreads over the
- // children being
- // created. Each time that happends, a side effect is to
- // also "spread" sprecific registered adapters,
- // they two can propigate is needed.
- // This 'get' causes first to be be attached.
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
- // may make this easier to use in futue
- propagatingAdapter.addAdaptOnCreateFactory(new PageDirectiveWatcherFactory());
- // For JSPs, the ModelQueryAdapter must be "attached" to the document
- // before content is set in the model, so taglib initization can
- // take place.
- ((INodeNotifier) document).getAdapterFor(ModelQueryAdapter.class);
- //
- //
- }
-
- /**
- * This is "reinitialize" since there should always be at least the
- * default one assigned, before we start checking the stream
- */
- private void reInitializeEmbeddedType(IStructuredModel model, EmbeddedTypeHandler oldEmbeddedContentType, EmbeddedTypeHandler newEmbeddedContentType) throws IOException {
- // check program logic
- Assert.isNotNull(oldEmbeddedContentType, "Program error: invalid call during model initialization"); //$NON-NLS-1$
- // once we know the embedded content type, we need to set it in the
- // PageDirectiveAdapter ... the order of initialization is
- // critical here, the doc must have been created, but its contents not
- // set
- // yet,
- // and all factories must have been set up also.
- XMLModel domModel = (XMLModel) model;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- XMLDocument document = domModel.getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getExistingAdapter(PageDirectiveAdapter.class);
- // ==> // PropagatingAdapter propagatingAdapter = (PropagatingAdapter)
- // ((INodeNotifier)
- // document).getExistingAdapter(PropagatingAdapter.class);
- // ==> // ModelQueryAdapter modelQueryAdapter = (ModelQueryAdapter)
- // ((INodeNotifier)
- // document).getExistingAdapter(ModelQueryAdapter.class);
- oldEmbeddedContentType.uninitializeFactoryRegistry(model.getFactoryRegistry());
- oldEmbeddedContentType.uninitializeParser((JSPCapableParser) structuredDocument.getParser());
- // since 'document' is not recreated in this
- // reinit path, we need to remove all adapters,
- // except for the propagated adapters (including page
- // directive adapter, and model query adapter).
- // to accomplish this, we'll just remove all, then
- // add back with a call to pre-load adapt.
- // let clients decide to unload adapters from document
- // Collection oldAdapters = document.getAdapters();
- // Iterator oldAdaptersIterator = oldAdapters.iterator();
- // while (oldAdaptersIterator.hasNext()) {
- // INodeAdapter oldAdapter = (INodeAdapter)
- // oldAdaptersIterator.next();
- // if (oldAdapter != pageDirectiveAdapter && oldAdapter !=
- // propagatingAdapter && oldAdapter != modelQueryAdapter) {
- // // DO NOT remove directly!
- // // can change contents while in notifity loop!
- // //oldAdaptersIterator.remove();
- // document.removeAdapter(oldAdapter);
- // }
- // }
- // DMW: I believe something like the following is needed,
- // since releases cached adapters
- // if (document instanceof DocumentImpl) {
- // ((DocumentImpl) document).releaseDocumentType();
- // ((DocumentImpl) document).releaseStyleSheets();
- // }
- // remember, embedded type factories are automatically cleared when
- // embededType changed
- pageDirectiveAdapter.setEmbeddedType(newEmbeddedContentType);
- // // but still need to clear the page directive watchers, and let
- // them
- // be
- // rediscovered (with new, accurate node as target)
- // pageDirectiveAdapter.clearPageWatchers();
- if (newEmbeddedContentType != null) {
- newEmbeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
- newEmbeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
- }
- // adding language here, in this convienent central
- // location, but some obvious renaming or refactoring
- // wouldn't hurt, in future.
- // I needed to add this language setting for JSP Fragment support
- // Note: this is the one that counts, since at this point,
- // the model has an ID, so we can look up IFile, etc.
- String language = getLanguage(model);
- if (language != null && language.length() > 0) {
- pageDirectiveAdapter.setLanguage(language);
- }
- }
-
- private void setLanguageInPageDirective(IStructuredModel newModel) throws IOException {
- if (newModel instanceof XMLModel) {
- XMLDocument document = ((XMLModel) newModel).getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getAdapterFor(PageDirectiveAdapter.class);
- String language = getLanguage(newModel);
- pageDirectiveAdapter.setLanguage(language);
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
deleted file mode 100644
index 290175d594..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPIndexManager;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
-import org.eclipse.wst.common.encoding.CommonCharsetNames;
-import org.eclipse.wst.common.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class JSPCorePlugin extends Plugin {
- //The shared instance.
- private static JSPCorePlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
- private static final String KEY_PREFIX = "%"; //$NON-NLS-1$
- private static final String KEY_DOUBLE_PREFIX = "%%"; //$NON-NLS-1$
-
- /**
- * The constructor.
- */
- public JSPCorePlugin() {
- super();
- plugin = this;
- }
-
- /**
- * Returns the shared instance.
- */
- public static JSPCorePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#initializeDefaultPluginPreferences()
- */
- protected void initializeDefaultPluginPreferences() {
- Preferences prefs = getDefault().getPluginPreferences();
- // set model preference defaults
- prefs.setDefault(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE, CommonModelPreferenceNames.ASIS);
- prefs.setDefault(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE, CommonModelPreferenceNames.ASIS);
- prefs.setDefault(CommonModelPreferenceNames.INSERT_MISSING_TAGS, true);
- prefs.setDefault(CommonModelPreferenceNames.QUOTE_ATTR_VALUES, true);
- prefs.setDefault(CommonModelPreferenceNames.FORMAT_SOURCE, true);
- prefs.setDefault(CommonModelPreferenceNames.CONVERT_EOL_CODES, false);
-
- prefs.setDefault(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
-
- String defaultEnc = CommonModelPreferenceNames.UTF_8;
- String systemEnc = System.getProperty("file.encoding"); //$NON-NLS-1$
- if (systemEnc != null) {
- defaultEnc = CommonCharsetNames.getPreferredDefaultIanaName(systemEnc, CommonModelPreferenceNames.UTF_8);
- }
- prefs.setDefault(CommonEncodingPreferenceNames.OUTPUT_CODESET, defaultEnc);
-
- prefs.setDefault(CommonEncodingPreferenceNames.END_OF_LINE_CODE, ""); //$NON-NLS-1$
- prefs.setDefault(CommonModelPreferenceNames.TAB_WIDTH, CommonModelPreferenceNames.DEFAULT_TAB_WIDTH);
-
- prefs.setDefault(CommonModelPreferenceNames.FORMATTING_SUPPORTED, true);
- prefs.setDefault(CommonModelPreferenceNames.LINE_WIDTH, 72);
- prefs.setDefault(CommonModelPreferenceNames.SPLIT_MULTI_ATTRS, false);
- prefs.setDefault(CommonModelPreferenceNames.INDENT_USING_TABS, true);
- prefs.setDefault(CommonModelPreferenceNames.CLEAR_ALL_BLANK_LINES, false);
-
- prefs.setDefault(CommonModelPreferenceNames.PREFERRED_MARKUP_CASE_SUPPORTED, true);
- prefs.setDefault(CommonModelPreferenceNames.TAG_NAME_CASE, CommonModelPreferenceNames.UPPER);
- prefs.setDefault(CommonModelPreferenceNames.ATTR_NAME_CASE, CommonModelPreferenceNames.LOWER);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- // JSPIndexManager depends on TaglibController, so TaglibController
- // should be started first
- TaglibController.startup();
-
- // add JSPIndexManager to keep JSP Index up to date
- // listening for IResourceChangeEvent.PRE_DELETE and IResourceChangeEvent.POST_CHANGE
- ResourcesPlugin.getWorkspace().addResourceChangeListener(JSPIndexManager.getInstance(), IResourceChangeEvent.POST_CHANGE);
-
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5091
- // makes sure IndexManager is aware of our indexes
- JSPIndexManager.getInstance().saveIndexes();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- // stop listening
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(JSPIndexManager.getInstance());
- // stop any searching/indexing
- JSPSearchSupport.getInstance().setCanceled(true);
-
- TaglibController.shutdown();
-
- super.stop(context);
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String value) {
- String s = value.trim();
- if (!s.startsWith(KEY_PREFIX, 0))
- return s;
- if (s.startsWith(KEY_DOUBLE_PREFIX, 0))
- return s.substring(1);
-
- int ix = s.indexOf(' ');
- String key = ix == -1 ? s : s.substring(0, ix);
-
- ResourceBundle bundle = getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key.substring(1)) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- public static String getResourceString(String key, Object[] args) {
-
- try {
- return MessageFormat.format(getResourceString(key), args);
- } catch (IllegalArgumentException e) {
- return getResourceString(key);
- }
-
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.eclipse.jst.jsp.core.internal.JSPCorePluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
deleted file mode 100644
index bfa64fe7b2..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-JSPSearchSupport.0=JSP Search indexing workspace
-JSPIndexManager.0=Updating JSP Index
-JSPIndexManager.1=Processing resource delta
-JSPIndexManager.2=JSP Indexer indexing {0} files
-JSPIndexManager.3=JSP Indexer indexing file {0}
-JSPIndexManager.4=JSP Indexer
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/Logger.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/Logger.java
deleted file mode 100644
index a35dcd0f37..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/Logger.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if desired,
- * the console. This class should only be used by classes in this plugin. Other
- * plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.jst.jsp.core"; //$NON-NLS-1$
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
-
- public static final int OK = IStatus.OK; // 0
- public static final int INFO = IStatus.INFO; // 1
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int ERROR = IStatus.ERROR; // 4
-
- public static final int OK_DEBUG = 200 + OK;
- public static final int INFO_DEBUG = 200 + INFO;
- public static final int WARNING_DEBUG = 200 + WARNING;
- public static final int ERROR_DEBUG = 200 + ERROR;
-
- /**
- * Adds message to log.
- * @param level severity level of the message (OK, INFO, WARNING, ERROR, OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message text to add to the log
- * @param exception exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- * @param message text to print
- * @param category category of the message, to be compared with /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMContentWrapperImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMContentWrapperImpl.java
deleted file mode 100644
index 176e67f3e3..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMContentWrapperImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.common.contentmodel.CMContent;
-import org.eclipse.wst.common.contentmodel.CMNode;
-
-public class CMContentWrapperImpl extends CMNodeWrapperImpl implements CMContent {
-
- private CMContent fCMContent = null;
-
- /**
- * CMContentWrapper constructor comment.
- * @param prefix java.lang.String
- * @param node org.eclipse.wst.common.contentmodel.CMNode
- */
- public CMContentWrapperImpl(String prefix, org.eclipse.wst.common.contentmodel.CMContent node) {
- super(prefix, node);
- fCMContent = node;
- }
-
- /**
- * getMaxOccur method
- * @return int
- *
- * If -1, it's UNBOUNDED.
- */
- public int getMaxOccur() {
- return fCMContent.getMaxOccur();
- }
-
- /**
- * getMinOccur method
- * @return int
- *
- * If 0, it's OPTIONAL.
- * If 1, it's REQUIRED.
- */
- public int getMinOccur() {
- return fCMContent.getMinOccur();
- }
-
- public CMNode getOriginNode() {
- return fCMContent;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMDocumentWrapperImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMDocumentWrapperImpl.java
deleted file mode 100644
index 111770d5b8..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMDocumentWrapperImpl.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-
-
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.common.contentmodel.CMNamespace;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.sse.core.contentmodel.CMNodeWrapper;
-
-public class CMDocumentWrapperImpl implements CMDocument, CMNodeWrapper {
-
- class CMNamedNodeMapImpl implements CMNamedNodeMap {
-
- protected Hashtable table = new Hashtable();
-
- public CMNamedNodeMapImpl() {
- super();
- }
-
- Hashtable getHashtable() {
- return table;
- }
-
- public int getLength() {
- return table.size();
- }
-
- public CMNode getNamedItem(String name) {
- return (CMNode) table.get(name);
- }
-
- public CMNode item(int index) {
- Object result = null;
- int size = table.size();
- if (index < size) {
- Iterator values = iterator();
- for (int i = 0; i <= index; i++) {
- result = values.next();
- }
- }
- return (CMNode) result;
- }
-
- public Iterator iterator() {
- return table.values().iterator();
- }
-
- public void setNamedItem(String name, CMNode aNode) {
- if (name != null && aNode != null)
- table.put(name, aNode);
- }
- }
-
- public class CMNamespaceImpl implements CMNamespace {
- public String getNodeName() {
- return CMDocumentWrapperImpl.this.getURI();
- }
-
- public int getNodeType() {
- return CMNode.NAME_SPACE;
- }
-
- public String getPrefix() {
- return CMDocumentWrapperImpl.this.getPrefix();
- }
-
- public Object getProperty(String property) {
- return null;
- }
-
- public String getURI() {
- return CMDocumentWrapperImpl.this.getURI();
- }
-
- public boolean supports(String feature) {
- return false;
- }
- }
-
- private CMDocument fDocument;
- private CMNamedNodeMap fElements = null;
- private CMNamedNodeMap fEntities = null;
- private CMNamespace fNamespace = new CMNamespaceImpl();
- private String fPrefix;
- private String fURI;
-
- public CMDocumentWrapperImpl(String newURI, String newPrefix, CMDocument tld) {
- fURI = newURI;
- fPrefix = newPrefix;
- fDocument = tld;
- }
-
- /**
- *
- * @return org.eclipse.wst.common.contentmodel.CMDocument
- */
- public CMDocument getDocument() {
- return fDocument;
- }
-
- /**
- * getElements method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of ElementDeclaration
- */
- public CMNamedNodeMap getElements() {
- if (fElements == null) {
- int length = getDocument().getElements().getLength();
- CMNamedNodeMapImpl elements = new CMNamedNodeMapImpl();
- for (int i = 0; i < length; i++) {
- CMElementDeclaration ed = new CMElementDeclarationWrapperImpl(fPrefix, (CMElementDeclaration) getDocument().getElements().item(i));
- elements.setNamedItem(ed.getNodeName(), ed);
- }
- fElements = elements;
- }
- return fElements;
- }
-
- /**
- * getEntities method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of EntityDeclaration
- */
- public CMNamedNodeMap getEntities() {
- if (fEntities == null) {
- fEntities = getDocument().getEntities();
- }
- return fEntities;
- }
-
- /**
- * getNamespace method
- * @return CMNamespace
- */
- public CMNamespace getNamespace() {
- return fNamespace;
- }
-
- /**
- * getNodeName method
- * @return java.lang.String
- */
- public String getNodeName() {
- return getDocument().getNodeName();
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- *
- */
- public int getNodeType() {
- return getDocument().getNodeType();
- }
-
- public CMNode getOriginNode() {
- return fDocument;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getPrefix() {
- return fPrefix;
- }
-
- /**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- return getDocument().getProperty(propertyName);
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getURI() {
- return fURI;
- }
-
- /**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- return getDocument().supports(propertyName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMElementDeclarationWrapperImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMElementDeclarationWrapperImpl.java
deleted file mode 100644
index 660eb8fb33..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMElementDeclarationWrapperImpl.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.common.contentmodel.CMContent;
-import org.eclipse.wst.common.contentmodel.CMDataType;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.CMGroup;
-import org.eclipse.wst.common.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.common.contentmodel.CMNode;
-
-public class CMElementDeclarationWrapperImpl extends CMNodeWrapperImpl implements CMElementDeclaration {
- private CMContent fCMContent = null;
-
- protected CMElementDeclaration fElementDecl = null;
-
- /**
- * CMElementDeclarationWrapper constructor comment.
- * @param prefix java.lang.String
- * @param node org.eclipse.wst.common.contentmodel.CMNode
- */
- public CMElementDeclarationWrapperImpl(String prefix, CMElementDeclaration node) {
- super(prefix, node);
- fElementDecl = node;
- }
-
- /**
- * getAttributes method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of AttributeDeclaration
- */
- public CMNamedNodeMap getAttributes() {
- return fElementDecl.getAttributes();
- }
-
- /**
- * getCMContent method
- * @return CMContent
- *
- * Returns the root node of this element's content model.
- * This can be an CMElementDeclaration or a CMGroup
- */
- public CMContent getContent() {
- if (fCMContent == null) {
- CMContent content = fElementDecl.getContent();
- if (content == null)
- return null;
- if (content instanceof CMGroup)
- fCMContent = new CMGroupWrapperImpl(fPrefix, (CMGroup) content);
- else
- fCMContent = new CMContentWrapperImpl(fPrefix, content);
- }
- return fCMContent;
- }
-
- /**
- * getContentType method
- * @return int
- *
- * Returns one of :
- * ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA.
- */
- public int getContentType() {
- return fElementDecl.getContentType();
- }
-
- /**
- * getDataType method
- * @return java.lang.String
- */
- public CMDataType getDataType() {
- return fElementDecl.getDataType();
- }
-
- /**
- * getElementName method
- * @return java.lang.String
- */
- public String getElementName() {
- return getNodeName();
- }
-
- /**
- * getLocalElements method
- * @return CMNamedNodeMap
- *
- * Returns a list of locally defined elements.
- */
- public CMNamedNodeMap getLocalElements() {
- return fElementDecl.getLocalElements();
- }
-
- /**
- * getMaxOccur method
- * @return int
- *
- * If -1, it's UNBOUNDED.
- */
- public int getMaxOccur() {
- return fElementDecl.getMaxOccur();
- }
-
- /**
- * getMinOccur method
- * @return int
- *
- * If 0, it's OPTIONAL.
- * If 1, it's REQUIRED.
- */
- public int getMinOccur() {
- return fElementDecl.getMinOccur();
- }
-
- public CMNode getOriginNode() {
- return fElementDecl;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMGroupWrapperImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMGroupWrapperImpl.java
deleted file mode 100644
index d931e68452..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMGroupWrapperImpl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.CMGroup;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.common.contentmodel.CMNodeList;
-
-public class CMGroupWrapperImpl extends CMContentWrapperImpl implements CMGroup {
- class CMNodeListImpl implements CMNodeList {
- private List nodes = null;
-
- /**
- * CMNodeListImpl constructor comment.
- */
- public CMNodeListImpl() {
- super();
- nodes = new ArrayList();
- }
-
- /**
- * @return org.eclipse.wst.common.contentmodel.CMNode
- * @param node org.eclipse.wst.common.contentmodel.CMNode
- */
- public void appendItem(CMNode node) {
- nodes.add(node);
- }
-
- /**
- * getLength method
- * @return int
- */
- public int getLength() {
- return nodes.size();
- }
-
- /**
- * item method
- * @return CMNode
- * @param index int
- */
- public CMNode item(int index) {
- if (index < 0 || index >= nodes.size())
- return null;
- return (CMNode) nodes.get(index);
- }
- }
-
- private CMNodeList fChildNodes = null;
- private CMGroup fGroup = null;
-
- /**
- * CMGroupWrapper constructor comment.
- * @param prefix java.lang.String
- * @param node org.eclipse.wst.common.contentmodel.CMContent
- */
- public CMGroupWrapperImpl(String prefix, CMGroup node) {
- super(prefix, node);
- }
-
- /**
- * getChildNodes method
- * @return CMNodeList
- *
- * Returns child CMNodeList, which includes ElementDefinition or CMElement.
- */
- public CMNodeList getChildNodes() {
- if (fChildNodes == null) {
- CMNodeListImpl childNodes = new CMNodeListImpl();
- CMNodeList children = fGroup.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- CMNode child = children.item(i);
- if (child instanceof CMGroup)
- childNodes.appendItem(new CMGroupWrapperImpl(fPrefix, (CMGroup) child));
- else if (child instanceof CMElementDeclaration)
- childNodes.appendItem(new CMElementDeclarationWrapperImpl(fPrefix, (CMElementDeclaration) child));
- else
- // error?
- childNodes.appendItem(new CMNodeWrapperImpl(fPrefix, child));
- }
- fChildNodes = childNodes;
- }
- return fChildNodes;
- }
-
- /**
- * getOperation method
- * @return int
- *
- * Returns one of :
- * ALONE (a), SEQUENCE (a,b), CHOICE (a|b), ALL (a&b).
- */
- public int getOperator() {
- return fGroup.getOperator();
- }
-
- public CMNode getOriginNode() {
- return fGroup;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMNodeWrapperImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMNodeWrapperImpl.java
deleted file mode 100644
index b2cf95396d..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/CMNodeWrapperImpl.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.sse.core.contentmodel.CMNodeWrapper;
-
-public class CMNodeWrapperImpl implements CMNode, CMNodeWrapper {
- private CMNode fNode = null;
- private String fNodeName = null;
-
- protected String fPrefix = null;
-
- /**
- * CMNodeWrapper constructor comment.
- */
- public CMNodeWrapperImpl(String prefix, CMNode node) {
- super();
- fPrefix = prefix;
- fNode = node;
-
- fNodeName = fPrefix + ":" + fNode.getNodeName(); //$NON-NLS-1$
- }
-
- /**
- * getNodeName method
- * @return java.lang.String
- */
- public String getNodeName() {
- return fNodeName;
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- *
- */
- public int getNodeType() {
- return fNode.getNodeType();
- }
-
- public CMNode getOriginNode() {
- return fNode;
- }
-
- /**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- return fNode.getProperty(propertyName);
- }
-
- /**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- return fNode.supports(propertyName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibIndexListener.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibIndexListener.java
deleted file mode 100644
index 25c3a1138a..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibIndexListener.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-
-public interface ITaglibIndexListener {
- void indexChanged(ITaglibRecordEvent event);
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibRecord.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibRecord.java
deleted file mode 100644
index 4a423187e7..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibRecord.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-public interface ITaglibRecord {
- short JAR = 1 << 2;
- short TAGDIR = 1 << 4;
- short TLD = 1 << 1;
- short URL = 1;
- short WEB_XML = 1 << 3;
-
- short getRecordType();
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibRecordEvent.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibRecordEvent.java
deleted file mode 100644
index eede5808d7..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ITaglibRecordEvent.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-public interface ITaglibRecordEvent {
- ITaglibRecord getTaglibRecord();
-
- short getType();
-
- short ADD = 1;
- short CHANGE = 1 << 1;
- short REMOVE = 1 << 2;
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java
deleted file mode 100644
index 637fcce3a1..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.common.contentmodel.CMNamespace;
-import org.eclipse.wst.html.core.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.sse.core.contentmodel.CMDocType;
-
-/**
- * CMDocument factory for JSP documents.
- */
-public final class JSPCMDocumentFactory {
-
- static class CMDocImpl implements CMDocument {
- public CMDocImpl() {
- super();
- }
-
- private static CMDocument jcm = HTMLCMDocumentFactory.getCMDocument(CMDocType.JSP11_DOC_TYPE);
-
- public String getNodeName() {
- return jcm.getNodeName();
- }
-
- public int getNodeType() {
- return jcm.getNodeType();
- }
-
- public CMNamedNodeMap getElements() {
- return jcm.getElements();
- }
-
- public CMNamedNodeMap getEntities() {
- return jcm.getEntities();
- }
-
- public CMNamespace getNamespace() {
- return jcm.getNamespace();
- }
-
- public Object getProperty(String propertyName) {
- return null;
- }
-
- public boolean supports(String propertyName) {
- return false;
- }
- }
-
- private static CMDocument mycm;
-
- private JSPCMDocumentFactory() {
- super();
- }
-
- public static CMDocument getCMDocument() {
- if (mycm == null) {
- mycm = new CMDocImpl();
- }
- return mycm;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JarRecord.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JarRecord.java
deleted file mode 100644
index 6cb4124aa5..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JarRecord.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-
-
-public class JarRecord implements ITaglibRecord {
- IPath location;
- List urlRecords;
-
- public short getRecordType() {
- return ITaglibRecord.JAR;
- }
-
- /**
- * @return Returns the location.
- */
- public IPath getLocation() {
- return location;
- }
-
- /**
- *
- */
- public List getURLRecords() {
- return urlRecords;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ProjectDescription.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ProjectDescription.java
deleted file mode 100644
index e168bdbe7b..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ProjectDescription.java
+++ /dev/null
@@ -1,717 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Stack;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP12TLDNames;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.util.DocumentProvider;
-import org.eclipse.wst.sse.core.util.JarUtilities;
-import org.eclipse.wst.xml.uriresolver.util.URIHelper;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-class ProjectDescription {
-
- class DeltaVisitor implements IResourceDeltaVisitor {
- public boolean visit(IResourceDelta delta) throws CoreException {
- if (delta.getResource().getType() == IResource.FILE) {
- if (delta.getResource().getName().endsWith(".tld")) {
- if (delta.getKind() == IResourceDelta.REMOVED) {
- removeTLD(delta.getResource());
- }
- else {
- addTLD(delta.getResource());
- }
- }
- else if (delta.getResource().getName().endsWith(".jar")) {
- if (delta.getKind() == IResourceDelta.REMOVED) {
- removeJAR(delta.getResource());
- }
- else {
- addJAR(delta.getResource());
- }
- }
- else if (delta.getResource().getName().endsWith(".tag") || delta.getResource().getName().endsWith(".tagx")) {
- if (delta.getKind() == IResourceDelta.REMOVED) {
- removeTagDir(delta.getResource());
- }
- else {
- addTagDir(delta.getResource());
- }
- }
- else if (delta.getResource().getName().equals(WEB_XML) && delta.getResource().getParent().getName().equals(WEB_INF)) {
- if (delta.getKind() == IResourceDelta.REMOVED) {
- removeServlets(delta.getResource());
- }
- else {
- addServlets(delta.getResource());
- }
- }
- }
- return true;
- }
- }
-
- class Indexer implements IResourceProxyVisitor {
- public boolean visit(IResourceProxy proxy) throws CoreException {
- if (proxy.getType() == IResource.FILE) {
- if (proxy.getName().endsWith(".tld")) {
- addTLD(proxy.requestResource());
- }
- else if (proxy.getName().endsWith(".jar")) {
- addJAR(proxy.requestResource());
- }
- else if (proxy.getName().endsWith(".tag") || proxy.getName().endsWith(".tagx")) {
- addTagDir(proxy.requestResource());
- }
- else if (proxy.getName().equals(WEB_XML) && proxy.requestResource().getParent().getName().equals(WEB_INF)) {
- addServlets(proxy.requestResource());
- }
- }
- return true;
- }
- }
-
- class TaglibRecordEvent implements ITaglibRecordEvent {
- ITaglibRecord fTaglibRecord = null;
- short fType = -1;
-
- TaglibRecordEvent(ITaglibRecord record, short type) {
- fTaglibRecord = record;
- fType = type;
- }
-
- public ITaglibRecord getTaglibRecord() {
- return fTaglibRecord;
- }
-
- public short getType() {
- return fType;
- }
- }
-
- static boolean _debugIndexCreation = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/indexcreation"));
- static boolean _debugIndexTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/indextime"));
-
- private static final String WEB_INF = "WEB-INF";
-
- private static final IPath WEB_INF_PATH = new Path("WEB-INF");
- private static final String WEB_XML = "web.xml";
-
- /*
- * Records active JARs on the classpath. Taglib descriptors should be
- * usable, but the jars by themselves should not.
- */
- Hashtable fClasspathJars;
-
- // holds references by URI to TLDs
- Hashtable fClasspathReferences;
-
- // this table is special in that it holds tables of references according
- // to local roots
- Hashtable fImplicitReferences;
- Hashtable fJARReferences;
- IProject fProject;
-
- Stack fProjectStack = null;
- Hashtable fServletReferences;
- Hashtable fTagDirReferences;
-
- Hashtable fTLDReferences;
-
- IResourceDeltaVisitor fVisitor;
-
- private long time0;
-
- ProjectDescription(IProject project) {
- super();
- fProject = project;
- fClasspathReferences = new Hashtable(0);
- fClasspathJars = new Hashtable(0);
- fJARReferences = new Hashtable(0);
- fTagDirReferences = new Hashtable(0);
- fTLDReferences = new Hashtable(0);
- fServletReferences = new Hashtable(0);
- fImplicitReferences = new Hashtable(0);
- }
-
- void addClasspathLibrary(String libraryLocation) {
- String[] entries = JarUtilities.getEntryNames(libraryLocation);
- JarRecord libraryRecord = (JarRecord) createJARRecord(libraryLocation);
- fClasspathJars.put(libraryLocation, libraryRecord);
- for (int i = 0; i < entries.length; i++) {
- if (entries[i].endsWith(".tld")) {
- InputStream contents = JarUtilities.getInputStream(libraryLocation, entries[i]);
- if (contents != null) {
- String uri = extractURI(libraryLocation, contents);
- if (uri != null && uri.length() > 0) {
- URLRecord record = new URLRecord();
- record.uri = uri;
- record.baseLocation = libraryLocation;
- try {
- record.url = new URL("jar:file:" + libraryLocation + "!/" + entries[i]);
- libraryRecord.urlRecords.add(record);
- fClasspathReferences.put(uri, record);
- if (_debugIndexCreation)
- System.out.println("created record for " + uri + "@" + record.getURL());
- }
- catch (MalformedURLException e) {
- // don't record this URI
- Logger.logException(e);
- }
- }
- try {
- contents.close();
- }
- catch (IOException e) {
- }
- }
- }
- }
- TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(libraryRecord, ITaglibRecordEvent.ADD));
- }
-
- void addJAR(IResource jar) {
- if (_debugIndexCreation)
- System.out.println("creating records for JAR " + jar.getFullPath());
- String jarLocationString = jar.getLocation().toString();
- String[] entries = JarUtilities.getEntryNames(jar);
- JarRecord jarRecord = (JarRecord) createJARRecord(jar);
- fJARReferences.put(jar.getFullPath().toString(), jarRecord);
- for (int i = 0; i < entries.length; i++) {
- if (entries[i].endsWith(".tld")) {
- InputStream contents = JarUtilities.getInputStream(jar, entries[i]);
- if (contents != null) {
- String uri = extractURI(jarLocationString, contents);
- if (uri != null && uri.length() > 0) {
- URLRecord record = new URLRecord();
- record.uri = uri;
- record.baseLocation = jarLocationString;
- try {
- record.url = new URL("jar:file:" + jarLocationString + "!/" + entries[i]);
- jarRecord.urlRecords.add(record);
- getImplicitReferences(jarLocationString).put(uri, record);
- if (_debugIndexCreation)
- System.out.println("created record for " + uri + "@" + record.getURL());
- }
- catch (MalformedURLException e) {
- // don't record this URI
- Logger.logException(e);
- }
- }
- try {
- contents.close();
- }
- catch (IOException e) {
- }
- }
- }
- }
- TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(jarRecord, ITaglibRecordEvent.ADD));
- }
-
- void addServlets(IResource webxml) {
- if (webxml.getType() != IResource.FILE)
- return;
- InputStream webxmlContents = null;
- Document document = null;
- try {
- webxmlContents = ((IFile) webxml).getContents(true);
- DocumentProvider provider = new DocumentProvider();
- provider.setInputStream(webxmlContents);
- provider.setValidating(false);
- provider.setBaseReference(webxml.getParent().getLocation().toString());
- document = provider.getDocument();
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- finally {
- if (webxmlContents != null)
- try {
- webxmlContents.close();
- }
- catch (IOException e1) {
- // ignore
- }
- }
- if (document == null)
- return;
- if (_debugIndexCreation)
- System.out.println("creating records for " + webxml.getFullPath());
-
- ServletRecord servletRecord = new ServletRecord();
- servletRecord.location = webxml.getLocation();
- fServletReferences.put(servletRecord.getWebXML().toString(), servletRecord);
- NodeList taglibs = document.getElementsByTagName(JSP12TLDNames.TAGLIB);
- for (int i = 0; i < taglibs.getLength(); i++) {
- String uri = readTextofChild(taglibs.item(i), "taglib-uri");
- // specified location is relative to root of the webapp
- String location = readTextofChild(taglibs.item(i), "taglib-location");
- TLDRecord record = new TLDRecord();
- record.uri = uri;
- if (location.startsWith("/")) {
- record.location = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(getLocalRoot(webxml.getLocation().toString()) + location);
- }
- else {
- record.location = new Path(URIHelper.normalize(location, webxml.getLocation().toString(), getLocalRoot(webxml.getLocation().toString())));
- }
- servletRecord.tldRecords.add(record);
- getImplicitReferences(webxml.getLocation().toString()).put(uri, record);
- if (_debugIndexCreation)
- System.out.println("created record for " + uri + "@" + record.location);
- }
- TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(servletRecord, ITaglibRecordEvent.ADD));
- }
-
- void addTagDir(IResource tagFile) {
- return;
- /**
- * Make sure the tag file is n a WEB-INF/tags folder because of the
- * shortname computation requirements
- */
- // if ((tagFile.getType() & IResource.FOLDER) > 0 ||
- // tagFile.getFullPath().toString().indexOf("WEB-INF/tags") < 0)
- // return;
- // TagDirRecord record = createTagdirRecord(tagFile);
- // if (record != null) {
- // record.tags.add(tagFile.getName());
- // }
- }
-
- void addTLD(IResource tld) {
- if (_debugIndexCreation)
- System.out.println("creating record for " + tld.getFullPath());
- TLDRecord record = createTLDRecord(tld);
- fTLDReferences.put(tld.getFullPath().toString(), record);
- if (record.uri != null) {
- getImplicitReferences(tld.getLocation().toString()).put(record.uri, record);
- }
- TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(record, ITaglibRecordEvent.ADD));
- }
-
- void clear() {
- }
-
- /**
- * @param resource
- * @return
- */
- private ITaglibRecord createJARRecord(IResource jar) {
- return createJARRecord(jar.getLocation().toString());
- }
-
- private ITaglibRecord createJARRecord(String fileLocation) {
- JarRecord record = new JarRecord();
- record.location = new Path(fileLocation);
- record.urlRecords = new ArrayList(0);
- return record;
- }
-
- /**
- * @return
- */
- TagDirRecord createTagdirRecord(IResource tagFile) {
- IContainer tagdir = tagFile.getParent();
- String tagdirLocation = tagdir.getFullPath().toString();
- TagDirRecord record = (TagDirRecord) fTagDirReferences.get(tagdirLocation);
- if (record == null) {
- record = new TagDirRecord();
- record.location = tagdir.getFullPath();
- // JSP 2.0 section 8.4.3
- if (tagdir.getName().equals("tags"))
- record.shortName = "tags";
- else {
- IPath tagdirPath = tagdir.getFullPath();
- String[] segments = tagdirPath.segments();
- for (int i = 1; record.shortName == null && i < segments.length; i++) {
- if (segments[i - 1].equals("WEB-INF") && segments[i].equals("tags")) {
- IPath tagdirLocalPath = tagdirPath.removeFirstSegments(i + 1);
- record.shortName = tagdirLocalPath.toString().replace('/', '-');
- }
- }
- }
-
- }
- return record;
- }
-
- /**
- * @param resource
- * @return
- */
- private TLDRecord createTLDRecord(IResource tld) {
- TLDRecord record = new TLDRecord();
- record.location = tld.getLocation();
- InputStream contents = null;
- try {
- contents = ((IFile) tld).getContents(true);
- String baseLocation = record.location.toString();
- String defaultURI = extractURI(baseLocation, contents);
- if (defaultURI != null && defaultURI.length() > 0) {
- record.uri = defaultURI;
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- finally {
- try {
- if (contents != null) {
- contents.close();
- }
- }
- catch (IOException e) {
- // ignore
- }
- }
- return record;
- }
-
- /**
- * @param tldContents
- * @return
- */
- private String extractURI(String baseLocation, InputStream tldContents) {
- StringBuffer uri = new StringBuffer();
- Node result = null;
- DocumentProvider provider = new DocumentProvider();
- provider.setInputStream(tldContents);
- provider.setValidating(false);
- provider.setRootElementName(JSP12TLDNames.TAGLIB);
- provider.setBaseReference(baseLocation);
- result = provider.getRootElement();
- if (result.getNodeType() != Node.ELEMENT_NODE)
- return null;
- Element taglibElement = (Element) result;
- if (taglibElement != null) {
- Node child = taglibElement.getFirstChild();
- while (child != null && !(child.getNodeType() == Node.ELEMENT_NODE && child.getNodeName().equals(JSP12TLDNames.URI))) {
- child = child.getNextSibling();
- }
- if (child != null) {
- Node text = child.getFirstChild();
- while (text != null) {
- if (text.getNodeType() == Node.TEXT_NODE || text.getNodeType() == Node.CDATA_SECTION_NODE) {
- uri.append(text.getNodeValue().trim());
- }
- text = text.getNextSibling();
- }
- }
- }
- return uri.toString();
- }
-
- synchronized List getAvailableTaglibRecords(IPath location) {
- Collection implicitReferences = getImplicitReferences(location.toString()).values();
- List records = new ArrayList(fTLDReferences.size() + fTagDirReferences.size() + fJARReferences.size() + fServletReferences.size());
- records.addAll(fTLDReferences.values());
- records.addAll(fTagDirReferences.values());
- records.addAll(fJARReferences.values());
- records.addAll(fServletReferences.values());
- records.addAll(implicitReferences);
- return records;
- }
-
- /**
- * @return Returns the implicitReferences for the given path
- */
- Hashtable getImplicitReferences(String location) {
- String localRoot = getLocalRoot(location);
- Hashtable implicitReferences = (Hashtable) fImplicitReferences.get(localRoot);
- if (implicitReferences == null) {
- implicitReferences = new Hashtable(1);
- fImplicitReferences.put(localRoot, implicitReferences);
- }
- return implicitReferences;
- }
-
- /**
- * @param baseLocation
- * @return the applicable Web context root path, if one exists
- */
- IPath getLocalRoot(IPath baseLocation) {
- IResource file = FileBuffers.getWorkspaceFileAtLocation(baseLocation);
- while (file != null) {
- /**
- * Treat any parent folder with a WEB-INF subfolder as a web-app
- * root
- */
- IContainer folder = null;
- if ((file.getType() & IResource.FOLDER) != 0) {
- folder = (IContainer) file;
- }
- else {
- folder = file.getParent();
- }
- // getFolder on a workspace root must use a full path, skip
- if (folder != null && (folder.getType() & IResource.ROOT) == 0) {
- IFolder webinf = folder.getFolder(WEB_INF_PATH);
- if (webinf != null && webinf.exists()) {
- return folder.getFullPath();
- }
- }
- file = file.getParent();
- }
-
- return fProject.getFullPath();
- }
-
- /**
- * @param baseLocation
- * @return
- */
- private String getLocalRoot(String baseLocation) {
- return getLocalRoot(new Path(baseLocation)).toString();
- }
-
- /**
- * @return Returns the visitor.
- */
- IResourceDeltaVisitor getVisitor() {
- if (fVisitor == null) {
- fVisitor = new DeltaVisitor();
- }
- return fVisitor;
- }
-
- void index() {
- time0 = System.currentTimeMillis();
- fTLDReferences.clear();
- fJARReferences.clear();
- fTagDirReferences.clear();
- fServletReferences.clear();
- try {
- fProject.accept(new Indexer(), 0);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
-
- if (_debugIndexTime)
- System.out.println("indexed " + fProject.getName() + " in " + (System.currentTimeMillis() - time0) + "ms");
- }
-
- void indexClasspath() {
- time0 = System.currentTimeMillis();
- fProjectStack = new Stack();
- fClasspathReferences.clear();
- IJavaProject javaProject = JavaCore.create(fProject);
- indexClasspath(javaProject);
- if (_debugIndexTime)
- System.out.println("indexed " + fProject.getName() + " classpath in " + (System.currentTimeMillis() - time0) + "ms");
- }
-
- /**
- * @param javaProject
- */
- private void indexClasspath(IJavaProject javaProject) {
- if (javaProject != null && javaProject.exists()) {
- fProjectStack.push(javaProject.getElementName());
- try {
- IClasspathEntry[] entries = javaProject.getResolvedClasspath(true);
- for (int i = 0; i < entries.length; i++) {
- IClasspathEntry entry = entries[i];
- switch (entry.getEntryKind()) {
- case IClasspathEntry.CPE_CONTAINER :
- break;
- case IClasspathEntry.CPE_LIBRARY : {
- /*
- * Ignore libs in required projects that are not
- * exported
- */
- if (fProjectStack.size() < 2 || entry.isExported()) {
- IPath libPath = entry.getPath();
- if (libPath.toFile().exists()) {
- addClasspathLibrary(libPath.toString());
- }
- else {
- IFile libFile = ResourcesPlugin.getWorkspace().getRoot().getFile(libPath);
- if (libFile != null && libFile.exists()) {
- addClasspathLibrary(libFile.getLocation().toString());
- }
- }
- }
- }
- break;
- case IClasspathEntry.CPE_PROJECT : {
- /*
- * Ignore required projects of required projects
- * that are not exported
- */
- if (fProjectStack.size() < 2 || entry.isExported()) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(entry.getPath().lastSegment());
- if (project != null && !fProjectStack.contains(project.getName())) {
- indexClasspath(JavaCore.create(project));
- }
- }
- }
- break;
- case IClasspathEntry.CPE_SOURCE :
- break;
- case IClasspathEntry.CPE_VARIABLE :
- break;
- }
- }
- }
- catch (JavaModelException e) {
- Logger.logException("Error searching Java Build Path + (" + fProject.getName() + ") for tag libraries", e);
- }
- fProjectStack.pop();
- }
- }
-
- protected String readTextofChild(Node node, String childName) {
- StringBuffer buffer = new StringBuffer();
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE && child.getNodeName().equals(childName)) {
- Node text = child.getFirstChild();
- while (text != null) {
- buffer.append(text.getNodeValue().trim());
- text = text.getNextSibling();
- }
- }
- }
- return buffer.toString();
- }
-
- void removeClasspathLibrary(String libraryLocation) {
- JarRecord record = (JarRecord) fClasspathJars.remove(libraryLocation);
- if (record != null) {
- URLRecord[] records = (URLRecord[]) record.getURLRecords().toArray(new URLRecord[0]);
- for (int i = 0; i < records.length; i++) {
- fClasspathReferences.remove(records[i].getURI());
- }
- TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(record, ITaglibRecordEvent.REMOVE));
- }
- }
-
- void removeJAR(IResource jar) {
- if (_debugIndexCreation)
- System.out.println("removing records for JAR " + jar.getFullPath());
- JarRecord record = (JarRecord) fJARReferences.remove(jar.getFullPath());
- if (record != null) {
- URLRecord[] records = (URLRecord[]) record.getURLRecords().toArray(new URLRecord[0]);
- for (int i = 0; i < records.length; i++) {
- getImplicitReferences(jar.getLocation().toString()).remove(records[i].getURI());
- }
- TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(record, ITaglibRecordEvent.REMOVE));
- }
- }
-
- void removeServlets(IResource webxml) {
- if (_debugIndexCreation)
- System.out.println("removing records for " + webxml.getFullPath());
- ServletRecord record = (ServletRecord) fServletReferences.remove(webxml.getLocation().toString());
- if (record != null) {
- TLDRecord[] records = (TLDRecord[]) record.getTLDRecords().toArray(new TLDRecord[0]);
- for (int i = 0; i < records.length; i++) {
- if (_debugIndexCreation)
- System.out.println("removed record for " + records[i].uri + "@" + records[i].location);
- getImplicitReferences(webxml.getLocation().toString()).remove(records[i].getURI());
- }
- TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(record, ITaglibRecordEvent.REMOVE));
- }
- }
-
- void removeTagDir(IResource tagFile) {
- // IContainer tagdir = tagFile.getParent();
- // String tagdirLocation = tagdir.getFullPath().toString();
- // fTagDirReferences.remove(tagdirLocation);
- }
-
- void removeTLD(IResource tld) {
- if (_debugIndexCreation)
- System.out.println("removing record for " + tld.getFullPath());
- TLDRecord record = (TLDRecord) fTLDReferences.remove(tld.getFullPath());
- if (record != null) {
- if (record.uri != null) {
- getImplicitReferences(tld.getLocation().toString()).remove(record.uri);
- }
- TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(record, ITaglibRecordEvent.REMOVE));
- }
- }
-
- /**
- * @param basePath
- * @param reference
- * @return
- */
- ITaglibRecord resolve(String basePath, String reference) {
- ITaglibRecord record = null;
- String location = null;
-
- /**
- * Workaround for problem in URIHelper; uris starting with '/' are
- * returned as-is.
- */
- if (reference.startsWith("/")) {
- location = getLocalRoot(basePath) + reference;
- }
- else {
- location = URIHelper.normalize(reference, basePath, getLocalRoot(basePath));
- }
- // order dictated by JSP spec 2.0 section 7.2.3
- if (record == null) {
- record = (ITaglibRecord) fServletReferences.get(location);
- }
- if (record == null) {
- record = (ITaglibRecord) fJARReferences.get(location);
- }
- if (record == null) {
- record = (ITaglibRecord) fTLDReferences.get(location);
- }
- if (record == null) {
- record = (ITaglibRecord) getImplicitReferences(basePath).get(reference);
- }
- if (record == null) {
- record = (ITaglibRecord) fTagDirReferences.get(location);
- }
- if (record == null) {
- record = (ITaglibRecord) fClasspathReferences.get(reference);
- }
- return record;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ServletRecord.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ServletRecord.java
deleted file mode 100644
index 029406da0d..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/ServletRecord.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-
-
-public class ServletRecord implements ITaglibRecord {
- IPath location;
- List tldRecords = new ArrayList(0);
-
- public short getRecordType() {
- return ITaglibRecord.WEB_XML;
- }
-
- /**
- * @return Returns the webxml.
- */
- public IPath getWebXML() {
- return location;
- }
-
- /**
- *
- */
- public List getTLDRecords() {
- return tldRecords;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TLDRecord.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TLDRecord.java
deleted file mode 100644
index ea077a999f..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TLDRecord.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-import org.eclipse.core.runtime.IPath;
-
-
-public class TLDRecord implements ITaglibRecord {
- IPath location;
- String uri;
-
- public short getRecordType() {
- return ITaglibRecord.TLD;
- }
-
- /**
- * @return Returns the filesystem location.
- */
- public IPath getLocation() {
- return location;
- }
-
- /**
- * @return Returns the uri.
- */
- public String getURI() {
- return uri;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TagDirRecord.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TagDirRecord.java
deleted file mode 100644
index 2f504da706..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TagDirRecord.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-
-
-public class TagDirRecord implements ITaglibRecord {
- IPath location;
- String shortName;
- // a List holding Strings of .tag and .tagx filenames relative to the
- // tagdir's location
- List tags = new ArrayList(0);
-
- /**
- * @return Returns the location.
- */
- public IPath getLocation() {
- return location;
- }
-
- public short getRecordType() {
- return ITaglibRecord.TAGDIR;
- }
-
- /**
- * @return Returns the shortName.
- */
- public String getShortName() {
- return shortName;
- }
-
- /**
- * @return Returns the tags.
- */
- public String[] getTags() {
- return (String[]) tags.toArray(new String[tags.size()]);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java
deleted file mode 100644
index 887a1646c0..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
-import org.eclipse.core.filebuffers.IFileBuffer;
-import org.eclipse.core.filebuffers.IFileBufferListener;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.util.Assert;
-
-/**
- * Provides a direct mapping from IStructuredDocument to supporting
- * TLDCMDocumentManager.
- *
- * Listens to the creation of JSP type TextFileBuffers and forces a text-less
- * reparse after connecting taglib-supporting listeners. Connecting the
- * listeners before the text is set would be ideal, but there is no way to
- * look up taglib references since the location is not yet knowable. Since
- * taglibs can affect the parsing of the document, a reparse is currently
- * required to react to custom tags with tagdependent content.
- *
- * TODO: Remove the reparse penalty.
- */
-public class TaglibController implements IDocumentSetupParticipant {
-
- class DocumentInfo {
- IStructuredDocument document;
- ITextFileBuffer textFileBuffer;
- TLDCMDocumentManager tldDocumentManager;
- }
-
- class FileBufferListener implements IFileBufferListener {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IFileBufferListener#bufferContentAboutToBeReplaced(org.eclipse.core.filebuffers.IFileBuffer)
- */
- public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IFileBufferListener#bufferContentReplaced(org.eclipse.core.filebuffers.IFileBuffer)
- */
- public void bufferContentReplaced(IFileBuffer buffer) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IFileBufferListener#bufferCreated(org.eclipse.core.filebuffers.IFileBuffer)
- */
- public void bufferCreated(IFileBuffer buffer) {
- if (buffer instanceof ITextFileBuffer) {
- IDocument document = ((ITextFileBuffer) buffer).getDocument();
- // ignore non-JSP documents
- synchronized (fJSPdocuments) {
- if (!fJSPdocuments.contains(document))
- return;
- }
- Assert.isTrue(document instanceof IStructuredDocument, getClass().getName() + " SetupParticipant was called for non-IStructuredDocument");
- DocumentInfo info = new DocumentInfo();
- info.document = (IStructuredDocument) document;
- info.textFileBuffer = (ITextFileBuffer) buffer;
- info.tldDocumentManager = new TLDCMDocumentManager();
- info.tldDocumentManager.setSourceParser((JSPSourceParser) info.document.getParser());
- synchronized (fDocumentMap) {
- fDocumentMap.put(document, info);
- }
- if (document instanceof BasicStructuredDocument) {
- ((BasicStructuredDocument) document).reparse(this);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IFileBufferListener#bufferDisposed(org.eclipse.core.filebuffers.IFileBuffer)
- */
- public void bufferDisposed(IFileBuffer buffer) {
- if (buffer instanceof ITextFileBuffer) {
- IDocument document = ((ITextFileBuffer) buffer).getDocument();
- synchronized (fJSPdocuments) {
- if (!fJSPdocuments.remove(document))
- return;
- }
- }
- synchronized (fDocumentMap) {
- Object[] keys = fDocumentMap.keySet().toArray();
- boolean removed = false;
- for (int i = 0; i < keys.length && !removed; i++) {
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(keys[i]);
- if (info != null && info.textFileBuffer.equals(buffer)) {
- fDocumentMap.remove(keys[i]);
- removed = true;
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IFileBufferListener#dirtyStateChanged(org.eclipse.core.filebuffers.IFileBuffer,
- * boolean)
- */
- public void dirtyStateChanged(IFileBuffer buffer, boolean isDirty) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IFileBufferListener#stateChangeFailed(org.eclipse.core.filebuffers.IFileBuffer)
- */
- public void stateChangeFailed(IFileBuffer buffer) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IFileBufferListener#stateChanging(org.eclipse.core.filebuffers.IFileBuffer)
- */
- public void stateChanging(IFileBuffer buffer) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IFileBufferListener#stateValidationChanged(org.eclipse.core.filebuffers.IFileBuffer,
- * boolean)
- */
- public void stateValidationChanged(IFileBuffer buffer, boolean isStateValidated) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IFileBufferListener#underlyingFileDeleted(org.eclipse.core.filebuffers.IFileBuffer)
- */
- public void underlyingFileDeleted(IFileBuffer buffer) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IFileBufferListener#underlyingFileMoved(org.eclipse.core.filebuffers.IFileBuffer,
- * org.eclipse.core.runtime.IPath)
- */
- public void underlyingFileMoved(IFileBuffer buffer, IPath path) {
- }
-
-
- }
-
- static TaglibController _instance = null;
- static private boolean fIsShutdown = false;
-
- public static ITextFileBuffer getFileBuffer(IDocument document) {
- synchronized (_instance.fDocumentMap) {
- DocumentInfo info = (DocumentInfo) _instance.fDocumentMap.get(document);
- if (info != null)
- return info.textFileBuffer;
- return null;
- }
- }
-
- /**
- * @param manager
- * @return
- */
- public static ITextFileBuffer getFileBuffer(TLDCMDocumentManager manager) {
- ITextFileBuffer buffer = null;
- synchronized (_instance.fDocumentMap) {
- Iterator docInfos = _instance.fDocumentMap.values().iterator();
- while (docInfos.hasNext()) {
- DocumentInfo info = (DocumentInfo) docInfos.next();
- if (info.tldDocumentManager == manager)
- buffer = info.textFileBuffer;
- }
- }
- return buffer;
- }
-
- public static TLDCMDocumentManager getTLDCMDocumentManager(IDocument document) {
- // if _instance is null, we are already shutting donw
- if (_instance == null)
- return null;
- synchronized (_instance.fDocumentMap) {
- DocumentInfo info = (DocumentInfo) _instance.fDocumentMap.get(document);
- if (info != null)
- return info.tldDocumentManager;
- return null;
-
- }
- }
-
- public synchronized static void shutdown() {
- setShutdown(true);
- FileBuffers.getTextFileBufferManager().removeFileBufferListener(_instance.fBufferListener);
- _instance = null;
- }
-
- public synchronized static void startup() {
- _instance = new TaglibController();
- FileBuffers.getTextFileBufferManager().addFileBufferListener(_instance.fBufferListener);
- setShutdown(false);
- }
-
- IFileBufferListener fBufferListener;
- Map fDocumentMap;
-
- List fJSPdocuments;
-
- // This constructor is only to be called as part of the FileBuffer
- // framework
- public TaglibController() {
- super();
- fBufferListener = new FileBufferListener();
- fJSPdocuments = new ArrayList(1);
- fDocumentMap = new HashMap(1);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
- */
- public void setup(IDocument document) {
- // if we've already shutdown, just ignore
- if (isShutdown()) return;
- synchronized (_instance.fJSPdocuments) {
- _instance.fJSPdocuments.add(document);
- }
- }
-
- private static synchronized boolean isShutdown() {
- return fIsShutdown;
- }
-
-
- private static synchronized void setShutdown(boolean isShutdown) {
- fIsShutdown = isShutdown;
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibIndex.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibIndex.java
deleted file mode 100644
index ec491a8462..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibIndex.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.wst.sse.core.util.StringUtils;
-import org.eclipse.wst.xml.uriresolver.util.URIHelper;
-
-/**
- * @author nitin
- *
- * A non-extendable index manager for taglibs similar to the J2EE
- * ITaglibRegistry but lacking any ties to project natures.
- *
- * Indexing is not persisted between sessions, so new ADD events will be sent
- * to ITaglibIndexListeners during each workbench session. REMOVE events are
- * not fired on workbench shutdown. Events for TAGDIR, JAR, and WEBXML type
- * records are only fired for the .jar and web.xml file itself. The record's
- * contents should be examined for any further information.
- */
-public class TaglibIndex {
-
- class ClasspathChangeListener implements IElementChangedListener {
- Stack projectStack = new Stack();
-
- public void elementChanged(ElementChangedEvent event) {
- projectStack.clear();
- elementChanged(event.getDelta());
- }
-
- private void elementChanged(IJavaElementDelta delta) {
- if (delta.getElement().getElementType() == IJavaElement.JAVA_MODEL) {
- IJavaElementDelta[] changed = delta.getChangedChildren();
- for (int i = 0; i < changed.length; i++) {
- elementChanged(changed[i]);
- }
- }
- else if (delta.getElement().getElementType() == IJavaElement.JAVA_PROJECT) {
- if ((delta.getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0) {
- IJavaElement proj = delta.getElement();
- handleClasspathChange((IJavaProject) proj);
- }
- }
- }
-
- private void handleClasspathChange(IJavaProject project) {
- projectStack.push(project.getElementName());
- try {
- /* Handle changes to this project's build path */
- IResource resource = project.getCorrespondingResource();
- if (resource.getType() == IResource.PROJECT) {
- boolean classpathIndexIsOld = fProjectDescriptions.containsKey(resource);
- ProjectDescription description = createDescription((IProject) resource);
- if (classpathIndexIsOld) {
- description.indexClasspath();
- }
- }
- /*
- * Update indeces for projects who include this project in
- * their build path (e.g. toggling the "exportation" of a
- * taglib JAR in this project affects the JAR's visibility in
- * other projects)
- */
- IJavaProject[] projects = project.getJavaModel().getJavaProjects();
- for (int i = 0; i < projects.length; i++) {
- IJavaProject otherProject = projects[i];
- if (StringUtils.contains(otherProject.getRequiredProjectNames(), project.getElementName(), false) && !projectStack.contains(otherProject.getElementName())) {
- handleClasspathChange(otherProject);
- }
- }
- }
- catch (JavaModelException e) {
- }
- projectStack.pop();
- }
- }
-
- class ResourceChangeListener implements IResourceChangeListener {
- public void resourceChanged(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.PRE_CLOSE :
- case IResourceChangeEvent.PRE_DELETE : {
- try {
- // pair deltas with projects
- IResourceDelta[] deltas = new IResourceDelta[]{event.getDelta()};
- IProject[] projects = null;
-
- if (deltas != null && deltas.length > 0) {
- IResource resource = null;
- if (deltas[0] != null) {
- resource = deltas[0].getResource();
- }
- else {
- resource = event.getResource();
- }
-
- if (resource != null) {
- if (resource.getType() == IResource.ROOT) {
- deltas = deltas[0].getAffectedChildren();
- projects = new IProject[deltas.length];
- for (int i = 0; i < deltas.length; i++) {
- if (deltas[i].getResource().getType() == IResource.PROJECT) {
- projects[i] = (IProject) deltas[i].getResource();
- }
- }
- }
- else {
- projects = new IProject[1];
- if (resource.getType() != IResource.PROJECT) {
- projects[0] = resource.getProject();
- }
- else {
- projects[0] = (IProject) resource;
- }
- }
- }
- for (int i = 0; i < projects.length; i++) {
- if (_debugIndexCreation) {
- System.out.println("TaglibIndex noticed " + projects[i].getName() + " is about to be deleted/closed");
- }
- ProjectDescription description = (ProjectDescription) fProjectDescriptions.remove(projects[i]);
- if (description != null) {
- if (_debugIndexCreation) {
- System.out.println("removing index of " + description.fProject.getName());
- }
- description.clear();
- }
- }
- }
- }
- catch (Exception e) {
- Logger.logException("Exception while processing resource deletion", e); //$NON-NLS-1$
- }
- }
- case IResourceChangeEvent.POST_CHANGE : {
- try {
- // pair deltas with projects
- IResourceDelta[] deltas = new IResourceDelta[]{event.getDelta()};
- IProject[] projects = null;
-
- if (deltas != null && deltas.length > 0) {
- IResource resource = null;
- if (deltas[0] != null) {
- resource = deltas[0].getResource();
- }
- else {
- resource = event.getResource();
- }
-
- if (resource != null) {
- if (resource.getType() == IResource.ROOT) {
- deltas = deltas[0].getAffectedChildren();
- projects = new IProject[deltas.length];
- for (int i = 0; i < deltas.length; i++) {
- if (deltas[i].getResource().getType() == IResource.PROJECT) {
- projects[i] = (IProject) deltas[i].getResource();
- }
- }
- }
- else {
- projects = new IProject[1];
- if (resource.getType() != IResource.PROJECT) {
- projects[0] = resource.getProject();
- }
- else {
- projects[0] = (IProject) resource;
- }
- }
- }
- for (int i = 0; i < projects.length; i++) {
- try {
- if (deltas[i] != null && deltas[i].getKind() != IResourceDelta.REMOVED && projects[i].isAccessible()) {
- ProjectDescription description = createDescription(projects[i]);
- deltas[i].accept(description.getVisitor());
- }
- if (!projects[i].isAccessible() || (deltas[i] != null && deltas[i].getKind() == IResourceDelta.REMOVED)) {
- if (_debugIndexCreation) {
- System.out.println("TaglibIndex noticed " + projects[i].getName() + " is no longer accessible");
- }
- ProjectDescription description = (ProjectDescription) fProjectDescriptions.remove(projects[i]);
- if (description != null) {
- if (_debugIndexCreation) {
- System.out.println("removing index of " + description.fProject.getName());
- }
- description.clear();
- }
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
- }
- catch (Exception e) {
- Logger.logException("Exception while processing resource change", e); //$NON-NLS-1$
- }
- }
- }
- }
- }
-
- static final boolean _debugChangeListener = false;
- static boolean _debugIndexCreation = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/indexcreation"));
- static final boolean _debugResolution = "true".equals(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/resolve"));
-
- static TaglibIndex _instance;
-
- static {
- _instance = new TaglibIndex();
- }
-
- static void fireTaglibRecordEvent(ITaglibRecordEvent event) {
- ITaglibIndexListener[] listeners = _instance.fTaglibIndexListeners;
- if (listeners != null) {
- for (int i = 0; i < listeners.length; i++) {
- try {
- listeners[i].indexChanged(event);
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING, e.getMessage());
- }
- }
- }
- }
-
- /**
- * Returns all of the visible ITaglibRecords for the given filepath in the
- * workspace.
- *
- * @param workspacePath
- * @return
- */
- public static ITaglibRecord[] getAvailableTaglibRecords(IPath workspacePath) {
- ITaglibRecord[] records = _instance.internalGetAvailableTaglibRecords(workspacePath);
- return records;
- }
-
- public static IPath getContextRoot(IPath path) {
- return _instance.internalGetContextRoot(path);
- }
-
- public static void removeTaglibIndexListener(ITaglibIndexListener listener) {
- _instance.internalRemoveTaglibIndexListener(listener);
- }
-
- /**
- * Find a matching ITaglibRecord given the reference.
- *
- * @param basePath -
- * the workspace-relative path for IResources, full filesystem
- * path otherwise
- * @param reference
- * @param crossProjects
- * @return
- */
- public static ITaglibRecord resolve(String basePath, String reference, boolean crossProjects) {
- ITaglibRecord result = _instance.internalResolve(basePath, reference, crossProjects);
- if (_debugResolution) {
- if (result == null) {
- System.out.println("TaglibIndex could not resolve \"" + reference + "\" from " + basePath);
- }
- else {
- switch (result.getRecordType()) {
- case (ITaglibRecord.TLD) : {
- TLDRecord record = (TLDRecord) result;
- System.out.println("TaglibIndex resolved " + basePath + ":" + reference + " = " + record.getLocation());
- }
- break;
- case (ITaglibRecord.JAR) : {
- JarRecord record = (JarRecord) result;
- System.out.println("TaglibIndex resolved " + basePath + ":" + reference + " = " + record.getLocation());
- }
- break;
- case (ITaglibRecord.TAGDIR) : {
- }
- break;
- case (ITaglibRecord.URL) : {
- URLRecord record = (URLRecord) result;
- System.out.println("TaglibIndex resolved " + basePath + ":" + reference + " = " + record.getURL());
- }
- break;
- }
- }
- }
- return result;
- }
-
- private ClasspathChangeListener fClasspathChangeListener = null;
-
- Map fProjectDescriptions;
- private ResourceChangeListener fResourceChangeListener;
-
- private ITaglibIndexListener[] fTaglibIndexListeners = null;
-
- private TaglibIndex() {
- super();
- fResourceChangeListener = new ResourceChangeListener();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(fResourceChangeListener);
- fClasspathChangeListener = new ClasspathChangeListener();
- JavaCore.addElementChangedListener(fClasspathChangeListener);
- fProjectDescriptions = new HashMap();
- }
-
- public void addTaglibIndexListener(ITaglibIndexListener listener) {
- _instance.internalAddTaglibIndexListener(listener);
- }
-
- /**
- * @param project
- * @return
- */
- ProjectDescription createDescription(IProject project) {
- ProjectDescription description = (ProjectDescription) fProjectDescriptions.get(project);
- if (description == null) {
- description = new ProjectDescription(project);
- description.index();
- description.indexClasspath();
- fProjectDescriptions.put(project, description);
- }
- return description;
- }
-
- private synchronized void internalAddTaglibIndexListener(ITaglibIndexListener listener) {
- if (fTaglibIndexListeners == null) {
- fTaglibIndexListeners = new ITaglibIndexListener[]{listener};
- }
- else {
- List listeners = new ArrayList(Arrays.asList(fTaglibIndexListeners));
- listeners.add(listener);
- fTaglibIndexListeners = (ITaglibIndexListener[]) listeners.toArray(new ITaglibIndexListener[0]);
- }
- }
-
- private ITaglibRecord[] internalGetAvailableTaglibRecords(IPath location) {
- ITaglibRecord[] records = null;
- IFile baseResource = ResourcesPlugin.getWorkspace().getRoot().getFile(location);
- if (baseResource != null) {
- IProject project = baseResource.getProject();
- ProjectDescription description = createDescription(project);
- List availableRecords = description.getAvailableTaglibRecords(location);
- records = (ITaglibRecord[]) availableRecords.toArray(records);
- }
- else {
- records = new ITaglibRecord[0];
- }
- return records;
- }
-
- private IPath internalGetContextRoot(IPath path) {
- IFile baseResource = FileBuffers.getWorkspaceFileAtLocation(path);
- if (baseResource != null) {
- IProject project = baseResource.getProject();
- ProjectDescription description = _instance.createDescription(project);
- IPath rootPath = description.getLocalRoot(baseResource.getFullPath());
- return ResourcesPlugin.getWorkspace().getRoot().getLocation().append(rootPath);
- }
- // try to handle out-of-workspace paths
- IPath root = path;
- while (root != null && !root.isRoot())
- root = root.removeLastSegments(1);
- if (root == null)
- root = path;
- return root;
- }
-
- private synchronized void internalRemoveTaglibIndexListener(ITaglibIndexListener listener) {
- if (fTaglibIndexListeners != null) {
- List listeners = new ArrayList(Arrays.asList(fTaglibIndexListeners));
- listeners.remove(listener);
- fTaglibIndexListeners = (ITaglibIndexListener[]) listeners.toArray(new ITaglibIndexListener[0]);
- }
- }
-
- private ITaglibRecord internalResolve(String basePath, String reference, boolean crossProjects) {
- IProject project = null;
- ITaglibRecord resolved = null;
- IFile baseResource = FileBuffers.getWorkspaceFileAtLocation(new Path(basePath));
- if (baseResource != null) {
- project = baseResource.getProject();
- ProjectDescription description = createDescription(project);
- resolved = description.resolve(basePath, reference);
- }
- else {
- // try simple file support outside of the workspace
- File baseFile = FileBuffers.getSystemFileAtLocation(new Path(basePath));
- if (baseFile != null) {
- String normalizedReference = URIHelper.normalize(reference, basePath, "/"); //$NON-NLS-1$
- if (normalizedReference != null) {
- TLDRecord record = new TLDRecord();
- record.location = new Path(normalizedReference);
- record.uri = reference;
- resolved = record;
- }
- }
- }
- return resolved;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/URLRecord.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/URLRecord.java
deleted file mode 100644
index 655b552dbc..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/URLRecord.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel;
-
-import java.net.URL;
-
-public class URLRecord implements ITaglibRecord {
- URL url;
- String uri;
- String baseLocation;
-
- public String getBaseLocation() {
- return baseLocation;
- }
-
- public URLRecord() {
- super();
- }
-
- public short getRecordType() {
- return ITaglibRecord.URL;
- }
-
- /**
- * @return Returns the uri.
- */
- public String getURI() {
- return uri;
- }
-
- /**
- * @return Returns the URL.
- */
- public URL getURL() {
- return url;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
deleted file mode 100644
index adf9348f4a..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDAttributeDeclaration;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDDocument;
-import org.eclipse.wst.common.contentmodel.CMDataType;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.sse.core.util.StringUtils;
-
-public class CMAttributeDeclarationImpl implements TLDAttributeDeclaration {
-
- private CMDataType attrType = new CMDataTypeImpl(CMDataType.CDATA);
- private String fDescription;
-
- //
- private boolean fIsFragment = false;
-
- private CMDocument fOwnerDocument;
- // optional id
- private String id = null;
-
- // required name
- private String name = null;
- // optional "required" element present, defaults to not present
- private boolean required = false;
-
- // optional run-time (scriplet derived) value of attributes, defaults to none/false
- private String rtexprvalue = null;
-
- private String type = null;
-
- /**
- * CMAttributeDeclarationImpl constructor comment.
- */
- public CMAttributeDeclarationImpl(CMDocument owner) {
- super();
- fOwnerDocument = owner;
- }
-
- /**
- * getAttrName method
- * @return java.lang.String
- */
- public String getAttrName() {
- return getNodeName();
- }
-
- /**
- * getAttrType method
- * @return CMDataType
- */
- public CMDataType getAttrType() {
- return attrType;
- }
-
- /**
- * @deprecated in superclass
- */
- public String getDefaultValue() {
- return ""; //$NON-NLS-1$
- }
- /**
- * @return Returns the description.
- */
- public String getDescription() {
- return fDescription;
- }
-
- /**
- * @deprecated in superclass
- */
- public Enumeration getEnumAttr() {
- return null;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getId() {
- return id;
- }
-
- /**
- * getNodeName method
- * @return java.lang.String
- */
- public String getNodeName() {
- return name;
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- *
- */
- public int getNodeType() {
- return CMNode.ATTRIBUTE_DECLARATION;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsp.core.contentmodel.tld.TLDAttributeDeclaration#getOwnerDocument()
- */
- public CMDocument getOwnerDocument() {
- return fOwnerDocument;
- }
-
- /**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(TLDDocument.CM_KIND)) {
- return TLDDocument.JSP_TLD;
- }
- return null;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public java.lang.String getRtexprvalue() {
- return rtexprvalue;
- }
-
- public String getType() {
- return type;
- }
-
- /**
- * getUsage method
- * @return int
- * OPTIONAL|REQUIRED
- */
- public int getUsage() {
- return required ? REQUIRED : OPTIONAL;
- }
- /**
- * @return Returns the isFragment.
- */
- public boolean isFragment() {
- return fIsFragment;
- }
-
- /**
- *
- * @return boolean
- */
- public boolean isRequired() {
- return required;
- }
- /**
- * @param description The description to set.
- */
- public void setDescription(String description) {
- fDescription = description;
- }
- /**
- * @param isFragment The isFragment to set.
- */
- public void setFragment(boolean isFragment) {
- fIsFragment = isFragment;
- }
-
- /**
- *
- * @param newId java.lang.String
- */
- public void setId(String newId) {
- id = newId;
- }
-
- public void setNodeName(String string) {
- name = string;
- }
-
- /**
- *
- * @param newRequired boolean
- */
- public void setRequired(boolean newRequired) {
- required = newRequired;
- }
-
- /**
- *
- * @param newRequired boolean
- */
- public void setRequiredString(String newRequired) {
- if (newRequired.equalsIgnoreCase("true") || newRequired.equalsIgnoreCase("yes")) //$NON-NLS-2$//$NON-NLS-1$
- setRequired(true);
- else if (newRequired.equalsIgnoreCase("false") || newRequired.equalsIgnoreCase("no")) //$NON-NLS-2$//$NON-NLS-1$
- setRequired(false);
- }
-
- /**
- *
- * @param newRtexprvalue java.lang.String
- */
- public void setRtexprvalue(String newRtexprvalue) {
- rtexprvalue = newRtexprvalue;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- return false;
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("\n\t " + super.toString()); //$NON-NLS-1$
- buffer.append("\n\t name:" + StringUtils.escape(getNodeName())); //$NON-NLS-1$
- // Boolean.toString(boolean) is introduced in 1.4
- //buffer.append("\n\t required:" + StringUtils.escape(Boolean.toString(isRequired())));
- buffer.append("\n\t required:" + StringUtils.toString(isRequired())); //$NON-NLS-1$
- buffer.append("\n\t rtexpr:" + StringUtils.escape(getRtexprvalue())); //$NON-NLS-1$
- if (getId() != null)
- buffer.append("\n\t id:" + StringUtils.escape(getId())); //$NON-NLS-1$
- return buffer.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDataTypeImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDataTypeImpl.java
deleted file mode 100644
index 04cdb212ad..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDataTypeImpl.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-
-
-import org.eclipse.wst.common.contentmodel.CMDataType;
-import org.eclipse.wst.common.contentmodel.CMNode;
-
-public class CMDataTypeImpl implements CMDataType {
-
- protected String dataTypeName;
-
- public CMDataTypeImpl(String dataTypeName) {
- this.dataTypeName = dataTypeName;
- }
-
- /**
- * getTypeName method
- * @return java.lang.String
- *
- * This method returns a suitable default value that can be used when an instance of the data type is created.
- * This returns null of a suitable default is not available.
- */
- public String generateInstanceValue() {
- return null;
- }
-
- public String getDataTypeName() {
- return dataTypeName;
- }
-
- /**
- * getTypeName method
- * @return java.lang.String[]
- *
- */
- public String[] getEnumeratedValues() {
- return null;
- }
-
- /**
- * getTypeName method
- * @return java.lang.String
- *
- * Returns the implied value or null if none exists.
- */
- public String getImpliedValue() {
- return null;
- }
-
- /**
- * getImpliedValueKind method
- * @return int
- *
- * Returns one of :
- * IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED, IMPLIED_VALUE_DEFAULT.
- */
- public int getImpliedValueKind() {
- return IMPLIED_VALUE_NONE;
- }
-
- public String getNodeName() {
- return dataTypeName;
- }
-
- public int getNodeType() {
- return CMNode.DATA_TYPE;
- }
-
- /**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property described by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- return null;
- }
-
- /**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java
deleted file mode 100644
index d9a4668947..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java
+++ /dev/null
@@ -1,675 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP11TLDNames;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP12TLDNames;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP20TLDNames;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDDocument;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDFunction;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDInitParam;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDListener;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDValidator;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDVariable;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.contentmodel.ITaglibRecord;
-import org.eclipse.jst.jsp.core.internal.contentmodel.JarRecord;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TLDRecord;
-import org.eclipse.jst.jsp.core.internal.contentmodel.URLRecord;
-import org.eclipse.jst.jsp.core.internal.util.DocumentProvider;
-import org.eclipse.wst.common.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.factory.CMDocumentFactory;
-import org.eclipse.wst.sse.core.util.JarUtilities;
-import org.eclipse.wst.xml.uriresolver.util.URIHelper;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * CMDocumentBuilder for Taglib Descriptors
- *
- * Returns namespace-less CMDocuments for a taglib descriptor, loading it
- * directly from a file or extracted from a JAR archive. Content Model objects
- * will implement the TLDCMDocument, TLDElementDeclaration, and
- * TLDAttributeDeclaration interfaces for extended properties.
- */
-public class CMDocumentFactoryTLD implements CMDocumentFactory {
-
- static final boolean _debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/tldcmdocument/factory")); //$NON-NLS-1$ //$NON-NLS-2$
-
- /**
- * CMDocumentFactoryTLD constructor comment.
- */
- public CMDocumentFactoryTLD() {
- super();
- }
-
- /**
- * NOT API
- *
- * @param baselocation
- * @param input
- * @return
- */
- public CMDocument buildCMDocument(String baselocation, InputStream input) {
- DocumentProvider provider = new DocumentProvider();
- provider.setValidating(false);
- provider.setRootElementName(JSP11TLDNames.TAGLIB);
- provider.setInputStream(input);
- if (baselocation != null)
- provider.setBaseReference(baselocation);
- return loadDocument(baselocation, provider.getRootElement());
- }
-
- /**
- * @param fileName
- * @return
- */
- private CMDocument buildCMDocumentFromDirectory(File directory) {
- if (_debug) {
- System.out.println("not implemented: tagdir loading for " + directory.getAbsolutePath());
- }
- return null;
- }
-
- /**
- * NOT API
- *
- * @param fileName
- * @return
- */
- protected CMDocument buildCMDocumentFromFile(String fileName) {
- // load the taglib descriptor file
- DocumentProvider provider = new DocumentProvider();
- provider.setValidating(false);
- provider.setBaseReference(fileName);
- provider.setRootElementName(JSP11TLDNames.TAGLIB);
- provider.setFileName(fileName);
- Node rootElement = provider.getRootElement();
- return loadDocument(fileName, rootElement);
- }
-
- /**
- * Builds a CMDocument assuming the JSP v1.1 default path
- *
- * @param jarFileName -
- * the name of the containing JAR file
- */
- protected CMDocument buildCMDocumentFromJar(String jarFileName) {
- // load the taglib descriptor file
- return buildCMDocumentFromJar(jarFileName, JarUtilities.JSP11_TAGLIB);
- }
-
- /**
- * Builds a CMDocument
- *
- * @param jarFileName -
- * the name of the containing JAR file
- * @param contentFileName -
- * the path within the JAR for a valid taglib descriptor
- */
- protected CMDocument buildCMDocumentFromJar(String jarFileName, String contentFileName) {
- // load the taglib descriptor file
- DocumentProvider provider = new DocumentProvider();
- provider.setValidating(false);
- provider.setBaseReference(jarFileName);
- provider.setRootElementName(JSP11TLDNames.TAGLIB);
- provider.setJarFileName(jarFileName);
- provider.setFileName(contentFileName);
- CMDocument document = loadDocument("jar:file://" + jarFileName + "!" + contentFileName, provider.getRootElement()); //$NON-NLS-1$ //$NON-NLS-2$
- // TODO: Add the tags declared in META-INF/tags, see JSP 2.0 section
- // 8.4.1
- return document;
- }
-
- protected CMAttributeDeclaration createAttributeDeclaration(CMDocument document, Node attrNode) {
- CMAttributeDeclarationImpl attr = new CMAttributeDeclarationImpl(document);
-
- Node child = attrNode.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals(JSP11TLDNames.NAME) && child.hasChildNodes()) {
- attr.setNodeName(getContainedText(child));
- }
- else if (child.getNodeName().equals(JSP12TLDNames.DESCRIPTION) && child.hasChildNodes()) {
- attr.setDescription(getContainedText(child));
- }
- else if (child.getNodeName().equals(JSP11TLDNames.ID) && child.hasChildNodes()) {
- attr.setId(getContainedText(child));
- }
- else if (child.getNodeName().equals(JSP11TLDNames.REQUIRED) && child.hasChildNodes()) {
- attr.setRequiredString(getContainedText(child));
- }
- else if (child.getNodeName().equals(JSP11TLDNames.RTEXPRVALUE) && child.hasChildNodes()) {
- attr.setRtexprvalue(getContainedText(child));
- }
- else if (child.getNodeName().equals(JSP20TLDNames.FRAGMENT) && child.hasChildNodes()) {
- attr.setFragment(Boolean.valueOf(getContainedText(child)).booleanValue());
- }
- }
- child = child.getNextSibling();
- }
-
- return attr;
- }
-
- /**
- * Builds a CMDocument from a taglib descriptor
- *
- * @param uri -
- * the location of a valid taglib descriptor
- */
- public CMDocument createCMDocument(String uri) {
- CMDocument result = null;
- URL url = null;
- try {
- url = new URL(uri);
- }
- catch (MalformedURLException e) {
- result = createCMDocumentFromFile(uri);
- }
- if (result == null && url != null) {
- InputStream istream = null;
- if (url.getProtocol().equals("file")) { //$NON-NLS-1$
- result = createCMDocumentFromFile(url.getFile());
- }
- else {
- try {
- istream = url.openStream();
- result = buildCMDocument(url.toExternalForm(), istream);
- }
- catch (Exception t) {
- // Logger.log(Logger.INFO, "Exception creating content
- // model: could not load TLD contents from URI " + uri + "
- // :" + t);
- }
- }
- try {
- if (istream != null)
- istream.close();
- }
- catch (IOException e1) {
- // don't care
- }
- }
- if (result == null)
- result = new CMDocumentImpl();
- return result;
- }
-
- /**
- * @param fileName
- * @return
- */
- private CMDocument createCMDocumentFromFile(String fileName) {
- CMDocument result = null;
- File file = new File(fileName);
- try {
- if (file.isDirectory()) {
- result = buildCMDocumentFromDirectory(file);
- }
- }
- catch (SecurityException e) {
- result = null;
- }
- if (result == null) {
- if (fileName.endsWith(".jar")) { //$NON-NLS-1$
- result = buildCMDocumentFromJar(fileName);
- }
- else {
- result = buildCMDocumentFromFile(fileName);
- }
- }
- return result;
- }
-
- protected CMElementDeclaration createElementDeclaration(CMDocument cmdocument, Element tagFileNode, String path) {
- CMElementDeclarationImpl ed = new CMElementDeclarationImpl(cmdocument);
- boolean hasName = false;
-
- // load information declared within the .tld
- Node child = tagFileNode.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String nodeName = child.getNodeName();
- if (nodeName.equals(JSP12TLDNames.DESCRIPTION) && child.hasChildNodes()) {
- ed.setDescription(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.DISPLAY_NAME) && child.hasChildNodes()) {
- ed.setDisplayName(getContainedText(child));
- }
- else if (nodeName.equals(JSP20TLDNames.EXAMPLE) && child.hasChildNodes()) {
- ed.setExample(getContainedText(child));
- }
- else if (nodeName.equals(JSP20TLDNames.ICON) && child.hasChildNodes()) {
- ed.setSmallIcon(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.NAME) && child.hasChildNodes()) {
- ed.setNodeName(getContainedText(child));
- hasName = ed.getNodeName().trim().length() > 0;
- }
- else if (nodeName.equals(JSP20TLDNames.PATH) && child.hasChildNodes()) {
- ed.setPath(getContainedText(child));
- }
- else if (nodeName.equals(JSP20TLDNames.TAG_EXTENSION)) {
- ed.getExtensions().add(child);
- }
- }
- child = child.getNextSibling();
- }
- if (hasName) {
- // load information declared within the .tag(x) file
- // JSP2_TODO: implement for JSP 2.0
- return ed;
- }
- return null;
- }
-
- protected CMElementDeclaration createElementDeclaration(CMDocument document, Node tagNode) {
- CMElementDeclarationImpl ed = new CMElementDeclarationImpl(document);
-
- Node child = tagNode.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- // tag information
- String nodeName = child.getNodeName();
- if (nodeName.equals(JSP11TLDNames.NAME) && child.hasChildNodes()) {
- ed.setNodeName(getContainedText(child));
- }
- else if ((nodeName.equals(JSP11TLDNames.TAGCLASS) || nodeName.equals(JSP12TLDNames.TAG_CLASS)) && child.hasChildNodes()) {
- ed.setTagclass(getContainedText(child));
- }
- else if ((nodeName.equals(JSP11TLDNames.TEICLASS) || nodeName.equals(JSP12TLDNames.TEI_CLASS)) && child.hasChildNodes()) {
- ed.setTeiclass(getContainedText(child));
- }
- else if ((nodeName.equals(JSP11TLDNames.BODYCONTENT) || nodeName.equals(JSP12TLDNames.BODY_CONTENT)) && child.hasChildNodes()) {
- String bodycontent = getContainedText(child);
- // Apparently, Apache Tomcat is not case sensitive about
- // these values
- if (bodycontent.equalsIgnoreCase(JSP11TLDNames.CONTENT_JSP))
- ed.setBodycontent(JSP11TLDNames.CONTENT_JSP);
- else if (bodycontent.equalsIgnoreCase(JSP11TLDNames.CONTENT_TAGDEPENDENT))
- ed.setBodycontent(JSP11TLDNames.CONTENT_TAGDEPENDENT);
- else if (bodycontent.equalsIgnoreCase(JSP11TLDNames.CONTENT_EMPTY))
- ed.setBodycontent(JSP11TLDNames.CONTENT_EMPTY);
- else if (bodycontent.equalsIgnoreCase(JSP20TLDNames.CONTENT_SCRIPTLESS))
- ed.setBodycontent(JSP20TLDNames.CONTENT_SCRIPTLESS);
- }
- // info (1.1 only) or description (1.2 only)
- else if ((nodeName.equals(JSP11TLDNames.INFO) || nodeName.equals(JSP12TLDNames.DESCRIPTION)) && child.hasChildNodes()) {
- // ed.setDescription(getContainedText(child));
- ed.setDescription(getContainedText(child));
- }
- // attributes
- else if (nodeName.equals(JSP11TLDNames.ATTRIBUTE)) {
- CMAttributeDeclaration attr = createAttributeDeclaration(document, child);
- ed.attributes.setNamedItem(attr.getAttrName(), attr);
- }
- // variables
- else if (nodeName.equals(JSP12TLDNames.VARIABLE)) {
- ed.getVariables().add(createVariable(child));
- }
- else if (nodeName.equals(JSP12TLDNames.LARGE_ICON) && child.hasChildNodes()) {
- ed.setLargeIcon(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.SMALL_ICON) && child.hasChildNodes()) {
- ed.setSmallIcon(getContainedText(child));
- }
- else if (nodeName.equals(JSP20TLDNames.TAG_EXTENSION) && child.getNodeType() == Node.ELEMENT_NODE) {
- ed.getExtensions().add(child);
- }
- }
- child = child.getNextSibling();
- }
- return ed;
- }
-
- protected TLDFunction createFunction(CMDocument document, Node functionNode) {
- TLDFunctionImpl function = new TLDFunctionImpl(document);
- boolean hasName = false;
-
- Node child = functionNode.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- // tag information
- String nodeName = child.getNodeName();
- if (nodeName.equals(JSP12TLDNames.DESCRIPTION) && child.hasChildNodes()) {
- function.setDescription(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.DISPLAY_NAME) && child.hasChildNodes()) {
- function.setName(getContainedText(child));
- }
- else if (nodeName.equals(JSP20TLDNames.EXAMPLE) && child.hasChildNodes()) {
- function.setExample(getContainedText(child));
- }
- else if (nodeName.equals(JSP20TLDNames.FUNCTION_CLASS) && child.hasChildNodes()) {
- function.setClassName(getContainedText(child));
- }
- else if (nodeName.equals(JSP20TLDNames.FUNCTION_EXTENSION) && child.hasChildNodes()) {
- function.getExtensions().add(child);
- }
- else if (nodeName.equals(JSP20TLDNames.FUNCTION_SIGNATURE) && child.hasChildNodes()) {
- function.setSignature(getContainedText(child));
- }
- else if (nodeName.equals(JSP20TLDNames.ICON) && child.hasChildNodes()) {
- function.setIcon(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.NAME) && child.hasChildNodes()) {
- function.setName(getContainedText(child));
- hasName = function.getName().trim().length() > 0;
- }
- }
- child = child.getNextSibling();
- }
- if (hasName) {
- return function;
- }
- return null;
- }
-
- protected TLDInitParam createInitParam(Node initParamNode) {
- TLDInitParamImpl initParam = new TLDInitParamImpl();
- Node child = initParamNode.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String nodeName = child.getNodeName();
- if (nodeName.equals(JSP12TLDNames.VALIDATOR_PARAM_NAME) && child.hasChildNodes()) {
- initParam.setName(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.VALIDATOR_PARAM_VALUE) && child.hasChildNodes()) {
- initParam.setValue(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.DESCRIPTION) && child.hasChildNodes()) {
- initParam.setDescription(getContainedText(child));
- }
- }
- child = child.getNextSibling();
- }
- return initParam;
- }
-
- protected TLDListener createListener(Node listenerNode) {
- TLDListenerImpl listener = new TLDListenerImpl();
- Node child = listenerNode.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String nodeName = child.getNodeName();
- if (nodeName.equals(JSP12TLDNames.LISTENER_CLASS) && child.hasChildNodes()) {
- listener.setListenerClass(getContainedText(child));
- }
- }
- child = child.getNextSibling();
- }
- return listener;
- }
-
- protected TLDValidator createValidator(Node validatorNode) {
- TLDValidatorImpl validator = new TLDValidatorImpl();
- Node child = validatorNode.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String nodeName = child.getNodeName();
- if (nodeName.equals(JSP12TLDNames.VALIDATOR_CLASS) && child.hasChildNodes()) {
- validator.setValidatorClass(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.VALIDATOR_INIT_PARAM) && child.hasChildNodes()) {
- validator.getInitParams().add(createInitParam(child));
- }
- }
- child = child.getNextSibling();
- }
- return validator;
- }
-
- protected TLDVariable createVariable(Node variableNode) {
- TLDVariableImpl variable = new TLDVariableImpl();
- Node child = variableNode.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String nodeName = child.getNodeName();
- if (nodeName.equals(JSP12TLDNames.VARIABLE_CLASS) && child.hasChildNodes()) {
- variable.setVariableClass(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.VARIABLE_DECLARE) && child.hasChildNodes()) {
- variable.setDeclareString(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.VARIABLE_NAME_FROM_ATTRIBUTE) && child.hasChildNodes()) {
- variable.setNameFromAttribute(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.VARIABLE_NAME_GIVEN) && child.hasChildNodes()) {
- variable.setNameGiven(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.VARIABLE_SCOPE) && child.hasChildNodes()) {
- variable.setScope(getContainedText(child));
- }
- else if (nodeName.equals(JSP12TLDNames.DESCRIPTION) && child.hasChildNodes()) {
- variable.setDescription(getContainedText(child));
- }
- }
- child = child.getNextSibling();
- }
- return variable;
- }
-
- protected String getContainedText(Node parent) {
- NodeList children = parent.getChildNodes();
- if (children.getLength() == 1) {
- return children.item(0).getNodeValue().trim();
- }
- StringBuffer s = new StringBuffer();
- Node child = parent.getFirstChild();
- while (child != null) {
- s.append(child.getNodeValue());
- child = child.getNextSibling();
- }
- return s.toString().trim();
- }
-
- public boolean isBuilderForGrammar(String grammarFileName) {
- String fileName = grammarFileName.toLowerCase();
- return fileName.endsWith(".tld") || fileName.endsWith(".jar"); //$NON-NLS-2$//$NON-NLS-1$
- }
-
- private CMDocument loadDocument(String baseLocation, Node taglib) {
- Node root = taglib;
-
- // create the CMDocument
- CMDocumentImpl document = new CMDocumentImpl();
- document.setBaseLocation(baseLocation);
-
- if (root == null) {
- if (_debug) {
- System.out.println("null \"taglib\" element for TLD " + baseLocation);
- }
- return document;
- }
-
- // populate the CMDocument
- Node child = root.getFirstChild();
- while (child != null) {
- if (child.getNodeType() != Node.ELEMENT_NODE) {
- child = child.getNextSibling();
- continue;
- }
- String nodeName = child.getNodeName();
- // tag
- if (nodeName.equals(JSP11TLDNames.TAG)) {
- CMElementDeclaration ed = createElementDeclaration(document, child);
- if (ed != null) {
- document.fElements.setNamedItem(ed.getNodeName(), ed);
- }
- }
- // tag-file
- else if (nodeName.equals(JSP20TLDNames.TAG_FILE) && child.getNodeType() == Node.ELEMENT_NODE && child.hasChildNodes()) {
- Element tagFileElement = (Element) child;
- String path = tagFileElement.getAttribute(JSP20TLDNames.PATH);
-
- CMElementDeclarationImpl ed = (CMElementDeclarationImpl) createElementDeclaration(document, tagFileElement, path);
- if (ed != null) {
- document.fElements.setNamedItem(ed.getNodeName(), ed);
- }
- }
- // other one-of-a-kind children
- // JSP version
- else if ((nodeName.equals(JSP11TLDNames.JSPVERSION) || nodeName.equals(JSP12TLDNames.JSP_VERSION)) && child.hasChildNodes()) {
- document.setJspversion(getContainedText(child));
- }
- // tag library version
- else if ((nodeName.equals(JSP11TLDNames.TLIBVERSION) || nodeName.equals(JSP12TLDNames.TLIB_VERSION)) && child.hasChildNodes()) {
- document.setTlibversion(getContainedText(child));
- }
- // short name
- else if ((nodeName.equals(JSP11TLDNames.SHORTNAME) || nodeName.equals(JSP12TLDNames.SHORT_NAME)) && child.hasChildNodes()) {
- document.setShortname(getContainedText(child));
- }
- // URI/URN
- else if ((nodeName.equals(JSP11TLDNames.URI) || nodeName.equals(JSP11TLDNames.URN)) && child.hasChildNodes()) { //$NON-NLS-1$
- document.setUri(getContainedText(child));
- }
- // info
- else if (nodeName.equals(JSP11TLDNames.INFO) && child.hasChildNodes()) {
- document.setInfo(getContainedText(child));
- }
- // New JSP 1.2
- // description
- else if (nodeName.equals(JSP12TLDNames.DESCRIPTION)) {
- document.setDescription(getContainedText(child));
- }
- // display name
- else if (nodeName.equals(JSP12TLDNames.DISPLAY_NAME) && child.hasChildNodes()) {
- document.setDisplayName(getContainedText(child));
- }
- // large icon
- else if (nodeName.equals(JSP12TLDNames.LARGE_ICON) && child.hasChildNodes()) {
- document.setLargeIcon(getContainedText(child));
- }
- // small icon
- else if (nodeName.equals(JSP12TLDNames.SMALL_ICON) && child.hasChildNodes()) {
- document.setSmallIcon(getContainedText(child));
- }
- // validator
- else if (nodeName.equals(JSP12TLDNames.VALIDATOR)) {
- document.setValidator(createValidator(child));
- }
- // listener
- else if (nodeName.equals(JSP12TLDNames.LISTENER)) {
- document.getListeners().add(createListener(child));
- }
- else if (nodeName.equals(JSP20TLDNames.FUNCTION)) {
- TLDFunction function = createFunction(document, child);
- if (function != null) {
- document.getListeners().add(function);
- }
- }
- else if (nodeName.equals(JSP20TLDNames.TAGLIB_EXTENSION)) {
- document.getExtensions().add(child);
- }
-
- child = child.getNextSibling();
- }
- return document;
- }
-
- /**
- * @param reference
- * @return
- */
- public CMDocument createCMDocument(ITaglibRecord reference) {
- CMDocumentImpl document = null;
- switch (reference.getRecordType()) {
- case (ITaglibRecord.TLD) : {
- TLDRecord record = (TLDRecord) reference;
- document = (CMDocumentImpl) buildCMDocumentFromFile(record.getLocation().toString());
- if (_debug && document != null && document.getElements().getLength() == 0) {
- System.out.println("failure parsing " + record.getLocation());
- }
-
- if (document.getSmallIcon() != null) {
- String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), record.getLocation().toString(), "/");
- document.setProperty(JSP12TLDNames.SMALL_ICON, "file:" + iconPath);
- }
- if (document.getLargeIcon() != null) {
- String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), record.getLocation().toString(), "/");
- document.setProperty(JSP12TLDNames.LARGE_ICON, "file:" + iconPath);
- }
- }
- break;
- case (ITaglibRecord.JAR) : {
- JarRecord record = (JarRecord) reference;
- document = (CMDocumentImpl) buildCMDocumentFromJar(record.getLocation().toString());
- if (document.getSmallIcon() != null) {
- String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), record.getLocation().toString() + "!META-INF/", "/");
- document.setProperty(JSP12TLDNames.SMALL_ICON, "jar:file:" + iconPath);
- }
- if (document.getLargeIcon() != null) {
- String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), record.getLocation().toString() + "!META-INF/", "/");
- document.setProperty(JSP12TLDNames.LARGE_ICON, "jar:file:" + iconPath);
- }
- if (document != null && document.getElements().getLength() == 0) {
- System.out.println("failure parsing " + record.getLocation());
- }
- }
- break;
- case (ITaglibRecord.TAGDIR) : {
- // TagDirRecord record = (TagDirRecord) reference;
- // document =
- // buildCMDocumentFromDirectory(record.getLocation().toFile());
- }
- break;
- case (ITaglibRecord.URL) : {
- URLRecord record = (URLRecord) reference;
- InputStream urlContents = null;
- boolean doCache = false;
- URLConnection connection = null;
- try {
- connection = record.getURL().openConnection();
- doCache = connection.getUseCaches();
- connection.setUseCaches(false);
- urlContents = connection.getInputStream();
- document = (CMDocumentImpl) buildCMDocument(record.getBaseLocation(), urlContents);
- if (document.getSmallIcon() != null) {
- String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), record.getURL().toString(), "/");
- document.setProperty(JSP12TLDNames.SMALL_ICON, iconPath);
- }
- if (document.getLargeIcon() != null) {
- String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), record.getURL().toString(), "/");
- document.setProperty(JSP12TLDNames.LARGE_ICON, iconPath);
- }
- connection.setUseCaches(doCache);
- }
- catch (IOException e) {
- Logger.logException(e);
- }
- finally {
- if (urlContents != null) {
- try {
- urlContents.close();
- }
- catch (IOException e) {
- }
- }
- }
- }
- break;
- }
- return document;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentImpl.java
deleted file mode 100644
index de54c5e4eb..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentImpl.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDDocument;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDValidator;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.wst.common.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.common.contentmodel.CMNamespace;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.common.contentmodel.CMPlugin;
-import org.eclipse.wst.common.contentmodel.annotation.AnnotationMap;
-import org.eclipse.wst.common.contentmodel.internal.annotation.AnnotationFileParser;
-import org.eclipse.wst.sse.core.util.StringUtils;
-
-public class CMDocumentImpl implements TLDDocument {
-
- /** Contains taginfo and/or any other misc properties*/
- private AnnotationMap fAnnotationMap = null;
-
- private Map fProperties = new HashMap(0);
-
- /**
- * Records from where this document was created
- */
- private String fBaseLocation;
- /**
- * since JSP 1.2
- */
- private String fDescription;
-
- private String fDisplayName;
-
- /**
- * NOT public API
- */
- public CMNamedNodeMapImpl fElements = new CMNamedNodeMapImpl();
-
- private List fFunctions = new ArrayList(0);
-
- // id of the taglib
- private String fId = null;
- /**
- * Children of "taglib" within a .tld file each allow
- * one Text node (#PCDATA) beneath them. Store the values
- * here for simplicity.
- */
- // The JSP specification required for this taglib to function
- private String fJSPVersion = null;
-
- private String fLargeIcon;
-
- private List fListeners;
-
- private String fParentURI = null;
- // A short name suggested as the default prefix for tags within the lib
- private String fShortName = null;
-
- private String fSmallIcon;
-
- /**
- * since JSP 2.0
- *
- * The entire element is stored here since its layout is undefined
- */
- private List fTaglibExtensions = new ArrayList(0);
-
- // Version information for the taglib itself
- private String fTLibVersion = null;
-
- // A unique public URI describing this taglib. Recommended to be the URL
- // to the descriptor
- private String fURI = null;
-
- protected TLDValidator validator;
-
- /**
- * CMDocumentImpl constructor comment.
- */
- public CMDocumentImpl() {
- super();
- }
-
- /**
- * Get the annotation map associated with this document. Lazily creates
- * and loads annotation map.
- * @return AnnotationMap
- */
- private AnnotationMap getAnnotationMap() {
- // create a new annotation map and load it up
- if (fAnnotationMap == null) {
- fAnnotationMap = new AnnotationMap();
-
- List annotationFiles = CMPlugin.getInstance().getAnnotationFiles(getUri());
- for (Iterator i = annotationFiles.iterator(); i.hasNext();) {
- try {
- String annotationFileURI = (String) i.next();
- AnnotationFileParser parser = new AnnotationFileParser();
- parser.parse(fAnnotationMap, annotationFileURI);
- } catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, "Exception thrown in CMDocumentImpl#getAnnotationMap", e); //$NON-NLS-1$
- }
- }
- }
- return fAnnotationMap;
- }
- /**
- * @return Returns the baseLocation.
- */
- public String getBaseLocation() {
- return fBaseLocation;
- }
-
- /**
- * Gets the description.
- * @return Returns a String
- */
- public String getDescription() {
- return fDescription;
- }
-
- /**
- * Gets the displayName.
- * @return Returns a String
- */
- public String getDisplayName() {
- return fDisplayName;
- }
-
- /**
- * getElements method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of ElementDeclaration
- */
- public CMNamedNodeMap getElements() {
- return fElements;
- }
-
- /**
- * getEntities method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of EntityDeclaration
- */
- public CMNamedNodeMap getEntities() {
- return null;
- }
-
- public List getExtensions() {
- return fTaglibExtensions;
- }
- /**
- * @return Returns the functions.
- */
- public List getFunctions() {
- return fFunctions;
- }
-
- /**
- * Gets the id.
- * @return Returns a String
- */
- public String getId() {
- return fId;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getInfo() {
- return getDescription();
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getJspversion() {
- return fJSPVersion;
- }
-
- /**
- * Gets the largeIcon.
- * @return Returns a String
- */
- public String getLargeIcon() {
- return fLargeIcon;
- }
-
- public List getListeners() {
- if (fListeners == null)
- fListeners = new ArrayList();
- return fListeners;
- }
-
- /**
- * getNamespace method
- * @return CMNamespace
- */
- public CMNamespace getNamespace() {
- return null;
- }
-
- /**
- * getNodeName method
- * @return java.lang.String
- */
- public String getNodeName() {
- return "#cmdocument"; //$NON-NLS-1$
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- *
- */
- public int getNodeType() {
- return CMNode.DOCUMENT;
- }
- /**
- * @return Returns the parentURI.
- */
- public String getParentURI() {
- return fParentURI;
- }
-
- /**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(TLDDocument.CM_KIND)) {
- return TLDDocument.JSP_TLD;
- }
- else if (propertyName.equals("annotationMap")) { //$NON-NLS-1$
- return getAnnotationMap();
- }
- return fProperties.get(propertyName);
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getShortname() {
- return fShortName;
- }
-
- /**
- * Gets the smallIcon.
- * @return Returns a String
- */
- public String getSmallIcon() {
- return fSmallIcon;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getTlibversion() {
- return fTLibVersion;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getUri() {
- return fURI;
- }
-
- /*
- * @see TLDDocument#getValidator()
- */
- public TLDValidator getValidator() {
- return validator;
- }
- /**
- * @param baseLocation The baseLocation to set.
- */
- public void setBaseLocation(String baseLocation) {
- fBaseLocation = baseLocation;
- }
-
- /**
- * Sets the description.
- * @param description The description to set
- */
- public void setDescription(String description) {
- this.fDescription = description;
- }
-
- /**
- * Sets the displayName.
- * @param displayName The displayName to set
- */
- public void setDisplayName(String displayName) {
- this.fDisplayName = displayName;
- }
-
- /**
- * Sets the id.
- * @param id The id to set
- */
- public void setId(String id) {
- this.fId = id;
- }
-
- /**
- *
- * @param newInfo java.lang.String
- */
- public void setInfo(String newInfo) {
- setDescription(newInfo);
- }
-
- /**
- *
- * @param newJspversion java.lang.String
- */
- public void setJspversion(String newJspversion) {
- fJSPVersion = newJspversion;
- }
-
- /**
- * Sets the largeIcon.
- * @param largeIcon The largeIcon to set
- */
- public void setLargeIcon(String largeIcon) {
- this.fLargeIcon = largeIcon;
- }
-
- public void setListeners(List listeners) {
- this.fListeners = listeners;
- }
- /**
- * @param parentURI The parentURI to set.
- */
- public void setParentURI(String parentURI) {
- fParentURI = parentURI;
- }
-
- public void setProperty(String property, Object value) {
- fProperties.put(property, value);
- }
-
- /**
- *
- * @param newShortname java.lang.String
- */
- public void setShortname(String newShortname) {
- fShortName = newShortname;
- }
-
- /**
- * Sets the smallIcon.
- * @param smallIcon The smallIcon to set
- */
- public void setSmallIcon(String smallIcon) {
- this.fSmallIcon = smallIcon;
- }
-
- /**
- *
- * @param newTlibversion java.lang.String
- */
- public void setTlibversion(String newTlibversion) {
- fTLibVersion = newTlibversion;
- }
-
- /**
- *
- * @param newUri java.lang.String
- */
- public void setUri(String newUri) {
- fURI = newUri;
- }
-
- public void setValidator(TLDValidator validator) {
- this.validator = validator;
- }
-
- /**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- if (TLDDocument.CM_KIND.equals(propertyName) || "annotationMap".equals(propertyName)) //$NON-NLS-1$
- return true;
- return fProperties.containsKey(propertyName);
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(super.toString());
- buffer.append("\n\t short name:" + StringUtils.escape(getShortname())); //$NON-NLS-1$
- buffer.append("\n\t display name:" + StringUtils.escape(getDisplayName())); //$NON-NLS-1$
- buffer.append("\n\t description (info):" + StringUtils.escape(getDescription())); //$NON-NLS-1$
- buffer.append("\n\t URI:" + StringUtils.escape(getUri())); //$NON-NLS-1$
- buffer.append("\n\t jsp version:" + StringUtils.escape(getJspversion())); //$NON-NLS-1$
- buffer.append("\n\t taglib version:" + StringUtils.escape(getTlibversion())); //$NON-NLS-1$
- buffer.append("\n\t small icon:" + StringUtils.escape(getSmallIcon())); //$NON-NLS-1$
- buffer.append("\n\t large icon:" + StringUtils.escape(getLargeIcon())); //$NON-NLS-1$
- if (getValidator() != null)
- buffer.append("\n\t validator:" + StringUtils.replace(getValidator().toString(), "\n", "\n\t\t")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- buffer.append("\n\t listeners:"); //$NON-NLS-1$
- for (int i = 0; i < getListeners().size(); i++) {
- buffer.append("\n" + StringUtils.replace(getListeners().get(i).toString(), "\n", "\n\t\t")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- buffer.append("\n\t elements:"); //$NON-NLS-1$
- CMNamedNodeMap elements = getElements();
- for (int i = 0; i < elements.getLength(); i++) {
- buffer.append(StringUtils.replace(elements.item(i).toString(), "\n", "\n\t\t")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return buffer.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
deleted file mode 100644
index 4469319378..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
+++ /dev/null
@@ -1,454 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP11TLDNames;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP12TLDNames;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDDocument;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDElementDeclaration;
-import org.eclipse.wst.common.contentmodel.CMContent;
-import org.eclipse.wst.common.contentmodel.CMDataType;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.common.contentmodel.annotation.AnnotationMap;
-import org.eclipse.wst.sse.core.util.StringUtils;
-
-public class CMElementDeclarationImpl implements TLDElementDeclaration {
-
- // optional attributes
- public CMNamedNodeMapImpl attributes = new CMNamedNodeMapImpl();
- // (empty|JSP|tagdependant|scriptless) - optional, defaults to JSP
- private String bodycontent = JSP11TLDNames.CONTENT_JSP;
-
- /**
- * since JSP 1.2
- *
- * Usage information
- */
- private String description;
-
- /**
- * since JSP 1.2
- */
- private String displayName;
-
- /**
- * since JSP 2.0
- */
- private String fExample;
-
- private CMDocument fOwnerDocument;
-
- private String fPath = null;
-
- private List fTagExtensions = new ArrayList(0);
- /**
- * since JSP 1.2
- */
- private String largeIcon;
-
-
- private int maxOccur = -1;
- private int minOccur = 0;
-
- // required tag name
- private String nodeName = null;
-
- /**
- * since JSP 1.2
- */
- private String smallIcon;
-
- // tag handler class - required
- private String tagclass = null;
-
- // tag extra info class (subclass of javax.servlet.jsp.TagExtraInfo) - optional
- private String teiclass = null;
-
- /**
- * since JSP 1.2
- */
- private List variables;
-
- /**
- * CMElementDeclarationImpl constructor comment.
- */
- public CMElementDeclarationImpl(CMDocument owner) {
- super();
- fOwnerDocument = owner;
- }
-
- /**
- * getAttributes method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of AttributeDeclaration
- */
- public CMNamedNodeMap getAttributes() {
- return attributes;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getBodycontent() {
- return bodycontent;
- }
-
- /**
- * getCMContent method
- * @return CMContent
- *
- * Returns the root node of this element's content model.
- * This can be an CMElementDeclaration or a CMGroup
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * getContentType method
- * @return int
- *
- * Returns one of :
- * ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA.
- */
- public int getContentType() {
- if (bodycontent.equals(JSP11TLDNames.CONTENT_EMPTY))
- return EMPTY;
- if (bodycontent.equals(JSP11TLDNames.CONTENT_TAGDEPENDENT))
- return PCDATA;
- else
- // JSP
- return ANY;
- }
-
- /**
- * getDataType method
- * @return java.lang.String
- */
- public CMDataType getDataType() {
- return new CMDataTypeImpl(CMDataType.CDATA);
- }
-
- /**
- * Gets the description.
- * @return Returns a String
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the displayName.
- * @return Returns a String
- */
- public String getDisplayName() {
- return displayName;
- }
-
- /**
- * getElementName method
- * @return java.lang.String
- */
- public String getElementName() {
- return getNodeName();
- }
- /**
- * @return Returns the example.
- */
- public String getExample() {
- return fExample;
- }
- /**
- * @return Returns the extensions.
- */
- public List getExtensions() {
- return fTagExtensions;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getInfo() {
- return getDescription();
- }
-
- /**
- * Gets the largeIcon.
- * @return Returns a String
- */
- public String getLargeIcon() {
- return largeIcon;
- }
-
- /**
- * getLocalElements method
- * @return CMNamedNodeMap
- *
- * Returns a list of locally defined elements.
- */
- public CMNamedNodeMap getLocalElements() {
- return null;
- }
-
- /**
- * getMaxOccur method
- * @return int
- *
- * If -1, it's UNBOUNDED.
- */
- public int getMaxOccur() {
- return maxOccur;
- }
-
- /**
- * getMinOccur method
- * @return int
- *
- * If 0, it's OPTIONAL.
- * If 1, it's REQUIRED.
- */
- public int getMinOccur() {
- return minOccur;
- }
-
- /**
- * getNodeName method
- * @return java.lang.String
- */
- public String getNodeName() {
- return nodeName;
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- *
- */
- public int getNodeType() {
- return CMNode.ELEMENT_DECLARATION;
- }
-
- /**
- * @return
- */
- public CMDocument getOwnerDocument() {
- return fOwnerDocument;
- }
- /**
- * @return Returns the path.
- */
- public String getPath() {
- return fPath;
- }
-
- /**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property described by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- if (propertyName != null && propertyName.equals("tagInfo")) { //$NON-NLS-1$
- return StringUtils.restoreMarkers(getTagInfo()); // return tag info
- }
- else if (propertyName != null && propertyName.equals("description")) { //$NON-NLS-1$
- return StringUtils.restoreMarkers(getDescription()); // return tag description
- }
- else if (propertyName.equals(TLDDocument.CM_KIND)) {
- return TLDDocument.JSP_TLD;
- }
- else if (propertyName.equals(JSP12TLDNames.SMALL_ICON) || propertyName.equals(JSP12TLDNames.LARGE_ICON)) {
- return getOwnerDocument().getProperty(propertyName);
- }
- return null;
- }
-
- /**
- * Gets the smallIcon.
- * @return Returns a String
- */
- public String getSmallIcon() {
- return smallIcon;
- }
-
- /**
- * Returns the XPath of this element
- * (currently just returns the node name)
- * @return
- */
- private String getSpec() {
- return getNodeName();
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getTagclass() {
- return tagclass;
- }
-
- /**
- * Get the taginfo for this current element
- * @return String taginfo if it exists, null otherwise
- */
- private String getTagInfo() {
- if (getOwnerDocument().supports("annotationMap")) { //$NON-NLS-1$
- AnnotationMap map = (AnnotationMap)getOwnerDocument().getProperty("annotationMap"); //$NON-NLS-1$
- String spec = getSpec();
- String result = map.getProperty(spec, "tagInfo"); //$NON-NLS-1$
- return StringUtils.restoreMarkers(result); // return tag info
- }
- return null;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getTeiclass() {
- return teiclass;
- }
-
- /**
- * Gets the variables.
- * @return Returns a List
- */
- public List getVariables() {
- if (variables == null)
- variables = new ArrayList();
- return variables;
- }
-
- /**
- *
- * @param newBodycontent java.lang.String
- */
- public void setBodycontent(String newBodycontent) {
- bodycontent = newBodycontent;
- }
-
- /**
- * Sets the description.
- * @param description The description to set
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the displayName.
- * @param displayName The displayName to set
- */
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
- /**
- * @param example The example to set.
- */
- public void setExample(String example) {
- fExample = example;
- }
-
- /**
- * Sets the largeIcon.
- * @param largeIcon The largeIcon to set
- */
- public void setLargeIcon(String largeIcon) {
- this.largeIcon = largeIcon;
- }
-
- public void setNodeName(String string) {
- nodeName = string;
- }
- /**
- * @param path The path to set.
- */
- public void setPath(String path) {
- fPath = path;
- }
-
- /**
- * Sets the smallIcon.
- * @param smallIcon The smallIcon to set
- */
- public void setSmallIcon(String smallIcon) {
- this.smallIcon = smallIcon;
- }
-
- /**
- *
- * @param newTagclass java.lang.String
- */
- public void setTagclass(String newTagclass) {
- tagclass = newTagclass;
- }
-
- /**
- *
- * @param newTeiclass java.lang.String
- */
- public void setTeiclass(String newTeiclass) {
- teiclass = newTeiclass;
- }
-
- /**
- * Sets the variables.
- * @param variables The variables to set
- */
- public void setVariables(List variables) {
- this.variables = variables;
- }
-
- /**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- return false;
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("\n\t " + super.toString()); //$NON-NLS-1$
- buffer.append("\n\t name:" + StringUtils.escape(getNodeName())); //$NON-NLS-1$
- buffer.append("\n\t tag class:" + StringUtils.escape(getTagclass())); //$NON-NLS-1$
- buffer.append("\n\t tei class:" + StringUtils.escape(getTeiclass())); //$NON-NLS-1$
- buffer.append("\n\t body content:" + StringUtils.escape(getBodycontent())); //$NON-NLS-1$
- buffer.append("\n\t description (info):" + StringUtils.escape(getDescription())); //$NON-NLS-1$
- buffer.append("\n\t attributes:"); //$NON-NLS-1$
- CMNamedNodeMap attributes = getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- buffer.append("\n\t\t" + StringUtils.replace(attributes.item(i).toString(), "\n", "\n\t\t")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- buffer.append("\n\t variables:"); //$NON-NLS-1$
- for (int i = 0; i < getVariables().size(); i++) {
- buffer.append("\n\t\t" + StringUtils.replace(getVariables().get(i).toString(), "\n", "\n\t\t")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- return buffer.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMNamedNodeMapImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMNamedNodeMapImpl.java
deleted file mode 100644
index ec0683d36e..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMNamedNodeMapImpl.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-
-
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.wst.common.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.common.contentmodel.CMNode;
-
-public class CMNamedNodeMapImpl implements CMNamedNodeMap {
-
- public static CMNamedNodeMapImpl EMPTY_NAMED_NODE_MAP = new CMNamedNodeMapImpl();
- protected Hashtable table = new Hashtable();
-
- /**
- * CMNamedNodeMapImpl constructor comment.
- */
- public CMNamedNodeMapImpl() {
- super();
- }
-
- Hashtable getHashtable() {
- return table;
- }
-
- /**
- * getLength method
- * @return int
- */
- public int getLength() {
- return table.size();
- }
-
- /**
- * getNamedItem method
- * @return CMNode
- * @param name java.lang.String
- */
- public CMNode getNamedItem(String name) {
- return (CMNode) table.get(name);
- }
-
- /**
- * item method
- * @return CMNode
- * @param index int
- */
- public CMNode item(int index) {
- Object result = null;
- int size = table.size();
- if (index < size) {
- Iterator values = iterator();
- for (int i = 0; i <= index; i++) {
- result = values.next();
- }
- }
- return (CMNode) result;
- }
-
- public Iterator iterator() {
- return table.values().iterator();
- }
-
- /**
- * getNamedItem method
- * @return
- * @param name java.lang.String
- * @param aNode CMNode
- */
- public void setNamedItem(String name, CMNode aNode) {
- if (name != null && aNode != null)
- table.put(name, aNode);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMNodeListImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMNodeListImpl.java
deleted file mode 100644
index 93b352013e..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMNodeListImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.common.contentmodel.CMNodeList;
-
-public class CMNodeListImpl implements CMNodeList {
- static CMNodeListImpl EMPTY_NODE_LIST = new CMNodeListImpl(Collections.EMPTY_LIST);
- protected List list;
-
- public CMNodeListImpl() {
- this(new ArrayList());
- }
-
- public CMNodeListImpl(List list) {
- this.list = list;
- }
-
- public void appendItem(CMNode node) {
- list.add(node);
- }
-
- /**
- * getLength method
- * @return int
- */
- public int getLength() {
- return list.size();
- }
-
- public List getList() {
- return list;
- }
-
- /**
- * item method
- * @return CMNode
- * @param index int
- */
- public CMNode item(int index) {
- return (CMNode) list.get(index);
- }
-
- public Iterator iterator() {
- return list.iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
deleted file mode 100644
index 460d0923af..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
+++ /dev/null
@@ -1,919 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Stack;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.jst.jsp.core.JSP12Namespace;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP11TLDNames;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP12TLDNames;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP20TLDNames;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDDocument;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDElementDeclaration;
-import org.eclipse.jst.jsp.core.contentmodel.tld.URIResolverProvider;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.contentmodel.ITaglibRecord;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibIndex;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.common.uriresolver.URIResolverPlugin;
-import org.eclipse.wst.sse.core.parser.BlockMarker;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionHandler;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionHandlerExtension;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-import org.eclipse.wst.sse.core.util.Assert;
-import org.eclipse.wst.sse.core.util.Debug;
-import org.eclipse.wst.sse.core.util.StringUtils;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-import org.eclipse.wst.xml.uriresolver.util.URIHelper;
-
-public class TLDCMDocumentManager {
-
- protected class DirectiveStructuredDocumentRegionHandler implements StructuredDocumentRegionHandler, StructuredDocumentRegionHandlerExtension {
-
- /**
- * Adds a block tagname (fully namespace qualified) into the list of
- * block tag names for the parser. The marker
- * IStructuredDocumentRegion along with position cues during reparses
- * allow the JSPSourceParser to enable/ignore the tags as blocks.
- */
- protected void addBlockTag(String tagnameNS, IStructuredDocumentRegion marker) {
- if (getParser() == null)
- return;
- if (getParser().getBlockMarker(tagnameNS) == null) {
- getParser().addBlockMarker(new BlockMarker(tagnameNS, marker, XMLRegionContext.BLOCK_TEXT, true, false));
- if (_debug) {
- System.out.println("TLDCMDocumentManager added block marker: " + tagnameNS + "@" + marker.getStartOffset()); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- }
-
- /**
- * Enables a TLD owning the given prefix loaded from the given URI at
- * the anchorStructuredDocumentRegion. The list of
- * additionalCMDocuments will claim to not know any of its tags at
- * positions earlier than that IStructuredDocumentRegion's position.
- *
- * For taglib directives, the taglib is the anchor while taglibs
- * registered through include directives use the parent document's
- * include directive as their anchor.
- *
- * @param prefix
- * @param uri
- * @param anchorStructuredDocumentRegion
- */
- protected void enableTaglibFromURI(String prefix, String uri, IStructuredDocumentRegion anchorStructuredDocumentRegion) {
- if (prefix == null || uri == null || bannedPrefixes.contains(prefix))
- return;
- // Try to load the CMDocument for this URI
- CMDocument tld = getCMDocument(uri);
- if (tld == null || !(tld instanceof TLDDocument)) {
- if (_debug) {
- System.out.println("TLDCMDocumentManager failed to create a CMDocument for " + uri); //$NON-NLS-1$
- }
- return;
- }
- CMNamedNodeMap elements = tld.getElements();
- // Go through the CMDocument for any tags that must be marked as
- // block tags
- // starting at the anchoring IStructuredDocumentRegion. As the
- // document is edited and the
- // IStructuredDocumentRegion moved around, the block tag
- // enablement will automatically follow
- // it.
- for (int i = 0; i < elements.getLength(); i++) {
- TLDElementDeclaration ed = (TLDElementDeclaration) elements.item(i);
- if (ed.getBodycontent() == JSP12TLDNames.CONTENT_TAGDEPENDENT)
- addBlockTag(prefix + ":" + ed.getNodeName(), anchorStructuredDocumentRegion); //$NON-NLS-1$
- }
- // Since modifications to StructuredDocumentRegions adjacent to a
- // taglib directive can cause
- // that IStructuredDocumentRegion to be reported, filter out any
- // duplicated URIs. When the
- // taglib is actually modified, a full rebuild will occur and no
- // duplicates
- // will/should be found.
- List trackers = getTaglibTrackers();
- for (int i = 0; i < trackers.size(); i++) {
- TaglibTracker tracker = (TaglibTracker) trackers.get(i);
- if (tracker.getPrefix().equals(prefix) && tracker.getURI().equals(uri)) {
- return;
- }
- }
- if (_debug) {
- System.out.println("TLDCMDocumentManager registered a tracker for " + uri + " with prefix " + prefix); //$NON-NLS-2$//$NON-NLS-1$
- }
- getTaglibTrackers().add(new TaglibTracker(uri, prefix, tld, anchorStructuredDocumentRegion));
- }
-
- /**
- * Enables a TLD owning the given prefix loaded from the given URI at
- * the anchorStructuredDocumentRegion. The list of
- * additionalCMDocuments will claim to not know any of its tags at
- * positions earlier than that IStructuredDocumentRegion's position.
- *
- * For taglib directives, the taglib is the anchor while taglibs
- * registered through include directives use the parent document's
- * include directive as their anchor.
- *
- * @param prefix
- * @param uri
- * @param taglibStructuredDocumentRegion
- */
- protected void enableTagsInDir(String prefix, String tagdir, IStructuredDocumentRegion taglibStructuredDocumentRegion) {
- if (prefix == null || tagdir == null || bannedPrefixes.contains(prefix))
- return;
- if (_debug) {
- System.out.println("TLDCMDocumentManager enabling tags from directory" + tagdir + " for prefix " + prefix); //$NON-NLS-2$//$NON-NLS-1$
- }
- // Try to load the CMDocument for this URI
- CMDocument tld = getImplicitCMDocument(tagdir);
- if (tld == null || !(tld instanceof TLDDocument))
- return;
- CMNamedNodeMap elements = tld.getElements();
- // Go through the CMDocument for any tags that must be marked as
- // block tags
- // starting at the anchoring IStructuredDocumentRegion. As the
- // document is edited and the
- // IStructuredDocumentRegion moved around, the block tag
- // enablement will automatically follow
- // it.
- for (int i = 0; i < elements.getLength(); i++) {
- TLDElementDeclaration ed = (TLDElementDeclaration) elements.item(i);
- if (ed.getBodycontent() == JSP12TLDNames.CONTENT_TAGDEPENDENT)
- addBlockTag(prefix + ":" + ed.getNodeName(), taglibStructuredDocumentRegion); //$NON-NLS-1$
- }
- // Since modifications to StructuredDocumentRegions adjacent to a
- // taglib directive can cause
- // that IStructuredDocumentRegion to be reported, filter out any
- // duplicated URIs. When the
- // taglib is actually modified, a full rebuild will occur and no
- // duplicates
- // will/should be found.
- List trackers = getTaglibTrackers();
- for (int i = 0; i < trackers.size(); i++) {
- TaglibTracker tracker = (TaglibTracker) trackers.get(i);
- if (tracker.getPrefix().equals(prefix) && tracker.getURI().equals(tagdir)) {
- return;
- }
- }
- if (_debug) {
- System.out.println("TLDCMDocumentManager registered a tracker for directory" + tagdir + " with prefix " + prefix); //$NON-NLS-2$//$NON-NLS-1$
- }
- getTaglibTrackers().add(new TaglibTracker(tagdir, prefix, tld, taglibStructuredDocumentRegion));
- }
-
- public void nodeParsed(IStructuredDocumentRegion aCoreStructuredDocumentRegion) {
- // could test > 1, but since we only care if there are 8 (<%@,
- // taglib, uri, =, where, prefix, =, what) [or 4 for includes]
- if (aCoreStructuredDocumentRegion.getNumberOfRegions() > 4 && aCoreStructuredDocumentRegion.getRegions().get(1).getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME) {
- ITextRegion name = aCoreStructuredDocumentRegion.getRegions().get(1);
- try {
- if (getParser() == null) {
- Logger.log(Logger.WARNING, "Warning: parser text was requested by " + getClass().getName() + " but none was available; taglib support disabled"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- boolean taglibDetected = false;
- boolean taglibDirectiveDetected = false;
- boolean includeDetected = false;
- boolean includeDirectiveDetected = false;
- int startOffset = aCoreStructuredDocumentRegion.getStartOffset(name);
- int textLength = name.getTextLength();
-
- if (getParser() != null) {
- taglibDetected = getParser().regionMatches(startOffset, textLength, JSP12TLDNames.TAGLIB);
- taglibDirectiveDetected = getParser().regionMatches(startOffset, textLength, JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
- includeDetected = getParser().regionMatches(startOffset, textLength, JSP12TLDNames.INCLUDE);
- includeDirectiveDetected = getParser().regionMatches(startOffset, textLength, JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
- }
- else {
- // old fashioned way
- String directiveName = getParser().getText(startOffset, textLength);
- taglibDetected = directiveName.equals(JSP12TLDNames.TAGLIB);
- taglibDirectiveDetected = directiveName.equals(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
- includeDetected = directiveName.equals(JSP12TLDNames.INCLUDE);
- includeDirectiveDetected = directiveName.equals(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
- }
- if (taglibDetected || taglibDirectiveDetected) {
- processTaglib(aCoreStructuredDocumentRegion);
- }
- else if (includeDetected || includeDirectiveDetected) {
- processInclude(aCoreStructuredDocumentRegion);
- }
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- // do nothing
- }
- }
- // could test > 1, but since we only care if there are 5 (<,
- // jsp:root, xmlns:prefix, =, where)
- else if (aCoreStructuredDocumentRegion.getNumberOfRegions() > 4 && aCoreStructuredDocumentRegion.getRegions().get(1).getType() == XMLJSPRegionContexts.JSP_ROOT_TAG_NAME) {
- if (getParser() == null) {
- Logger.log(Logger.WARNING, "Warning: parser text was requested by " + getClass().getName() + " but none was available; taglib support disabled"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- processJSPRoot(aCoreStructuredDocumentRegion);
- }
- }
- }
-
- protected void processInclude(IStructuredDocumentRegion aCoreStructuredDocumentRegion) {
- processInclude(aCoreStructuredDocumentRegion, aCoreStructuredDocumentRegion, getParser());
- }
-
- /**
- * Process an include directive found by the textSource parser and
- * anchor any taglibs found within at the
- * anchorStructuredDocumentRegion. Includes use the including file as
- * the point of reference, not necessarily the "top" file.
- */
- protected void processInclude(IStructuredDocumentRegion includeStructuredDocumentRegion, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
- ITextRegionList regions = includeStructuredDocumentRegion.getRegions();
- String includedFile = null;
- boolean isFilename = false;
- try {
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- if (textSource.getText(includeStructuredDocumentRegion.getStartOffset(region), region.getTextLength()).equals(JSP12TLDNames.FILE)) {
- isFilename = true;
- }
- else {
- isFilename = false;
- }
- }
- else if (isFilename && region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- includedFile = textSource.getText(includeStructuredDocumentRegion.getStartOffset(region), region.getTextLength());
- isFilename = false;
- }
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- // nothing to be done
- includedFile = null;
- }
- if (includedFile != null) {
- IPath root = TaglibIndex.getContextRoot(getCurrentBaseLocation());
- IPath fileLocation = new Path(URIHelper.normalize(StringUtils.strip(includedFile).trim(), getCurrentBaseLocation().toString(), root.toString()));
- // check for "loops"
- if (!getIncludes().contains(fileLocation) && fileLocation != null && !fileLocation.equals(getCurrentBaseLocation())) {
- getIncludes().push(fileLocation);
- if (getParser() != null)
- new IncludeHelper(anchorStructuredDocumentRegion, getParser()).parse(fileLocation.toString());
- else
- Logger.log(Logger.WARNING, "Warning: parser text was requested by " + getClass().getName() + " but none was available; taglib support disabled"); //$NON-NLS-1$ //$NON-NLS-2$
- getIncludes().pop();
- }
- else {
- if (Debug.debugTokenizer)
- System.out.println("LOOP IN @INCLUDES FOUND: " + fileLocation); //$NON-NLS-1$
- }
- }
- }
-
- // Pulls the URI and prefix from the given jsp:root
- // IStructuredDocumentRegion and
- // makes sure the tags are known.
- protected void processJSPRoot(IStructuredDocumentRegion jspRootStructuredDocumentRegion) {
- processJSPRoot(jspRootStructuredDocumentRegion, jspRootStructuredDocumentRegion, getParser());
- }
-
- protected void processJSPRoot(IStructuredDocumentRegion taglibStructuredDocumentRegion, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
- ITextRegionList regions = taglibStructuredDocumentRegion.getRegions();
- String uri = null;
- String prefix = null;
- boolean taglib = false;
- try {
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- String name = textSource.getText(taglibStructuredDocumentRegion.getStartOffset(region), region.getTextLength());
- if (name.startsWith(XMLNS)) { //$NON-NLS-1$
- prefix = name.substring(XMLNS_LENGTH);
- if (!bannedPrefixes.contains(prefix))
- taglib = true;
- }
- else {
- prefix = null;
- taglib = false;
- }
- }
- else if (taglib && region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- uri = textSource.getText(taglibStructuredDocumentRegion.getStartOffset(region), region.getTextLength());
- if (uri != null && prefix != null && (StringUtils.strip(uri).length() > 0) && (StringUtils.strip(prefix).length() > 0)) {
- if (anchorStructuredDocumentRegion == null)
- enableTaglibFromURI(StringUtils.strip(prefix), StringUtils.strip(uri), taglibStructuredDocumentRegion);
- else
- enableTaglibFromURI(StringUtils.strip(prefix), StringUtils.strip(uri), anchorStructuredDocumentRegion);
- uri = null;
- prefix = null;
- }
- }
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- // nothing to be done
- uri = null;
- prefix = null;
- }
- }
-
- protected void processTaglib(IStructuredDocumentRegion taglibStructuredDocumentRegion) {
- processTaglib(taglibStructuredDocumentRegion, taglibStructuredDocumentRegion, getParser());
- }
-
- /**
- * Pulls the URI and prefix from the given taglib directive
- * IStructuredDocumentRegion and makes sure the tags are known.
- */
- protected void processTaglib(IStructuredDocumentRegion taglibStructuredDocumentRegion, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
- ITextRegionList regions = taglibStructuredDocumentRegion.getRegions();
- String uri = null;
- String prefix = null;
- String tagdir = null;
- String attrName = null;
- try {
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- // remember attribute name
- int startOffset = taglibStructuredDocumentRegion.getStartOffset(region);
- int textLength = region.getTextLength();
- if (region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- // String name = textSource.getText(startOffset,
- // textLength);
- if (textSource.regionMatches(startOffset, textLength, JSP11TLDNames.PREFIX)) {
- attrName = JSP11TLDNames.PREFIX;
- }
- else if (textSource.regionMatches(startOffset, textLength, JSP12TLDNames.URI)) {
- attrName = JSP11TLDNames.URI;
- }
- else if (textSource.regionMatches(startOffset, textLength, JSP20TLDNames.TAGDIR)) {
- attrName = JSP20TLDNames.TAGDIR;
- }
- else {
- attrName = null;
- }
- }
- // process value
- else if (region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- if (JSP11TLDNames.PREFIX.equals(attrName))
- prefix = textSource.getText(startOffset, textLength);
- else if (JSP11TLDNames.URI.equals(attrName))
- uri = textSource.getText(startOffset, textLength);
- else if (JSP20TLDNames.TAGDIR.equals(attrName))
- tagdir = textSource.getText(startOffset, textLength);
- }
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- // nothing to be done
- uri = null;
- prefix = null;
- }
- if (uri != null && prefix != null && (StringUtils.strip(uri).length() > 0) && (StringUtils.strip(prefix).length() > 0)) {
- if (anchorStructuredDocumentRegion == null)
- enableTaglibFromURI(StringUtils.strip(prefix), StringUtils.strip(uri), taglibStructuredDocumentRegion);
- else
- enableTaglibFromURI(StringUtils.strip(prefix), StringUtils.strip(uri), anchorStructuredDocumentRegion);
- }
- else if (tagdir != null && prefix != null && (StringUtils.strip(tagdir).length() > 0) && (StringUtils.strip(prefix).length() > 0)) {
- if (anchorStructuredDocumentRegion == null)
- enableTagsInDir(StringUtils.strip(prefix), StringUtils.strip(tagdir), taglibStructuredDocumentRegion);
- else
- enableTagsInDir(StringUtils.strip(prefix), StringUtils.strip(tagdir), anchorStructuredDocumentRegion);
- }
- }
-
- private void resetBlockTags() {
- if (getParser() == null)
- return;
- Iterator names = getParser().getBlockMarkers().iterator();
- while (names.hasNext()) {
- BlockMarker marker = (BlockMarker) names.next();
- if (!marker.isGlobal() && marker.getContext() == XMLRegionContext.BLOCK_TEXT) {
- if (_debug) {
- System.out.println("TLDCMDocumentManager removing block tag named: " + marker.getTagName()); //$NON-NLS-1$
- }
- names.remove();
- }
- }
- }
-
- public void resetNodes() {
- if (Debug.debugTaglibs)
- System.out.println(getClass().getName() + ": resetting"); //$NON-NLS-1$
- getIncludes().clear();
- resetBlockTags();
- resetTaglibTrackers();
- }
-
- public void setStructuredDocument(IStructuredDocument newDocument) {
- Assert.isTrue(newDocument != null, "null document");
- Assert.isTrue(newDocument.getParser() != null, "null document parser");
- Assert.isTrue(newDocument.getParser() instanceof JSPSourceParser, "can only listen to document with a JSPSourceParser");
- getSourceParser().removeStructuredDocumentRegionHandler(this);
- setSourceParser((JSPSourceParser) newDocument.getParser());
- getSourceParser().addStructuredDocumentRegionHandler(this);
- }
- }
-
- protected class IncludeHelper extends DirectiveStructuredDocumentRegionHandler {
- protected IStructuredDocumentRegion fAnchor = null;
- protected JSPSourceParser fLocalParser = null;
- protected JSPSourceParser fParentParser = null;
-
- public IncludeHelper(IStructuredDocumentRegion anchor, JSPSourceParser rootParser) {
- super();
- fAnchor = anchor;
- fParentParser = rootParser;
- }
-
- private String detectCharset(IFile file) {
- if (file.getType() == IResource.FILE && file.isAccessible()) {
- IContentDescription d = null;
- try {
- // optimized description lookup, might not succeed
- d = file.getContentDescription();
- if (d != null)
- return d.getCharset();
- }
- catch (CoreException e) {
- // should not be possible given the accessible and file
- // type
- // check above
- }
- InputStream contents = null;
- try {
- contents = file.getContents();
- IContentDescription description = Platform.getContentTypeManager().getDescriptionFor(contents, file.getName(), new QualifiedName[]{IContentDescription.CHARSET});
- if (description != null) {
- return description.getCharset();
- }
- }
- catch (IOException e) {
- // will try to cleanup in finally
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- finally {
- if (contents != null) {
- try {
- contents.close();
- }
- catch (Exception e) {
- // not sure how to recover at this point
- }
- }
- }
- }
- return ResourcesPlugin.getEncoding();
- }
-
- protected String getContents(String fileName) {
- StringBuffer s = new StringBuffer();
- IFile iFile = FileBuffers.getWorkspaceFileAtLocation(new Path(fileName));
- if (iFile != null && iFile.exists()) {
- String charset = detectCharset(iFile);
- InputStream contents = null;
- try {
- contents = iFile.getContents();
- Reader reader = new InputStreamReader(contents, charset);
- char[] readBuffer = new char[2048];
- int n = reader.read(readBuffer);
- while (n > 0) {
- s.append(readBuffer, 0, n);
- n = reader.read(readBuffer);
- }
- }
- catch (Exception e) {
- if (Debug.debugStructuredDocument)
- Logger.log(Logger.WARNING, "An exception occured while scanning " + fileName, e); //$NON-NLS-1$
- }
- finally {
- try {
- if (contents != null) {
- contents.close();
- }
- }
- catch (Exception e) {
- // nothing to do
- }
- }
- }
- else {
- int c = 0;
- int length = 0;
- int count = 0;
- File file = null;
- FileInputStream fis = null;
- try {
- file = new File(fileName);
- length = (int) file.length();
- fis = new FileInputStream(file);
- while (((c = fis.read()) >= 0) && (count < length)) {
- count++;
- s.append((char) c);
- }
- }
- catch (FileNotFoundException e) {
- if (Debug.debugStructuredDocument)
- System.out.println("File not found : \"" + fileName + "\""); //$NON-NLS-2$//$NON-NLS-1$
- }
- catch (ArrayIndexOutOfBoundsException e) {
- if (Debug.debugStructuredDocument)
- System.out.println("Usage wrong: specify inputfile"); //$NON-NLS-1$
- //$NON-NLS-1$
- }
- catch (IOException e) {
- if (Debug.debugStructuredDocument)
- System.out.println("An I/O error occured while scanning :"); //$NON-NLS-1$
- //$NON-NLS-1$
- }
- catch (Exception e) {
- if (Debug.debugStructuredDocument)
- e.printStackTrace();
- }
- finally {
- try {
- if (fis != null) {
- fis.close();
- }
- }
- catch (Exception e) {
- // nothing to do
- }
- }
- }
- return s.toString();
- }
-
- public void nodeParsed(IStructuredDocumentRegion aCoreStructuredDocumentRegion) {
- // could test > 1, but since we only care if there are 8 (<%@,
- // taglib, uri, =, where, prefix, =, what)
- if (aCoreStructuredDocumentRegion.getNumberOfRegions() > 1 && aCoreStructuredDocumentRegion.getRegions().get(1).getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME) {
- ITextRegion name = aCoreStructuredDocumentRegion.getRegions().get(1);
- try {
- String directiveName = fLocalParser.getText(aCoreStructuredDocumentRegion.getStartOffset(name), name.getTextLength());
- if (directiveName.equals(JSP12TLDNames.TAGLIB) || directiveName.equals(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB)) {
- processTaglib(aCoreStructuredDocumentRegion, fAnchor, fLocalParser);
- }
- if (directiveName.equals(JSP12TLDNames.INCLUDE) || directiveName.equals(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE)) {
- processInclude(aCoreStructuredDocumentRegion, fAnchor, fLocalParser);
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- // do nothing
- }
- }
- // could test > 1, but since we only care if there are 5 (<,
- // jsp:root, xmlns:prefix, =, where)
- else if (aCoreStructuredDocumentRegion.getNumberOfRegions() > 4 && aCoreStructuredDocumentRegion.getRegions().get(1).getType() == XMLJSPRegionContexts.JSP_ROOT_TAG_NAME) {
- processJSPRoot(aCoreStructuredDocumentRegion, fAnchor, fLocalParser);
- }
- }
-
- public void parse(String filename) {
- JSPSourceParser p = new JSPSourceParser();
- fLocalParser = p;
- List blockTags = fParentParser.getBlockMarkers();
- String includedFilename = filename;
- File baseFile = FileBuffers.getSystemFileAtLocation(new Path(includedFilename));
- try {
- if (baseFile != null)
- includedFilename = baseFile.getCanonicalPath();
- }
- catch (IOException e) {
- }
- String s = getContents(includedFilename);
- fLocalParser.addStructuredDocumentRegionHandler(this);
- fLocalParser.reset(s);
- for (int i = 0; i < blockTags.size(); i++) {
- BlockMarker marker = (BlockMarker) blockTags.get(i);
- fLocalParser.addBlockMarker(new BlockMarker(marker.getTagName(), null, marker.getContext(), marker.isCaseSensitive()));
- }
- // force parse
- fLocalParser.getDocumentRegions();
- fLocalParser = null;
- }
-
- public void resetNodes() {
- }
-
- }
-
- static final boolean _debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/tldcmdocument/manager")); //$NON-NLS-1$ //$NON-NLS-2$
-
- // will hold the prefixes banned by the specification; taglibs may not use
- // them
- protected static List bannedPrefixes = null;
- static final String XMLNS = "xmlns:"; //$NON-NLS-1$
- static final int XMLNS_LENGTH = XMLNS.length();
-
- static {
- bannedPrefixes = new ArrayList(7);
- bannedPrefixes.add("jsp"); //$NON-NLS-1$
- bannedPrefixes.add("jspx"); //$NON-NLS-1$
- bannedPrefixes.add("java"); //$NON-NLS-1$
- bannedPrefixes.add("javax"); //$NON-NLS-1$
- bannedPrefixes.add("servlet"); //$NON-NLS-1$
- bannedPrefixes.add("sun"); //$NON-NLS-1$
- bannedPrefixes.add("sunw"); //$NON-NLS-1$
- }
-
- private CMDocumentFactoryTLD fCMDocumentBuilder = null;
- private DirectiveStructuredDocumentRegionHandler fDirectiveHandler = null;
- private Hashtable fDocuments = null;
- private Stack fIncludes = null;
-
- private JSPSourceParser fParser = null;
-
- // trivial hand edit to remove unused variable private URIResolverProvider
- // fResolverProvider = null;
-
- private List fTaglibTrackers = null;
-
- public TLDCMDocumentManager() {
- super();
- }
-
- public void clearCache() {
- if (_debug) {
- System.out.println("TLDCMDocumentManager cleared its CMDocument cache"); //$NON-NLS-1$
- }
- getDocuments().clear();
- }
-
- /**
- * Return the CMDocument at the uri (cached)
- */
- protected CMDocument getCMDocument(String uri) {
- if (uri == null || uri.length() == 0)
- return null;
- String reference = uri;
- /**
- * JSP 1.2 Specification, section 5.2.2 jsp-1_2-fcs-spec.pdf, page 87
- */
- String URNprefix = "urn:jsptld:"; //$NON-NLS-1$
- if (reference.startsWith(URNprefix)) {
- /**
- * @see section 7.3.2
- */
- if (reference.length() > URNprefix.length())
- reference = reference.substring(11);
- }
- else {
- /**
- * @see section 7.3.6
- */
- }
- CMDocument doc = (CMDocument) getDocuments().get(reference);
- if (doc == null) {
- doc = loadTaglib(reference);
- if (doc != null)
- getDocuments().put(reference, doc);
- }
- return doc;
- }
-
- /**
- * Gets the cMDocumentBuilder.
- *
- * @return Returns a CMDocumentFactoryTLD, since it has more builder
- * methods
- */
- protected CMDocumentFactoryTLD getCMDocumentBuilder() {
- if (fCMDocumentBuilder == null)
- fCMDocumentBuilder = new CMDocumentFactoryTLD();
- return fCMDocumentBuilder;
- }
-
- public List getCMDocumentTrackers(int offset) {
- List validDocs = new ArrayList();
- Iterator alldocs = getTaglibTrackers().iterator();
- while (alldocs.hasNext()) {
- TaglibTracker aTracker = (TaglibTracker) alldocs.next();
- if (aTracker.getStructuredDocumentRegion().getStartOffset() < offset || offset < 0) {
- validDocs.add(aTracker);
- }
- }
- return validDocs;
- }
-
- public List getCMDocumentTrackers(String prefix, int offset) {
- List validDocs = new ArrayList();
- Iterator alldocs = getTaglibTrackers().iterator();
- while (alldocs.hasNext()) {
- TaglibTracker aTracker = (TaglibTracker) alldocs.next();
- if ((aTracker.getStructuredDocumentRegion().getStartOffset() < offset || offset < 0) && aTracker.getPrefix().equals(prefix)) {
- validDocs.add(aTracker);
- }
- }
- return validDocs;
- }
-
- /**
- *
- * @return java.lang.String
- */
- IPath getCurrentBaseLocation() {
- IPath baseLocation = null;
- if (!getIncludes().isEmpty()) {
- baseLocation = (IPath) getIncludes().peek();
- }
- else {
- IPath path = TaglibController.getFileBuffer(this).getLocation();
- if (path.toFile().exists())
- baseLocation = path;
- else
- baseLocation = ResourcesPlugin.getWorkspace().getRoot().getFile(path).getLocation();
- }
- return baseLocation;
- }
-
- protected DirectiveStructuredDocumentRegionHandler getDirectiveStructuredDocumentRegionHandler() {
- if (fDirectiveHandler == null)
- fDirectiveHandler = new DirectiveStructuredDocumentRegionHandler();
- return fDirectiveHandler;
- }
-
- /**
- * Gets the documents.
- *
- * @return Returns a Hashtable
- */
- public Hashtable getDocuments() {
- if (fDocuments == null)
- fDocuments = new Hashtable();
- return fDocuments;
- }
-
- /**
- * Return the CMDocument at the tagdir (cached)
- */
- protected CMDocument getImplicitCMDocument(String tagdir) {
- if (tagdir == null || tagdir.length() == 0)
- return null;
- String reference = tagdir;
- /**
- * JSP 1.2 Specification, section 5.2.2 jsp-1_2-fcs-spec.pdf, page 87
- */
- String URNprefix = "urn:jsptld:"; //$NON-NLS-1$
- if (reference.startsWith(URNprefix)) {
- /**
- * @see section 7.3.2
- */
- if (reference.length() > URNprefix.length())
- reference = reference.substring(11);
- }
- else {
- /**
- * @see section 7.3.6
- */
- }
- CMDocument doc = (CMDocument) getDocuments().get(reference);
- if (doc == null) {
- doc = loadTagDir(reference);
- if (doc != null)
- getDocuments().put(reference, doc);
- }
- return doc;
- }
-
- /**
- * Gets the includes.
- *
- * @return Returns a Stack
- */
- protected Stack getIncludes() {
- if (fIncludes == null)
- fIncludes = new Stack();
- return fIncludes;
- }
-
- JSPSourceParser getParser() {
- return fParser;
- }
-
- /**
- * @deprecated
- */
- public URIResolverProvider getResolverProvider() {
- return null;
- }
-
- public JSPSourceParser getSourceParser() {
- return fParser;
- }
-
- public StructuredDocumentRegionHandler getStructuredDocumentRegionHandler() {
- return getDirectiveStructuredDocumentRegionHandler();
- }
-
- /**
- *
- * @return java.util.List
- */
- public List getTaglibTrackers() {
- if (fTaglibTrackers == null)
- fTaglibTrackers = new ArrayList();
- return fTaglibTrackers;
- }
-
- /**
- * Loads the tags from the specified URI. It must point to a URL of valid
- * tag files to work.
- */
- protected CMDocument loadTagDir(String uri) {
- ITaglibRecord reference = TaglibIndex.resolve(getCurrentBaseLocation().toString(), uri, false);
- if (reference != null) {
- CMDocument document = getCMDocumentBuilder().createCMDocument(reference);
- if (document != null) {
- return document;
- }
- }
- // JSP2_TODO: implement for JSP 2.0
- String location = URIResolverPlugin.createResolver().resolve(getCurrentBaseLocation().toString(), null, uri);
- if (location == null)
- return null;
- if (_debug) {
- System.out.println("Loading tags from dir" + uri + " at " + location); //$NON-NLS-2$//$NON-NLS-1$
- }
- return getCMDocumentBuilder().createCMDocument(location);
- }
-
- /**
- * Loads the taglib from the specified URI. It must point to a valid
- * taglib descriptor or valid JAR file to work.
- */
- protected CMDocument loadTaglib(String uri) {
- CMDocument document = null;
- ITaglibRecord reference = TaglibIndex.resolve(TaglibController.getFileBuffer(this).getLocation().toString(), uri, false);
- if (reference != null) {
- document = getCMDocumentBuilder().createCMDocument(reference);
- }
- else {
- String location = URIResolverPlugin.createResolver().resolve(getCurrentBaseLocation().toString(), null, uri);
- if (location != null) {
- if (_debug) {
- System.out.println("Loading tags from " + uri + " at " + location); //$NON-NLS-2$//$NON-NLS-1$
- }
- document = getCMDocumentBuilder().createCMDocument(location);
- }
- }
- return document;
- }
-
- protected void resetTaglibTrackers() {
- if (_debug) {
- System.out.println("TLDCMDocumentManager cleared its taglib trackers\n"); //$NON-NLS-1$
- }
- getTaglibTrackers().clear();
- }
-
- public void setSourceParser(JSPSourceParser parser) {
- if (fParser != null)
- fParser.removeStructuredDocumentRegionHandler(getStructuredDocumentRegionHandler());
- fParser = parser;
- if (fParser != null)
- fParser.addStructuredDocumentRegionHandler(getStructuredDocumentRegionHandler());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDFunctionImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDFunctionImpl.java
deleted file mode 100644
index 9f420153a8..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDFunctionImpl.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDFunction;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-
-public class TLDFunctionImpl implements TLDFunction {
- private String fClassName = null;
- private String fDescription = null;
- private String fDisplayName = null;
- private String fExample = null;
- private List fExtensions = new ArrayList(0);
- private String fIcon = null;
- private String fName = null;
-
- private CMDocument fOwnerDocument = null;
- private String fSignature = null;
-
- public TLDFunctionImpl(CMDocument owner) {
- super();
- fOwnerDocument = owner;
- }
-
- /**
- * @return Returns the className.
- */
- public String getClassName() {
- return fClassName;
- }
- /**
- * @return Returns the description.
- */
- public String getDescription() {
- return fDescription;
- }
-
- /**
- * @return Returns the displayName.
- */
- public String getDisplayName() {
- return fDisplayName;
- }
-
- /**
- * @return Returns the example.
- */
- public String getExample() {
- return fExample;
- }
-
- /**
- * @return Returns the extensions.
- */
- public List getExtensions() {
- return fExtensions;
- }
-
- /**
- * @return Returns the icon.
- */
- public String getIcon() {
- return fIcon;
- }
-
- /**
- * @return Returns the name.
- */
- public String getName() {
- return fName;
- }
-
- /**
- * @return Returns the ownerDocument.
- */
- public CMDocument getOwnerDocument() {
- return fOwnerDocument;
- }
-
- /**
- * @return Returns the signature.
- */
- public String getSignature() {
- return fSignature;
- }
-
- /**
- * @param className
- * The className to set.
- */
- public void setClassName(String className) {
- fClassName = className;
- }
- /**
- * @param description The description to set.
- */
- public void setDescription(String description) {
- fDescription = description;
- }
-
- /**
- * @param displayName
- * The displayName to set.
- */
- public void setDisplayName(String displayName) {
- fDisplayName = displayName;
- }
-
- /**
- * @param example
- * The example to set.
- */
- public void setExample(String example) {
- fExample = example;
- }
-
- /**
- * @param icon
- * The icon to set.
- */
- public void setIcon(String icon) {
- fIcon = icon;
- }
-
- /**
- * @param name
- * The name to set.
- */
- public void setName(String name) {
- fName = name;
- }
-
- /**
- * @param signature
- * The signature to set.
- */
- public void setSignature(String signature) {
- fSignature = signature;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDInitParamImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDInitParamImpl.java
deleted file mode 100644
index 6bc9fc13c9..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDInitParamImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Sep 9, 2003
- *
- * To change the template for this generated file go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDInitParam;
-import org.eclipse.wst.sse.core.util.StringUtils;
-
-
-public class TLDInitParamImpl implements TLDInitParam {
- private String description;
- private String name;
- private String value;
-
- public TLDInitParamImpl() {
- super();
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getName() {
- return name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(super.toString());
- buffer.append("\n\t name:" + StringUtils.escape(getName())); //$NON-NLS-1$
- buffer.append("\n\t description:" + StringUtils.escape(getDescription())); //$NON-NLS-1$
- buffer.append("\n\t value:" + StringUtils.escape(getValue())); //$NON-NLS-1$
- return buffer.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDListenerImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDListenerImpl.java
deleted file mode 100644
index 0fea952eb4..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDListenerImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Sep 9, 2003
- *
- * To change the template for this generated file go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDListener;
-import org.eclipse.wst.sse.core.util.StringUtils;
-
-
-public class TLDListenerImpl implements TLDListener {
- protected String listenerClass;
-
- public String getListenerClass() {
- return listenerClass;
- }
-
- public void setListenerClass(String className) {
- listenerClass = className;
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(super.toString());
- buffer.append("\n\t listener class:" + StringUtils.escape(getListenerClass())); //$NON-NLS-1$
- return buffer.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDValidatorImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDValidatorImpl.java
deleted file mode 100644
index 7fc7f573b4..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDValidatorImpl.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Sep 9, 2003
- *
- * To change the template for this generated file go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDValidator;
-import org.eclipse.wst.sse.core.util.StringUtils;
-
-
-public class TLDValidatorImpl implements TLDValidator {
- protected List initParams;
- protected String validatorClass;
-
- public List getInitParams() {
- if (initParams == null)
- initParams = new ArrayList();
- return initParams;
- }
-
- public String getValidatorClass() {
- return validatorClass;
- }
-
- public void setInitParams(List initParams) {
- this.initParams = initParams;
- }
-
- public void setValidatorClass(String validatorClass) {
- this.validatorClass = validatorClass;
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(super.toString());
- buffer.append("\n\t validator class:" + StringUtils.escape(getValidatorClass())); //$NON-NLS-1$
- buffer.append("\n\t init-parms:"); //$NON-NLS-1$
- for (int i = 0; i < getInitParams().size(); i++) {
- buffer.append("\n" + StringUtils.replace(getInitParams().get(i).toString(), "\n", "\n\t\t")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- return buffer.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDVariableImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDVariableImpl.java
deleted file mode 100644
index 8b75897773..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDVariableImpl.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP12TLDNames;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDVariable;
-import org.eclipse.wst.sse.core.util.StringUtils;
-
-
-public class TLDVariableImpl implements TLDVariable {
- // optional - defaults to true
- private boolean declare = true;
-
- private String fDescription;
- // required
- private String nameFromAttribute;
- // required
- private String nameGiven;
- // optional - defaults to NESTED
- private String scope = JSP12TLDNames.VARIABLE_SCOPE_NESTED;
- // required - defaults to a String
- private String variableClass = "java.lang.String"; //$NON-NLS-1$
-
- public boolean getDeclare() {
- return declare;
- }
-
- /**
- * @return Returns the description.
- */
- public String getDescription() {
- return fDescription;
- }
-
- public String getNameFromAttribute() {
- return nameFromAttribute;
- }
-
- public String getNameGiven() {
- return nameGiven;
- }
-
- public String getScope() {
- return scope;
- }
-
- public String getVariableClass() {
- return variableClass;
- }
-
- public void setDeclare(boolean declare) {
- this.declare = declare;
- }
-
- public void setDeclareString(String decl) {
- setDeclare(decl.equals(JSP12TLDNames.TRUE) || decl.equals(JSP12TLDNames.YES));
- }
- /**
- * @param description The description to set.
- */
- public void setDescription(String description) {
- fDescription = description;
- }
-
- public void setNameFromAttribute(String nameFromAttribute) {
- this.nameFromAttribute = nameFromAttribute;
- }
-
- public void setNameGiven(String nameGiven) {
- this.nameGiven = nameGiven;
- }
-
- public void setScope(String scope) {
- this.scope = scope;
- }
-
- public void setVariableClass(String variableClass) {
- this.variableClass = variableClass;
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(super.toString());
- buffer.append("\n\t name given:" + StringUtils.escape(getNameGiven())); //$NON-NLS-1$
- buffer.append("\n\t name from attribute:" + StringUtils.escape(getNameFromAttribute())); //$NON-NLS-1$
- // Boolean.toString(boolean) is introduced in JDK 1.4
- //buffer.append("\n\t declare:" + StringUtils.escape(Boolean.toString(getDeclare())));
- buffer.append("\n\t declare:" + StringUtils.toString(getDeclare())); //$NON-NLS-1$
- buffer.append("\n\t scope:" + StringUtils.escape(getScope())); //$NON-NLS-1$
- buffer.append("\n\t variable class:" + StringUtils.escape(getVariableClass())); //$NON-NLS-1$
- return buffer.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TaglibTracker.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TaglibTracker.java
deleted file mode 100644
index 8a9885f437..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TaglibTracker.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
-
-
-
-import org.eclipse.jst.jsp.core.internal.contentmodel.CMDocumentWrapperImpl;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.sse.core.contentmodel.CMDocumentTracker;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-
-/**
- * TaglibTracker class
- */
-public class TaglibTracker extends CMDocumentWrapperImpl implements CMDocumentTracker {
-
- private IStructuredDocumentRegion fStructuredDocumentRegion;
-
- public TaglibTracker(String newURI, String newPrefix, CMDocument tld, IStructuredDocumentRegion aStructuredDocumentRegion) {
- super(newURI, newPrefix, tld);
- fStructuredDocumentRegion = aStructuredDocumentRegion;
- }
-
- /**
- *
- * @return com.ibm.sed.structuredDocument.IStructuredDocumentRegion
- */
- public IStructuredDocumentRegion getStructuredDocumentRegion() {
- return fStructuredDocumentRegion;
- }
-
- public String toString() {
- if (getStructuredDocumentRegion() != null)
- return getPrefix() + "@" + getStructuredDocumentRegion().getStartOffset(); //$NON-NLS-1$
- return super.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/AbstractContentDescriber.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/AbstractContentDescriber.java
deleted file mode 100644
index e9eaa940b9..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/AbstractContentDescriber.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescriber;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.eclipse.wst.common.encoding.EncodingMemento;
-import org.eclipse.wst.common.encoding.IContentDescriptionExtended;
-import org.eclipse.wst.common.encoding.IResourceCharsetDetector;
-
-public abstract class AbstractContentDescriber implements ITextContentDescriber {
-
- private final static QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK, IContentDescriptionExtended.DETECTED_CHARSET, IContentDescriptionExtended.UNSUPPORTED_CHARSET, IContentDescriptionExtended.APPROPRIATE_DEFAULT};
-
- private void calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException {
- if (isRelevent(description)) {
- IResourceCharsetDetector detector = getDetector();
- detector.set(contents);
- handleCalculations(description, detector);
- }
- }
-
- /**
- * @param contents
- * @param description
- * @throws IOException
- */
- private void calculateSupportedOptions(Reader contents, IContentDescription description) throws IOException {
- if (isRelevent(description)) {
- IResourceCharsetDetector detector = getDetector();
- detector.set(contents);
- handleCalculations(description, detector);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.content.IContentDescriber#describe(java.io.InputStream,
- * org.eclipse.core.runtime.content.IContentDescription)
- */
- public int describe(InputStream contents, IContentDescription description) throws IOException {
- int result = IContentDescriber.VALID;
-
- calculateSupportedOptions(contents, description);
-
- // assume if we're called at all that we are valid (few types could be
- // disproved, maybe XML -- or, maybe if exception occurs above?)
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.content.ITextContentDescriber#describe(java.io.Reader,
- * org.eclipse.core.runtime.content.IContentDescription)
- */
- public int describe(Reader contents, IContentDescription description) throws IOException {
- int result = IContentDescriber.VALID;
-
- calculateSupportedOptions(contents, description);
-
- // assume if we're called at all that we are valid (few types could be
- // disproved, maybe XML -- or, maybe if exception occurs above?)
- return result;
- }
-
- protected abstract IResourceCharsetDetector getDetector();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.content.IContentDescriber#getSupportedOptions()
- */
- public QualifiedName[] getSupportedOptions() {
-
- return SUPPORTED_OPTIONS;
- }
-
- /**
- * @param description
- * @param detector
- * @throws IOException
- */
- protected void handleCalculations(IContentDescription description, IResourceCharsetDetector detector) throws IOException {
- // note: if we're asked for one, we set them all. I need to be sure if
- // called
- // mulitiple times (one for each, say) that we don't waste time
- // processing same
- // content again.
- EncodingMemento encodingMemento = detector.getEncodingMemento();
- // TODO: I need to verify to see if this BOM work is always done
- // by text type.
- Object detectedByteOrderMark = encodingMemento.getUnicodeBOM();
- if (detectedByteOrderMark != null) {
- Object existingByteOrderMark = description.getProperty(IContentDescription.BYTE_ORDER_MARK);
- // not sure why would ever be different, so if is different, may
- // need to "push" up into base.
- if (!detectedByteOrderMark.equals(existingByteOrderMark))
- description.setProperty(IContentDescription.BYTE_ORDER_MARK, detectedByteOrderMark);
- }
-
-
- if (!encodingMemento.isValid()) {
- // note: after setting here, its the mere presence of
- // IContentDescriptionExtended.UNSUPPORTED_CHARSET
- // in the resource's description that can be used to determine if
- // invalid
- // in those cases, the "detected" property contains an
- // "appropriate default" to use.
- description.setProperty(IContentDescriptionExtended.UNSUPPORTED_CHARSET, encodingMemento.getInvalidEncoding());
- description.setProperty(IContentDescriptionExtended.APPROPRIATE_DEFAULT, encodingMemento.getAppropriateDefault());
- }
-
- Object detectedCharset = encodingMemento.getDetectedCharsetName();
- Object javaCharset = encodingMemento.getJavaCharsetName();
-
- // we always include detected, if its different than java
- handleDetectedSpecialCase(description, detectedCharset, javaCharset);
-
- if (javaCharset != null) {
- Object existingCharset = description.getProperty(IContentDescription.CHARSET);
- if (javaCharset.equals(existingCharset)) {
- handleDetectedSpecialCase(description, detectedCharset, javaCharset);
- } else {
- // we may need to add what we found, but only need to add
- // if different from default.the
- Object defaultCharset = getDetector().getSpecDefaultEncoding();
- if (defaultCharset != null) {
- if (!defaultCharset.equals(javaCharset)) {
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- } else {
- // assuming if there is no spec default, we always need to
- // add, I'm assuming
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- }
- }
-
- // avoid adding anything if not absolutly needed, since always
- // "cached" per session
- //description.setProperty(IContentDescriptionExtended.ENCODING_MEMENTO,
- // encodingMemento);
- }
-
- private void handleDetectedSpecialCase(IContentDescription description, Object detectedCharset, Object javaCharset) {
- // since equal, we don't need to add, but if our detected version is
- // different than
- // javaCharset, then we should add it. This will happen, for example,
- // if there's
- // differences in case, or differences due to override properties
- if (detectedCharset != null) {
- // if (!detectedCharset.equals(javaCharset)) {
- // description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET,
- // detectedCharset);
- // }
-
- // Once we detected a charset, we should set the property even
- // though it's the same as javaCharset
- // because there are clients that rely on this property to
- // determine if the charset is actually detected in file or not.
- description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET, detectedCharset);
- }
- }
-
- /**
- * @param description
- * @return
- */
- private boolean isRelevent(IContentDescription description) {
- boolean result = false;
- if (description == null)
- result = false;
- else if (description.isRequested(IContentDescription.BYTE_ORDER_MARK))
- result = true;
- else if (description.isRequested(IContentDescription.CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.APPROPRIATE_DEFAULT))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.DETECTED_CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.UNSUPPORTED_CHARSET))
- result = true;
- // else if
- // (description.isRequested(IContentDescriptionExtended.ENCODING_MEMENTO))
- // result = true;
- return result;
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/AbstractResourceEncodingDetector.java
deleted file mode 100644
index bcc7dcd5bc..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/AbstractResourceEncodingDetector.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.encoding.CodedIO;
-import org.eclipse.wst.common.encoding.EncodingMemento;
-import org.eclipse.wst.common.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.common.encoding.internal.ByteReader;
-
-
-public abstract class AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
- protected EncodingMemento fEncodingMemento;
-
- protected boolean fHeaderParsed;
-
- protected Reader fReader;
-
- /**
- *
- */
- public AbstractResourceEncodingDetector() {
- super();
- }
-
- /**
- * Note: once this instance is created, trace info still needs to be
- * appended by caller, depending on the context its created.
- */
- private void createEncodingMemento(String detectedCharsetName) {
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(getAppropriateJavaCharset(detectedCharsetName));
- fEncodingMemento.setDetectedCharsetName(detectedCharsetName);
- // TODO: if detectedCharset and spec default is
- // null, need to use "work
- // bench based" defaults.
- fEncodingMemento.setAppropriateDefault(getSpecDefaultEncoding());
- }
-
- /**
- * convience method all subclasses can use (but not override)
- *
- * @param detectedCharsetName
- * @param reason
- */
- final protected void createEncodingMemento(String detectedCharsetName, String reason) {
- createEncodingMemento(detectedCharsetName);
- fEncodingMemento.addTrace(reason);
- }
-
- /**
- * convience method all subclasses can use (but not override)
- */
- final protected void ensureInputSet() {
- if (fReader == null) {
- throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
- }
- }
-
- /**
- * This method can return null, if invalid charset name (in which case
- * "appropriateDefault" should be used, if a name is really need for some
- * "save anyway" cases).
- *
- * @param detectedCharsetName
- * @return
- */
- private String getAppropriateJavaCharset(String detectedCharsetName) {
- String result = null;
- // 1. Check explicit mapping overrides from
- // property file -- its here we pick up "rules" for cases
- // that are not even in Java
- result = CodedIO.checkMappingOverrides(detectedCharsetName);
- // 2. Use the "canonical" name from JRE mappings
- // Note: see Charset JavaDoc, the name you get one
- // with can be alias,
- // the name you get back is "standard" name.
- Charset javaCharset = null;
- try {
- javaCharset = Charset.forName(detectedCharsetName);
- } catch (UnsupportedCharsetException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- } catch (IllegalCharsetNameException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- }
- // give priority to java cononical name, if present
- if (javaCharset != null) {
- result = javaCharset.name();
- // but still allow overrides
- result = CodedIO.checkMappingOverrides(result);
- }
- return result;
- }
-
- public String getEncoding() throws IOException {
- return getEncodingMemento().getDetectedCharsetName();
- }
-
- // to ensure consist overall rules used, we'll mark as
- // final,
- // and require subclasses to provide certain pieces of
- // the
- // implementation
- public EncodingMemento getEncodingMemento() throws IOException {
- ensureInputSet();
- if (!fHeaderParsed) {
- parseInput();
- // we keep track of if header's already been
- // parse, so can make
- // multiple 'get' calls, without causing
- // reparsing.
- fHeaderParsed = true;
- // Note: there is a "hidden assumption" here
- // that an empty
- // string in content should be treated same as
- // not present.
- }
- if (fEncodingMemento == null) {
- handleSpecDefault();
- }
- if (fEncodingMemento == null) {
- // safty net
- fEncodingMemento = new NullMemento();
- }
- return fEncodingMemento;
- }
-
- /**
- * This is to return a default encoding -- as specified by an industry
- * content type spec -- when not present in the stream, for example, XML
- * specifies UTF-8, JSP specifies ISO-8859-1. This method should return
- * null if there is no such "spec default".
- */
- abstract public String getSpecDefaultEncoding();
-
- public EncodingMemento getSpecDefaultEncodingMemento() {
- resetAll();
- EncodingMemento result = null;
- String enc = getSpecDefaultEncoding();
- if (enc != null) {
- createEncodingMemento(enc, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT);
- fEncodingMemento.setAppropriateDefault(enc);
- result = fEncodingMemento;
- }
- return result;
- }
-
- private void handleSpecDefault() {
- String encodingName;
- encodingName = getSpecDefaultEncoding();
- if (encodingName != null) {
- //createEncodingMemento(encodingName,
- // EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(encodingName);
- fEncodingMemento.setAppropriateDefault(encodingName);
- fEncodingMemento.addTrace(EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
- }
- }
-
- /**
- * Every subclass must provide a way to parse the input. This method has
- * several critical responsibilities:
- * <li>set the fEncodingMemento field appropriately, according to the
- * results of the parse of fReader.</li>
- * <li>set fHarderParsed to true, to avoid wasted re-parsing.</li>
- */
- abstract protected void parseInput() throws IOException;
-
- /**
- *
- */
- private void resetAll() {
- fReader = null;
- fHeaderParsed = false;
- fEncodingMemento = null;
- }
-
- /**
- *
- */
- public void set(InputStream inputStream) {
- resetAll();
- fReader = new ByteReader(inputStream);
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- } catch (IOException e) {
- // impossible, since we know ByteReader
- // supports marking
- throw new Error(e);
- }
- }
-
- /**
- *
- */
- public void set(IStorage iStorage) throws CoreException {
- resetAll();
- InputStream inputStream = iStorage.getContents();
- InputStream resettableStream = new BufferedInputStream(inputStream, CodedIO.MAX_BUF_SIZE);
- resettableStream.mark(CodedIO.MAX_MARK_SIZE);
- set(resettableStream);
- // TODO we'll need to "remember" IFile, or
- // get its (or its project's) settings, in case
- // those are needed to handle cases when the
- // encoding is not in the file stream.
- }
-
- /**
- * Note: this is not part of interface to help avoid confusion ... it
- * expected this Reader is a well formed character reader ... that is, its
- * all ready been determined to not be a unicode marked input stream. And,
- * its assumed to be in the correct position, at position zero, ready to
- * read first character.
- */
- public void set(Reader reader) {
- resetAll();
- fReader = reader;
- if (!fReader.markSupported()) {
- fReader = new BufferedReader(fReader);
- }
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- } catch (IOException e) {
- // impossble, since we just checked if markable
- throw new Error(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/ContentDescriberForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/ContentDescriberForJSP.java
deleted file mode 100644
index 6b63b6db57..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/ContentDescriberForJSP.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.eclipse.wst.common.encoding.IContentDescriptionExtended;
-import org.eclipse.wst.common.encoding.IResourceCharsetDetector;
-
-public class ContentDescriberForJSP extends AbstractContentDescriber implements ITextContentDescriber {
- private final static QualifiedName[] SUPPORTED_OPTIONS = {
- IContentDescription.CHARSET,
- IContentDescription.BYTE_ORDER_MARK,
- IContentDescriptionExtended.DETECTED_CHARSET,
- IContentDescriptionExtended.UNSUPPORTED_CHARSET,
- IContentDescriptionExtended.APPROPRIATE_DEFAULT,
- IContentDescriptionForJSP.CONTENT_TYPE_ATTRIBUTE,
- IContentDescriptionForJSP.LANGUAGE_ATTRIBUTE};
-
- public QualifiedName[] getSupportedOptions() {
- return SUPPORTED_OPTIONS;
- }
-
- protected IResourceCharsetDetector getDetector() {
- return new JSPResourceEncodingDetector();
- }
-
- protected void handleCalculations(IContentDescription description, IResourceCharsetDetector detector) throws IOException {
- // handle standard ones first, to be sure detector processes
- super.handleCalculations(description, detector);
- // now do those specific for JSPs
- // note: detector should always be of correct instance, but we'll check, for now.
- if (detector instanceof JSPResourceEncodingDetector) {
- JSPResourceEncodingDetector jspDetector = (JSPResourceEncodingDetector) detector;
- String language = jspDetector.getLanguage();
- if (language != null && language.length() > 0) {
- description.setProperty(IContentDescriptionForJSP.LANGUAGE_ATTRIBUTE, language);
- }
- String contentTypeAttribute = jspDetector.getContentType();
- if (contentTypeAttribute != null && contentTypeAttribute.length() > 0) {
- description.setProperty(IContentDescriptionForJSP.CONTENT_TYPE_ATTRIBUTE, contentTypeAttribute);
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/HeadParserToken.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/HeadParserToken.java
deleted file mode 100644
index 5a93e08f6e..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/HeadParserToken.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-
-public class HeadParserToken {
- private int fStart;
-
- private String fText;
- private String fType;
-
- protected HeadParserToken() {
- super();
- }
-
- public HeadParserToken(String type, int start, String text) {
- this();
- fType = type;
- fStart = start;
- fText = text;
-
- }
-
- public String getText() {
- return fText;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return ("text: " + fText + " offset: " + fStart + " type: " + fType); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IContentDescriptionForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IContentDescriptionForJSP.java
deleted file mode 100644
index fabce57dee..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IContentDescriptionForJSP.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.wst.common.encoding.ICodedResourcePlugin;
-
-
-public interface IContentDescriptionForJSP {
- /**
- * This should not be considered API at this point. It should probably be
- * moved in future.
- */
- public final static QualifiedName CONTENT_TYPE_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "contentTypeAttribute"); //$NON-NLS-1$
- public final static QualifiedName LANGUAGE_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "languageAttribute"); //$NON-NLS-1$
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java
deleted file mode 100644
index e04d0a2109..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-
-/*
- *
- * A non-resizable class implementing the behavior of java.util.Stack, but
- * directly for the <code> integer </code> primitive.
- */
-import java.util.EmptyStackException;
-
-public class IntStack {
- private int[] list = null;
-
- private int size = 0;
-
- public IntStack() {
- this(100);
- }
-
- public IntStack(int maxdepth) {
- super();
- list = new int[maxdepth];
- initialize();
- }
-
- public void clear() {
- initialize();
- }
-
- public boolean empty() {
- return size == 0;
- }
-
- public int get(int slot) {
- return list[slot];
- }
-
- private void initialize() {
- for (int i = 0; i < list.length; i++)
- list[i] = -1;
- }
-
- /**
- * Returns the int at the top of the stack without removing it
- *
- * @return int at the top of this stack.
- * @exception EmptyStackException
- * when empty.
- */
- public int peek() {
- if (size == 0)
- throw new EmptyStackException();
- return list[size - 1];
- }
-
- /**
- * Removes and returns the int at the top of the stack
- *
- * @return int at the top of this stack.
- * @exception EmptyStackException
- * when empty.
- */
- public int pop() {
- int value = peek();
- list[size - 1] = -1;
- size--;
- return value;
- }
-
- /**
- * Pushes an item onto the top of this stack.
- *
- * @param newValue -
- * the int to be pushed onto this stack.
- * @return the <code>newValue</code> argument.
- */
- public int push(int newValue) {
- if (size == list.length) {
- throw new StackOverflowError();
- }
- list[size++] = newValue;
- return newValue;
- }
-
- public int size() {
- return list.length;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizer.java
deleted file mode 100644
index ff51ba855d..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizer.java
+++ /dev/null
@@ -1,1323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 9/7/04 8:12 AM */
-
-/*nlsXXX*/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-
-
-
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 9/7/04 8:12 AM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/JSPHeadTokenizer/JSPHeadTokenizer.jflex</tt>
- */
-public class JSPHeadTokenizer {
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
- final public static int YYINITIAL = 0;
- final public static int UnDelimitedString = 12;
- final public static int DQ_STRING = 8;
- final public static int SQ_STRING = 10;
- final public static int ST_XMLDecl = 2;
- final public static int ST_PAGE_DIRECTIVE = 4;
- final public static int QuotedAttributeValue = 6;
-
- /**
- * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
- * YY_LEXSTATE[l+1] is the state in the DFA for the lexical state l
- * at the beginning of a line
- * l is of the form l = 2*k, k a non negative integer
- */
- private final static int YY_LEXSTATE[] = {
- 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7
- };
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed =
- "\11\0\1\6\1\7\2\0\1\11\22\0\1\6\1\0\1\45\2\0"+
- "\1\17\1\0\1\46\6\0\1\36\1\44\12\0\1\27\1\0\1\12"+
- "\1\10\1\41\1\13\1\20\1\22\1\0\1\33\1\30\1\24\1\0"+
- "\1\23\1\0\1\31\1\25\1\0\1\16\1\15\1\37\1\40\1\21"+
- "\1\0\1\32\1\26\1\34\1\42\1\35\1\0\1\14\1\43\7\0"+
- "\1\22\1\0\1\33\1\30\1\24\1\0\1\23\1\0\1\31\1\25"+
- "\1\0\1\16\1\15\1\37\1\40\1\21\1\0\1\32\1\26\1\34"+
- "\1\42\1\35\1\0\1\14\1\43\101\0\1\4\3\0\1\5\17\0"+
- "\1\3\16\0\1\1\20\0\1\3\16\0\1\1\1\2\170\0\1\2"+
- "\ufe87\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error",
- "Internal error: unknown state",
- "Error: could not match input",
- "Error: pushback value was too large"
- };
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[16384];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** number of newlines encountered up to the start of the matched text */
-// trivial hand edit to remove unused variable private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
-//trivial hand edit to remove unused variable private int yycolumn;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning of a line
- */
- private boolean yy_atBOL;
-
- /** yy_atEOF == true <=> the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean yy_eof_done;
-
- /* user code: */
-
-
-
- private boolean hasMore = true;
- private final static int MAX_TO_SCAN = 1000;
- StringBuffer string = new StringBuffer();
- // state stack for easier state handling
- private IntStack fStateStack = new IntStack();
- private String valueText = null;
-
-
- public JSPHeadTokenizer() {
- super();
- }
-
- public void reset (Reader in) {
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
-// trivial hand edit to remove unused variable yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /**
- * the number of characters from the last newline up to the start
- * of the matched text
- */
-// trivial hand edit to remove unused variable yycolumn = 0;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning
- * of a line
- */
- yy_atBOL = false;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- fStateStack.clear();
-
- hasMore = true;
-
- // its a little wasteful to "throw away" first char array generated
- // by class init (via auto generated code), but we really do want
- // a small buffer for our head parsers.
- if (yy_buffer.length != MAX_TO_SCAN) {
- yy_buffer = new char[MAX_TO_SCAN];
- }
-
-
- }
-
-
- public final HeadParserToken getNextToken() throws IOException {
- String context = null;
- context = primGetNextToken();
- HeadParserToken result = null;
- if (valueText != null) {
- result = createToken(context, yychar, valueText);
- valueText = null;
- } else {
- result = createToken(context, yychar, yytext());
- }
- return result;
- }
-
- public final boolean hasMoreTokens() {
- return hasMore && yychar < MAX_TO_SCAN;
- }
- private void pushCurrentState() {
- fStateStack.push(yystate());
-
- }
-
- private void popState() {
- yybegin(fStateStack.pop());
- }
- private HeadParserToken createToken(String context, int start, String text) {
- return new HeadParserToken(context, start, text);
- }
-
-
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- public JSPHeadTokenizer(java.io.Reader in) {
- this.yy_reader = in;
- }
-
- /**
- * Creates a new scanner.
- * There is also java.io.Reader version of this constructor.
- *
- * @param in the java.io.Inputstream to read input from.
- */
- public JSPHeadTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed the packed character translation table
- * @return the unpacked character translation table
- */
- private static char [] yy_unpack_cmap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 182) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do map[j++] = value; while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Gets the next input character.
- *
- * @return the next character of the input stream, EOF if the
- * end of the stream is reached.
- * @exception IOException if any I/O-Error occurs
- */
- private int yy_advance() throws java.io.IOException {
-
- /* standard case */
- if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
- /* if the eof is reached, we don't need to work hard */
- if (yy_atEOF) return YYEOF;
-
- /* otherwise: need to refill the buffer */
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if ( numRead == -1 ) return YYEOF;
-
- yy_endRead+= numRead;
-
- return yy_buffer[yy_currentPos++];
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
- yy_reader.close();
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning.
- *
- * @param errorCode the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- try {
- System.out.println(YY_ERROR_MSG[errorCode]);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- }
-
- System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- private void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
-
- /**
- * Contains user EOF-code, which will be executed exactly once,
- * when the end of file is reached
- */
- private void yy_do_eof() {
- if (!yy_eof_done) {
- yy_eof_done = true;
- hasMore=false;
-
- }
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception IOException if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
-
- while (true) {
-
- yychar+= yylength();
-
- yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
- if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
- yy_atBOL = yy_advance() != '\n';
- if (!yy_atEOF) yy_currentPos--;
- }
-
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
- if (yy_atBOL)
- yy_state = YY_LEXSTATE[yy_lexical_state+1];
- else
- yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
- yy_input = yycmap[yy_input];
-
- boolean yy_isFinal = false;
- boolean yy_noLookAhead = false;
-
- yy_forNext: { switch (yy_state) {
- case 0:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
- case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 12; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 1:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
- case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 13; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 14; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 2:
- switch (yy_input) {
- case 11: yy_isFinal = true; yy_state = 15; break yy_forNext;
- case 20: yy_isFinal = true; yy_state = 16; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 3:
- switch (yy_input) {
- case 14: yy_isFinal = true; yy_state = 17; break yy_forNext;
- case 15: yy_isFinal = true; yy_state = 18; break yy_forNext;
- case 17: yy_isFinal = true; yy_state = 19; break yy_forNext;
- case 27: yy_isFinal = true; yy_state = 20; break yy_forNext;
- case 36: yy_isFinal = true; yy_state = 21; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 4:
- switch (yy_input) {
- case 6:
- case 9: yy_isFinal = true; yy_state = 23; break yy_forNext;
- case 7: yy_isFinal = true; yy_state = 24; break yy_forNext;
- case 37: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
- case 38: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
- }
-
- case 5:
- switch (yy_input) {
- case 7:
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
- case 11: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 15: yy_isFinal = true; yy_state = 30; break yy_forNext;
- case 37: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
- case 38: yy_isFinal = true; yy_state = 32; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 27; break yy_forNext;
- }
-
- case 6:
- switch (yy_input) {
- case 7:
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
- case 15: yy_isFinal = true; yy_state = 30; break yy_forNext;
- case 38: yy_isFinal = true; yy_state = 33; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 27; break yy_forNext;
- }
-
- case 7:
- switch (yy_input) {
- case 11:
- case 15: yy_isFinal = true; yy_state = 30; break yy_forNext;
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 34; break yy_forNext;
- case 37: yy_isFinal = true; yy_noLookAhead = true; yy_state = 35; break yy_forNext;
- case 38: yy_isFinal = true; yy_state = 36; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 27; break yy_forNext;
- }
-
- case 9:
- switch (yy_input) {
- case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 37; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 10:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 38; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 11:
- switch (yy_input) {
- case 4: yy_state = 39; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 12:
- switch (yy_input) {
- case 15: yy_state = 40; break yy_forNext;
- case 21: yy_state = 41; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 13:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 42; break yy_forNext;
- case 10: yy_state = 43; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 14:
- switch (yy_input) {
- case 15: yy_state = 40; break yy_forNext;
- case 21: yy_state = 41; break yy_forNext;
- case 11: yy_state = 44; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 15:
- switch (yy_input) {
- case 33: yy_isFinal = true; yy_noLookAhead = true; yy_state = 45; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 16:
- switch (yy_input) {
- case 31: yy_state = 46; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 17:
- switch (yy_input) {
- case 18: yy_state = 47; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 18:
- switch (yy_input) {
- case 33: yy_isFinal = true; yy_noLookAhead = true; yy_state = 48; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 19:
- switch (yy_input) {
- case 18: yy_state = 49; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 20:
- switch (yy_input) {
- case 32: yy_state = 50; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 21:
- switch (yy_input) {
- case 33: yy_isFinal = true; yy_noLookAhead = true; yy_state = 51; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 23:
- switch (yy_input) {
- case 6:
- case 9: yy_isFinal = true; yy_state = 23; break yy_forNext;
- case 7: yy_state = 52; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
- }
-
- case 24:
- switch (yy_input) {
- case 6:
- case 9: yy_isFinal = true; yy_state = 23; break yy_forNext;
- case 7: yy_state = 52; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
- }
-
- case 29:
- switch (yy_input) {
- case 33: yy_isFinal = true; yy_noLookAhead = true; yy_state = 53; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 30:
- switch (yy_input) {
- case 33: yy_isFinal = true; yy_noLookAhead = true; yy_state = 54; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 32:
- switch (yy_input) {
- case 10: yy_state = 55; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 33:
- switch (yy_input) {
- case 10: yy_state = 55; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 36:
- switch (yy_input) {
- case 10: yy_state = 55; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 39:
- switch (yy_input) {
- case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 56; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 40:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 40; break yy_forNext;
- case 16: yy_state = 57; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 41:
- switch (yy_input) {
- case 22: yy_state = 58; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 42:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 42; break yy_forNext;
- case 10: yy_state = 43; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 43:
- switch (yy_input) {
- case 11: yy_state = 44; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 44:
- switch (yy_input) {
- case 12: yy_state = 59; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 46:
- switch (yy_input) {
- case 27: yy_state = 60; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 47:
- switch (yy_input) {
- case 31: yy_state = 61; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 49:
- switch (yy_input) {
- case 19: yy_state = 62; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 50:
- switch (yy_input) {
- case 31: yy_state = 63; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 52:
- switch (yy_input) {
- case 6:
- case 9: yy_isFinal = true; yy_state = 23; break yy_forNext;
- case 7: yy_state = 52; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
- }
-
- case 55:
- switch (yy_input) {
- case 38: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 57:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 57; break yy_forNext;
- case 17: yy_state = 64; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 58:
- switch (yy_input) {
- case 17: yy_state = 65; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 59:
- switch (yy_input) {
- case 13: yy_state = 66; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 60:
- switch (yy_input) {
- case 32: yy_state = 67; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 61:
- switch (yy_input) {
- case 19: yy_state = 68; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 62:
- switch (yy_input) {
- case 20: yy_state = 69; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 63:
- switch (yy_input) {
- case 28: yy_state = 70; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 64:
- switch (yy_input) {
- case 18: yy_state = 71; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 65:
- switch (yy_input) {
- case 23: yy_state = 72; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 66:
- switch (yy_input) {
- case 14: yy_state = 73; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 67:
- switch (yy_input) {
- case 24: yy_state = 74; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 68:
- switch (yy_input) {
- case 34: yy_state = 75; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 69:
- switch (yy_input) {
- case 20: yy_state = 76; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 70:
- switch (yy_input) {
- case 20: yy_state = 77; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 71:
- switch (yy_input) {
- case 19: yy_state = 78; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 72:
- switch (yy_input) {
- case 24: yy_state = 79; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 73:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 80; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 74:
- switch (yy_input) {
- case 25: yy_state = 81; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 75:
- switch (yy_input) {
- case 18: yy_state = 82; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 76:
- switch (yy_input) {
- case 31: yy_state = 83; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 77:
- switch (yy_input) {
- case 31: yy_state = 84; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 78:
- switch (yy_input) {
- case 20: yy_state = 85; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 79:
- switch (yy_input) {
- case 25: yy_state = 86; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 80:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 80; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 81:
- switch (yy_input) {
- case 31: yy_state = 87; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 82:
- switch (yy_input) {
- case 19: yy_state = 88; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 83:
- switch (yy_input) {
- case 27: yy_state = 89; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 84:
- switch (yy_input) {
- case 28: yy_state = 90; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 85:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 91; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 86:
- switch (yy_input) {
- case 26: yy_state = 92; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 87:
- switch (yy_input) {
- case 19: yy_state = 93; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 88:
- switch (yy_input) {
- case 20: yy_state = 94; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 89:
- switch (yy_input) {
- case 32: yy_state = 95; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 90:
- switch (yy_input) {
- case 28: yy_state = 96; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 91:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 91; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 92:
- switch (yy_input) {
- case 20: yy_state = 97; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 93:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 93; break yy_forNext;
- case 8: yy_isFinal = true; yy_state = 98; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 94:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 94; break yy_forNext;
- case 8: yy_isFinal = true; yy_state = 99; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 95:
- switch (yy_input) {
- case 24: yy_state = 100; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 96:
- switch (yy_input) {
- case 35: yy_state = 101; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 97:
- switch (yy_input) {
- case 27: yy_state = 102; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 98:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 98; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 99:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 99; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 100:
- switch (yy_input) {
- case 25: yy_state = 103; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 101:
- switch (yy_input) {
- case 17: yy_state = 104; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 102:
- switch (yy_input) {
- case 28: yy_state = 105; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 103:
- switch (yy_input) {
- case 31: yy_state = 106; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 104:
- switch (yy_input) {
- case 20: yy_state = 107; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 105:
- switch (yy_input) {
- case 25: yy_state = 108; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 106:
- switch (yy_input) {
- case 19: yy_state = 109; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 107:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 107; break yy_forNext;
- case 8: yy_isFinal = true; yy_state = 110; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 108:
- switch (yy_input) {
- case 29: yy_state = 111; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 109:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 109; break yy_forNext;
- case 8: yy_isFinal = true; yy_state = 112; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 110:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 110; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 111:
- switch (yy_input) {
- case 20: yy_state = 113; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 112:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 112; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 113:
- switch (yy_input) {
- case 30: yy_state = 114; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 114:
- switch (yy_input) {
- case 17: yy_state = 64; break yy_forNext;
- default: break yy_forAction;
- }
-
- default:
- yy_ScanError(YY_ILLEGAL_STATE);
- break;
- } }
-
- if ( yy_isFinal ) {
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
- if ( yy_noLookAhead ) break yy_forAction;
- }
-
- }
- }
-
-
- switch (yy_action) {
-
- case 33:
- { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- case 116: break;
- case 28:
- { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 117: break;
- case 22:
- case 23:
- { yypushback(1); yybegin(UnDelimitedString); string.setLength(0); }
- case 118: break;
- case 35:
- case 36:
- { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
- case 119: break;
- case 48:
- { yybegin(YYINITIAL); return JSPHeadTokenizerConstants.PageDirectiveEnd; }
- case 120: break;
- case 51:
- { yybegin(YYINITIAL); return JSPHeadTokenizerConstants.PageDirectiveEnd; }
- case 121: break;
- case 53:
- { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 122: break;
- case 54:
- { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 123: break;
- case 80:
- { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
- case 124: break;
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 24:
- { if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
- case 125: break;
- case 91:
- { yybegin(ST_PAGE_DIRECTIVE); return JSPHeadTokenizerConstants.PageDirectiveStart; }
- case 126: break;
- case 45:
- { yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd; }
- case 127: break;
- case 112:
- { pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageEncoding; }
- case 128: break;
- case 110:
- { pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageContentType; }
- case 129: break;
- case 99:
- { pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageLanguage; }
- case 130: break;
- case 98:
- { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
- case 131: break;
- case 56:
- { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
- case 132: break;
- case 37:
- { hasMore = false; return EncodingParserConstants.UTF16BE; }
- case 133: break;
- case 38:
- { hasMore = false; return EncodingParserConstants.UTF16LE; }
- case 134: break;
- case 31:
- { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- case 135: break;
- case 27:
- case 29:
- case 30:
- case 32:
- { string.append( yytext() ); }
- case 136: break;
- case 26:
- { yybegin(SQ_STRING); string.setLength(0); }
- case 137: break;
- case 25:
- { yybegin(DQ_STRING); string.setLength(0); }
- case 138: break;
- case 34:
- { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- case 139: break;
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
- yy_do_eof();
- { hasMore = false; return EncodingParserConstants.EOF; }
- }
- else {
- yy_ScanError(YY_NO_MATCH);
- }
- }
- }
- }
-
- /**
- * Runs the scanner on input files.
- *
- * This main method is the debugging routine for the scanner.
- * It prints each returned token to System.out until the end of
- * file is reached, or an error occured.
- *
- * @param argv the command line, contains the filenames to run
- * the scanner on.
- */
- public static void main(String argv[]) {
- for (int i = 0; i < argv.length; i++) {
- JSPHeadTokenizer scanner = null;
- try {
- scanner = new JSPHeadTokenizer( new java.io.FileReader(argv[i]) );
- }
- catch (java.io.FileNotFoundException e) {
- System.out.println("File not found : \""+argv[i]+"\"");
-// System.exit(1);
- }
-// catch (java.io.IOException e) {
-// System.out.println("Error opening file \""+argv[i]+"\"");
-// System.exit(1);
-// }
- catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("Usage : java JSPHeadTokenizer <inputfile>");
- //System.exit(1);
- }
-
- try {
- do {
- System.out.println(scanner.primGetNextToken());
- } while (!scanner.yy_atEOF);
-
- }
- catch (java.io.IOException e) {
- System.out.println("An I/O error occured while scanning :");
- System.out.println(e);
- //System.exit(1);
- }
- catch (Exception e) {
- e.printStackTrace();
- //System.exit(1);
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizerConstants.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizerConstants.java
deleted file mode 100644
index 08fa5b9a0b..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizerConstants.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-public interface JSPHeadTokenizerConstants extends XMLHeadTokenizerConstants {
- String PageDirectiveStart = "PageDirectiveStart"; //$NON-NLS-1$
- String PageDirectiveEnd = "PageDirectiveEnd"; //$NON-NLS-1$
- String PageLanguage = "PageLanguage"; //$NON-NLS-1$
- String PageEncoding = "PageEncoding"; //$NON-NLS-1$
- String PageContentType = "PageContentType"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
deleted file mode 100644
index 9d996c9fbc..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.encoding.EncodingMemento;
-import org.eclipse.wst.common.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-public class JSPResourceEncodingDetector extends AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
- private String fPageEncodingValue = null;
- private JSPHeadTokenizer fTokenizer = null;
- private String fLanguage;
-
- private String fContentTypeValue;
- private String fXMLDecEncodingName;
- private String fCharset;
- private boolean unicodeCase;
- private String fContentType;
-
- protected void parseInput() throws IOException {
- JSPHeadTokenizer tokenizer = getTokinizer();
- tokenizer.reset(fReader);
- parseHeader(tokenizer);
- // unicode stream cases are created directly in parseHeader
- if (!unicodeCase) {
- String enc = getAppropriateEncoding();
- if (enc != null && enc.length() > 0) {
- createEncodingMemento(enc, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
- }
- }
- }
-
- private JSPHeadTokenizer getTokinizer() {
- if (fTokenizer == null) {
- fTokenizer = new JSPHeadTokenizer();
- }
- return fTokenizer;
- }
-
- /**
- * There can sometimes be mulitple 'encodings' specified in a file. This
- * is an attempt to centralize the rules for deciding between them.
- * Returns encoding according to priority: 1. XML Declaration 2. page
- * directive pageEncoding name 3. page directive contentType charset name
- */
- private String getAppropriateEncoding() {
- String result = null;
- if (fXMLDecEncodingName != null)
- result = fXMLDecEncodingName;
- else if (fPageEncodingValue != null)
- result = fPageEncodingValue;
- else if (fCharset != null)
- result = fCharset;
- return result;
- }
-
- /**
- *
- */
- public JSPResourceEncodingDetector() {
- super();
- }
-
- public String getSpecDefaultEncoding() {
- // by JSP Spec
- final String enc = "ISO-8859-1"; //$NON-NLS-1$
- return enc;
- }
-
- private boolean canHandleAsUnicodeStream(String tokenType) {
- boolean canHandleAsUnicode = false;
- if (tokenType == EncodingParserConstants.UTF83ByteBOM) {
- canHandleAsUnicode = true;
- String enc = "UTF-8"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- fEncodingMemento.setUTF83ByteBOMUsed(true);
- }
- else if (tokenType == EncodingParserConstants.UTF16BE) {
- canHandleAsUnicode = true;
- String enc = "UTF-16BE"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- }
- else if (tokenType == EncodingParserConstants.UTF16LE) {
- canHandleAsUnicode = true;
- String enc = "UTF-16"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- }
- return canHandleAsUnicode;
- }
-
- /**
- * Looks for what ever encoding properties the tokenizer returns. Its the
- * responsibility of the tokenizer to stop when appropriate and not go too
- * far.
- */
- private void parseHeader(JSPHeadTokenizer tokenizer) throws IOException {
- fPageEncodingValue = null;
- fCharset = null;
-
- HeadParserToken token = null;
- do {
- // don't use 'get' here (at least until reset issue fixed)
- token = tokenizer.getNextToken();
- String tokenType = token.getType();
- if (canHandleAsUnicodeStream(tokenType))
- unicodeCase = true;
- else {
-
- if (tokenType == XMLHeadTokenizerConstants.XMLDelEncoding) {
- if (tokenizer.hasMoreTokens()) {
- HeadParserToken valueToken = tokenizer.getNextToken();
- String valueTokenType = valueToken.getType();
- if (isLegalString(valueTokenType)) {
- fXMLDecEncodingName = valueToken.getText();
- }
- }
- }
- else if (tokenType == JSPHeadTokenizerConstants.PageEncoding) {
- if (tokenizer.hasMoreTokens()) {
- HeadParserToken valueToken = tokenizer.getNextToken();
- String valueTokenType = valueToken.getType();
- if (isLegalString(valueTokenType)) {
- fPageEncodingValue = valueToken.getText();
- }
- }
- }
- else if (tokenType == JSPHeadTokenizerConstants.PageContentType) {
- if (tokenizer.hasMoreTokens()) {
- HeadParserToken valueToken = tokenizer.getNextToken();
- String valueTokenType = valueToken.getType();
- if (isLegalString(valueTokenType)) {
- fContentTypeValue = valueToken.getText();
- }
- }
- }
- else if (tokenType == JSPHeadTokenizerConstants.PageLanguage) {
- if (tokenizer.hasMoreTokens()) {
- HeadParserToken valueToken = tokenizer.getNextToken();
- String valueTokenType = valueToken.getType();
- if (isLegalString(valueTokenType)) {
- fLanguage = valueToken.getText();
- }
- }
- }
- }
- }
- while (tokenizer.hasMoreTokens());
- if (fContentTypeValue != null) {
- parseContentTypeValue(fContentTypeValue);
- }
-
- }
-
- private boolean isLegalString(String valueTokenType) {
- if (valueTokenType == null)
- return false;
- else
- return valueTokenType.equals(EncodingParserConstants.StringValue) || valueTokenType.equals(EncodingParserConstants.UnDelimitedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTerminatedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue);
- }
-
- private void parseContentTypeValue(String contentType) {
- Pattern pattern = Pattern.compile(";\\s*charset\\s*=\\s*"); //$NON-NLS-1$
- String[] parts = pattern.split(contentType);
- if (parts.length > 0) {
- // if only one item, it can still be charset instead of
- // contentType
- if (parts.length == 1) {
- if (parts[0].length() > 6) {
- String checkForCharset = parts[0].substring(0, 7);
- if (checkForCharset.equalsIgnoreCase("charset")) { //$NON-NLS-1$
- int eqpos = parts[0].indexOf('=');
- eqpos = eqpos + 1;
- if (eqpos < parts[0].length()) {
- fCharset = parts[0].substring(eqpos);
- fCharset = fCharset.trim();
- }
- }
- }
- }
- else {
- fContentType = parts[0];
- }
- }
- if (parts.length > 1) {
- fCharset = parts[1];
- }
- }
-
- /**
- *
- */
-
- public void set(IFile iFile) throws CoreException {
- reset();
- super.set(iFile);
- }
-
- private void reset() {
- fCharset = null;
- fContentTypeValue = null;
- fPageEncodingValue = null;
- fXMLDecEncodingName = null;
- unicodeCase = false;
- }
-
- public void set(InputStream inputStream) {
- reset();
- super.set(inputStream);
- }
-
- public void set(Reader reader) {
- reset();
- super.set(reader);
- }
-
- public String getLanguage() throws IOException {
- ensureInputSet();
- if (!fHeaderParsed) {
- parseInput();
- fHeaderParsed = true;
- }
- return fLanguage;
- }
-
- /**
- * @return Returns the contentType.
- */
- public String getContentType() throws IOException {
- ensureInputSet();
- if (!fHeaderParsed) {
- parseInput();
- // we keep track of if header's already been parse, so can make
- // multiple 'get' calls, without causing reparsing.
- fHeaderParsed = true;
- // Note: there is a "hidden assumption" here that an empty
- // string in content should be treated same as not present.
- }
- return fContentType;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/NullMemento.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/NullMemento.java
deleted file mode 100644
index c26dd78793..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/NullMemento.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-
-import org.eclipse.wst.common.encoding.EncodingMemento;
-import org.eclipse.wst.common.encoding.NonContentBasedEncodingRules;
-
-
-
-/**
- * This class can be used in place of an EncodingMemento (its super class),
- * when there is not in fact ANY encoding information. For example, when a
- * structuredDocument is created directly from a String
- */
-public class NullMemento extends EncodingMemento {
- /**
- *
- */
- public NullMemento() {
- super();
- String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
- setJavaCharsetName(defaultCharset);
- setAppropriateDefault(defaultCharset);
- setDetectedCharsetName(null);
- addTrace(DEFAULTS_ASSUMED_FOR_EMPTY_INPUT);
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/DocumentFactoryForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/DocumentFactoryForJSP.java
deleted file mode 100644
index 2984e0d063..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/DocumentFactoryForJSP.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.document;
-
-import org.eclipse.core.filebuffers.IDocumentFactory;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-import org.eclipse.wst.sse.core.document.StructuredDocumentFactory;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.parser.TagMarker;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-
-
-public class DocumentFactoryForJSP implements IDocumentFactory {
-
- public DocumentFactoryForJSP() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IDocumentFactory#createDocument()
- */
- public IDocument createDocument() {
- IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(new JSPSourceParser());
- return structuredDocument;
- }
-
- public RegionParser getParser() {
- // remember, the Loader
- // will need to finish initialization of parser
- // based on "embedded content"
- JSPSourceParser parser = new JSPSourceParser();
- // add default nestable tag list
- addNestablePrefix(parser, JSP11Namespace.JSP_TAG_PREFIX);
- return parser;
- }
-
- private void addNestablePrefix(JSPSourceParser parser, String tagName) {
- TagMarker bm = new TagMarker(tagName);
- parser.addNestablePrefix(bm);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/DocumentLoaderForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/DocumentLoaderForJSP.java
deleted file mode 100644
index 33eeb02672..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/DocumentLoaderForJSP.java
+++ /dev/null
@@ -1,549 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.document;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jst.jsp.core.JSP11Namespace;
-import org.eclipse.jst.jsp.core.PageDirectiveAdapter;
-import org.eclipse.jst.jsp.core.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.encoding.IJSPHeadContentDetector;
-import org.eclipse.jst.jsp.core.encoding.JSPDocumentHeadContentDetector;
-import org.eclipse.jst.jsp.core.encoding.JSPDocumentLoader;
-import org.eclipse.jst.jsp.core.internal.contenttype.IContentDescriptionForJSP;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP;
-import org.eclipse.wst.common.encoding.CodedReaderCreator;
-import org.eclipse.wst.common.encoding.ContentTypeEncodingPreferences;
-import org.eclipse.wst.common.encoding.EncodingMemento;
-import org.eclipse.wst.common.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.PropagatingAdapter;
-import org.eclipse.wst.sse.core.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.document.IDocumentLoaderForFileBuffers;
-import org.eclipse.wst.sse.core.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.document.StructuredDocumentLoader;
-import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistry;
-import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistryImpl;
-import org.eclipse.wst.sse.core.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.modelquery.ModelQueryAdapter;
-import org.eclipse.wst.sse.core.parser.JSPCapableParser;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.parser.TagMarker;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.util.Assert;
-import org.eclipse.wst.xml.core.document.XMLDocument;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.w3c.dom.Document;
-
-public class DocumentLoaderForJSP extends StructuredDocumentLoader implements IDocumentLoader, IDocumentLoaderForFileBuffers {
- private final static String DEFAULT_LANGUAGE = "java"; //$NON-NLS-1$
- private final static String DEFAULT_MIME_TYPE = "text/html"; //$NON-NLS-1$
- private final static String SPEC_DEFAULT_ENCODING = "ISO-8859-1"; //$NON-NLS-1$
-
- protected static IFile getFileFor(IStructuredModel model) {
- if (model == null)
- return null;
- String path = model.getBaseLocation();
- if (path == null || path.length() == 0) {
- Object id = model.getId();
- if (id == null)
- return null;
- path = id.toString();
- }
- // TODO needs rework for linked resources
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile file = root.getFileForLocation(new Path(path));
- return file;
- }
-
- private EmbeddedTypeRegistry fEmbeddedContentTypeRegistry;
- private IDocumentCharsetDetector fDocumentEncodingDetector;
-
- public DocumentLoaderForJSP() {
- super();
- }
-
- private void addNestablePrefix(JSPSourceParser parser, String tagName) {
- TagMarker bm = new TagMarker(tagName);
- parser.addNestablePrefix(bm);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.document.IDocumentLoader#createNewStructuredDocument()
- */
- public IEncodedDocument createNewStructuredDocument() {
- DocumentFactoryForJSP factory = new DocumentFactoryForJSP();
- IEncodedDocument document = (IEncodedDocument) factory.createDocument();
- return document;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.document.IDocumentLoader#createNewStructuredDocument(java.io.Reader)
- */
- public IEncodedDocument createNewStructuredDocument(Reader reader) throws UnsupportedEncodingException, IOException {
- IEncodedDocument structuredDocument = createNewStructuredDocument();
- StringBuffer allText = readInputStream(reader);
- structuredDocument.set(allText.toString());
- return structuredDocument;
- }
-
- public IEncodedDocument createNewStructuredDocument(String filename, InputStream inputStream, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException {
- if (filename == null && inputStream == null) {
- throw new IllegalArgumentException("can not have both null filename and inputstream"); //$NON-NLS-1$
- }
- Reader fullPreparedReader = null;
- IEncodedDocument structuredDocument = createNewStructuredDocument();
- CodedReaderCreator codedReaderCreator = new CodedReaderCreator();
- try {
- codedReaderCreator.set(filename, inputStream);
- fullPreparedReader = codedReaderCreator.getCodedReader();
- EncodingMemento encodingMemento = codedReaderCreator.getEncodingMemento();
- structuredDocument.setEncodingMemento(encodingMemento);
- // the fact that file is null means this method/code path is no
- // good for JSP fragments
- EmbeddedTypeHandler embeddedType = getEmbeddedType((IFile) null);
- fullPreparedReader.reset();
- if (embeddedType != null)
- embeddedType.initializeParser((JSPCapableParser) ((IStructuredDocument) structuredDocument).getParser());
- setDocumentContentsFromReader(structuredDocument, fullPreparedReader);
- }
- catch (CoreException e) {
- // impossible in this context
- throw new Error(e);
- }
- finally {
- if (fullPreparedReader != null) {
- fullPreparedReader.close();
- }
- }
- return structuredDocument;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.document.IDocumentLoader#createNewStructuredDocument(java.lang.String,
- * java.io.InputStream, com.ibm.encoding.resource.EncodingRule)
- */
- public IEncodedDocument createNewStructuredDocument(String filename, InputStream inputStream) throws IOException {
- return createNewStructuredDocument(filename, inputStream, EncodingRule.CONTENT_BASED);
- }
-
- /**
- * Method getDefaultDocumentPartitioner.
- *
- * @return IDocumentPartitioner
- */
- public IDocumentPartitioner getDefaultDocumentPartitioner() {
- return new StructuredTextPartitionerForJSP();
- }
-
- /**
- * Method getDefaultMimeType.
- *
- * @return String
- */
- private String getDefaultMimeType() {
- return DEFAULT_MIME_TYPE;
- }
-
- /**
- * @see com.ibm.sed.model.AbstractDumper#getDocumentEncodingDetector()
- */
- public IDocumentCharsetDetector getDocumentEncodingDetector() {
- if (fDocumentEncodingDetector == null) {
- fDocumentEncodingDetector = new JSPDocumentHeadContentDetector();
- }
- return fDocumentEncodingDetector;
- }
-
- /**
- * Gets the embeddedContentTypeRegistry.
- *
- * @return Returns a EmbeddedContentTypeRegistry
- */
- private EmbeddedTypeRegistry getEmbeddedContentTypeRegistry() {
- if (fEmbeddedContentTypeRegistry == null) {
- fEmbeddedContentTypeRegistry = EmbeddedTypeRegistryImpl.getInstance();
- }
- return fEmbeddedContentTypeRegistry;
- }
-
- /**
- * Determine the MIME content type specified in a page directive. This
- * should appear "as early as possible in the JSP page" according to the
- * JSP v1.2 specification.
- */
- private EmbeddedTypeHandler getEmbeddedType(IFile file) throws UnsupportedEncodingException, CoreException, IOException {
- EmbeddedTypeHandler handler = null;
- boolean exists = file.exists();
- if (!exists) {
- // if "new" file, assume default
- handler = getJSPDefaultEmbeddedType();
- }
- else {
- IContentDescription description = file.getContentDescription();
- if (description != null) {
- String jspContentTypeAttribute = (String) description.getProperty(IContentDescriptionForJSP.CONTENT_TYPE_ATTRIBUTE);
- if (jspContentTypeAttribute == null || jspContentTypeAttribute.length() == 0) {
- handler = getJSPDefaultEmbeddedType();
- }
- else {
- EmbeddedTypeRegistry reg = getEmbeddedContentTypeRegistry();
- handler = reg.getTypeFor(jspContentTypeAttribute);
- }
- }
- else {
- handler = getJSPDefaultEmbeddedType();
- }
- }
- // post condition
- Assert.isNotNull(handler);
- return handler;
- }
-
- private EmbeddedTypeHandler getEmbeddedType(IStructuredModel model) {
- Document doc = ((XMLModel) model).getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) ((INodeNotifier) doc).getAdapterFor(PageDirectiveAdapter.class);
- EmbeddedTypeHandler embeddedHandler = pageDirectiveAdapter.getEmbeddedType();
- return embeddedHandler;
- }
-
- /**
- * For JSP files, text/html is the default content type. This may want
- * this different for types like jsv (jsp for voice xml) For now, hard
- * code to new instance. In future, should get instance from registry.
- * Specification cites HTML as the default contentType.
- */
- private EmbeddedTypeHandler getJSPDefaultEmbeddedType() {
- EmbeddedTypeRegistry reg = getEmbeddedContentTypeRegistry();
- return reg.getTypeFor(getDefaultMimeType());
- }
-
- /**
- * Method getLanguage.
- *
- * @param model
- * @return String
- */
- private String getLanguage(IStructuredModel model) throws IOException {
- String result = null;
- // first check the model (document itself) to see if contains
- result = getLanguageFromStructuredDocument(model.getStructuredDocument());
- // Note: if model contains an unsupported
- // language, we'll even return it,
- // since who knows what future holds.
-
- // always return something
- if (result == null) {
- result = DEFAULT_LANGUAGE;
- }
- return result;
- }
-
- /**
- * Method getLanguageFromStructuredDocument.
- *
- * @param structuredDocument
- * @return String
- */
- private String getLanguageFromStructuredDocument(IDocument document) throws IOException {
- if (document == null)
- return null;
- String result = null;
- // bascially same algorithm as get encoding or
- // get content type from structuredDocument.
- IJSPHeadContentDetector localHeadParser = (IJSPHeadContentDetector) getDocumentEncodingDetector();
- // we can be assured that its already been
- // parsed. If not call parseHeaderForPageDirective()
- // before calling getLanguage;
- localHeadParser.set(document);
- result = localHeadParser.getLanguage();
- return result;
- }
-
- public RegionParser getParser() {
- // remember, the Loader
- // will need to finish initialization of parser
- // based on "embedded content"
- JSPSourceParser parser = new JSPSourceParser();
- // add default nestable tag list
- addNestablePrefix(parser, JSP11Namespace.JSP_TAG_PREFIX);
- return parser;
- }
-
- protected String getPreferredNewLineDelimiter() {
- return ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForJSP.ContentTypeID_JSP);
- }
-
- /**
- * Specification cites ISO-8859-1/Latin-1 as the default charset.
- */
- protected String getSpecDefaultEncoding() {
- return SPEC_DEFAULT_ENCODING;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.document.IDocumentLoader#handleLineDelimiter(java.lang.StringBuffer,
- * com.ibm.sse.model.document.IEncodedDocument)
- */
- public StringBuffer handleLineDelimiter(StringBuffer originalString, IEncodedDocument theStructuredDocument) {
- // TODO Auto-generated method stub
- return originalString;
- }
-
- /**
- * This is "reinitialize" since there should always be at least the
- * default one assigned, before we start checking the stream
- */
- private void initCloneOfEmbeddedType(IStructuredModel model, EmbeddedTypeHandler oldEmbeddedContentType, EmbeddedTypeHandler newEmbeddedContentType) throws IOException {
- // check program logic
- Assert.isNotNull(oldEmbeddedContentType, "Program error: invalid call during model initialization"); //$NON-NLS-1$
- // once we know the embedded content type, we need to set it in the
- // PageDirectiveAdapter ... the order of initialization is
- // critical here, the doc must have been created, but its contents not
- // set
- // yet,
- // and all factories must have been set up also.
- XMLModel domModel = (XMLModel) model;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- XMLDocument document = domModel.getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getAdapterFor(PageDirectiveAdapter.class);
- // ==> // PropagatingAdapter propagatingAdapter = (PropagatingAdapter)
- // ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
- // ==> // ModelQueryAdapter modelQueryAdapter = (ModelQueryAdapter)
- // ((INodeNotifier) document).getAdapterFor(ModelQueryAdapter.class);
- // because, even in the clone case, the model has been paritally
- // intialized
- // with
- // the old embedded type (during createModel), we need to unitialize
- // parts of it, based on the old (or default) ones
- oldEmbeddedContentType.uninitializeFactoryRegistry(model.getFactoryRegistry());
- oldEmbeddedContentType.uninitializeParser((JSPCapableParser) structuredDocument.getParser());
- // remember, embedded type factories are automatically cleared when
- // embededType changed
- pageDirectiveAdapter.setEmbeddedType(newEmbeddedContentType);
- if (newEmbeddedContentType != null) {
- newEmbeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
- newEmbeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
- }
- // adding language here, in this convienent central
- // location, but some obvious renaming or refactoring
- // wouldn't hurt, in future.
- // I needed to add this language setting for JSP Fragment support
- // Note: this is the one that counts, since at this point,
- // the model has an ID, so we can look up IFile, etc.
- String language = getLanguage(model);
- if (language != null && language.length() > 0) {
- pageDirectiveAdapter.setLanguage(language);
- }
- }
-
- /**
- * Method initEmbeddedType.
- */
- private void initEmbeddedType(IStructuredModel model) {
- initializeEmbeddedTypeFromDefault(model);
- }
-
- /**
- * Method initEmbeddedType.
- */
- private void initEmbeddedType(IStructuredModel oldModel, IStructuredModel newModel) throws IOException {
- EmbeddedTypeHandler existingEmbeddedType = getEmbeddedType(oldModel);
- EmbeddedTypeHandler newEmbeddedContentType = existingEmbeddedType.newInstance();
- if (existingEmbeddedType == null) {
- initEmbeddedType(newModel);
- }
- else {
- //initEmbeddedType(newModel);
- initCloneOfEmbeddedType(newModel, existingEmbeddedType, newEmbeddedContentType);
- }
- setLanguageInPageDirective(newModel);
- }
-
- /**
- * This is "initialize" since is always assumes it hasn't been initalized
- * yet.
- */
- private void initializeEmbeddedType(IStructuredModel model, EmbeddedTypeHandler embeddedContentType) {
- // check program logic
- Assert.isNotNull(embeddedContentType, "Program error: invalid call during model initialization"); //$NON-NLS-1$
- // once we know the embedded content type, we need to set it in the
- // PageDirectiveAdapter ... the order of initialization is
- // critical here, the doc must have been created, but its contents not
- // set
- // yet,
- // and all factories must have been set up also.
- XMLModel domModel = (XMLModel) model;
- XMLDocument document = domModel.getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getAdapterFor(PageDirectiveAdapter.class);
- pageDirectiveAdapter.setEmbeddedType(embeddedContentType);
- embeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- embeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
- // adding language here, in this convienent central
- // location, but some obvious renaming or refactoring
- // wouldn't hurt, in future.
- // I needed to add this language setting for JSP Fragment support
- // Note: I don't think this attempted init counts for much.
- // I think its always executed when model is very first
- // being initialized, and doesn't even have content
- // or an ID yet. I thought I'd leave, since it wouldn't
- // hurt, in case its called in other circumstances.
- // String language = getLanguage(model);
- // pageDirectiveAdapter.setLanguage(language);
- }
-
- /**
- * This init method is for the case where we are creating an empty model,
- * which we always do.
- */
- private void initializeEmbeddedTypeFromDefault(IStructuredModel model) {
- EmbeddedTypeHandler embeddedContentType = getJSPDefaultEmbeddedType();
- initializeEmbeddedType(model, embeddedContentType);
- }
-
- public IDocumentLoader newInstance() {
- return new JSPDocumentLoader();
- }
-
- protected void preLoadAdapt(IStructuredModel structuredModel) {
- XMLModel domModel = (XMLModel) structuredModel;
- //
- // document must have already been set for this to
- // work.
- Document document = domModel.getDocument();
- Assert.isNotNull(document);
- // if there is a model in the adapter, this will adapt it to
- // first node. After that the PropagatingAdater spreads over the
- // children being
- // created. Each time that happends, a side effect is to
- // also "spread" sprecific registered adapters,
- // they two can propigate is needed.
- // This 'get' causes first to be be attached.
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
- // may make this easier to use in futue
- propagatingAdapter.addAdaptOnCreateFactory(new PageDirectiveWatcherFactory());
- // For JSPs, the ModelQueryAdapter must be "attached" to the document
- // before content is set in the model, so taglib initization can
- // take place.
- ((INodeNotifier) document).getAdapterFor(ModelQueryAdapter.class);
- //
- //
- }
-
- /**
- * This is "reinitialize" since there should always be at least the
- * default one assigned, before we start checking the stream
- */
- private void reInitializeEmbeddedType(IStructuredModel model, EmbeddedTypeHandler oldEmbeddedContentType, EmbeddedTypeHandler newEmbeddedContentType) throws IOException {
- // check program logic
- Assert.isNotNull(oldEmbeddedContentType, "Program error: invalid call during model initialization"); //$NON-NLS-1$
- // once we know the embedded content type, we need to set it in the
- // PageDirectiveAdapter ... the order of initialization is
- // critical here, the doc must have been created, but its contents not
- // set
- // yet,
- // and all factories must have been set up also.
- XMLModel domModel = (XMLModel) model;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- XMLDocument document = domModel.getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getExistingAdapter(PageDirectiveAdapter.class);
- // ==> // PropagatingAdapter propagatingAdapter = (PropagatingAdapter)
- // ((INodeNotifier)
- // document).getExistingAdapter(PropagatingAdapter.class);
- // ==> // ModelQueryAdapter modelQueryAdapter = (ModelQueryAdapter)
- // ((INodeNotifier)
- // document).getExistingAdapter(ModelQueryAdapter.class);
- oldEmbeddedContentType.uninitializeFactoryRegistry(model.getFactoryRegistry());
- oldEmbeddedContentType.uninitializeParser((JSPCapableParser) structuredDocument.getParser());
- // since 'document' is not recreated in this
- // reinit path, we need to remove all adapters,
- // except for the propagated adapters (including page
- // directive adapter, and model query adapter).
- // to accomplish this, we'll just remove all, then
- // add back with a call to pre-load adapt.
- // let clients decide to unload adapters from document
- // Collection oldAdapters = document.getAdapters();
- // Iterator oldAdaptersIterator = oldAdapters.iterator();
- // while (oldAdaptersIterator.hasNext()) {
- // INodeAdapter oldAdapter = (INodeAdapter)
- // oldAdaptersIterator.next();
- // if (oldAdapter != pageDirectiveAdapter && oldAdapter !=
- // propagatingAdapter && oldAdapter != modelQueryAdapter) {
- // // DO NOT remove directly!
- // // can change contents while in notifity loop!
- // //oldAdaptersIterator.remove();
- // document.removeAdapter(oldAdapter);
- // }
- // }
- // DMW: I believe something like the following is needed,
- // since releases cached adapters
- // if (document instanceof DocumentImpl) {
- // ((DocumentImpl) document).releaseDocumentType();
- // ((DocumentImpl) document).releaseStyleSheets();
- // }
- // remember, embedded type factories are automatically cleared when
- // embededType changed
- pageDirectiveAdapter.setEmbeddedType(newEmbeddedContentType);
- // // but still need to clear the page directive watchers, and let
- // them
- // be
- // rediscovered (with new, accurate node as target)
- // pageDirectiveAdapter.clearPageWatchers();
- if (newEmbeddedContentType != null) {
- newEmbeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
- newEmbeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
- }
- // adding language here, in this convienent central
- // location, but some obvious renaming or refactoring
- // wouldn't hurt, in future.
- // I needed to add this language setting for JSP Fragment support
- // Note: this is the one that counts, since at this point,
- // the model has an ID, so we can look up IFile, etc.
- String language = getLanguage(model);
- if (language != null && language.length() > 0) {
- pageDirectiveAdapter.setLanguage(language);
- }
- }
-
- private void setLanguageInPageDirective(IStructuredModel newModel) throws IOException {
- if (newModel instanceof XMLModel) {
- XMLDocument document = ((XMLModel) newModel).getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getAdapterFor(PageDirectiveAdapter.class);
- String language = getLanguage(newModel);
- pageDirectiveAdapter.setLanguage(language);
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterFactory.java
deleted file mode 100644
index c9091f1bd8..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterFactory.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.document;
-
-import org.eclipse.jst.jsp.core.PageDirectiveAdapter;
-import org.eclipse.wst.sse.core.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.ui.contentproperties.ContentSettingsChangeSubject;
-import org.eclipse.wst.sse.ui.util.Assert;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.w3c.dom.Node;
-
-/**
- * This class adapts document
- * with the an instance of PageDirectiveAdapter
- */
-public class PageDirectiveAdapterFactory extends AbstractAdapterFactory implements AdapterFactory {
-
-
- private PageDirectiveAdapter pageDirectiveAdapterInstance = null;
-
- /**
- * Constructor for PageDirectiveAdapterFactory.
- * Note: its important not to be a singleton, since
- * this factory needs to track its adapter(s) and release
- * them when they are released.
- *
- * @param adapterKey
- * @param registerAdapters
- */
- protected PageDirectiveAdapterFactory(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- /**
- * The no argument constructor assumes its a
- * Factory for PageDirectiveAdapter
- */
- public PageDirectiveAdapterFactory() {
- this(PageDirectiveAdapter.class, true);
- }
-
- protected INodeAdapter createAdapter(INodeNotifier target) {
- PageDirectiveAdapter result = null;
- if (target instanceof XMLNode) {
- XMLNode node = (XMLNode) target;
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- result = getAdapterInstance(target);
- ContentSettingsChangeSubject.getSubject().addListener(result);
-
- }
-
- }
- return result;
- }
-
- public void release() {
- if (pageDirectiveAdapterInstance != null) {
- ContentSettingsChangeSubject.getSubject().removeListener(pageDirectiveAdapterInstance);
- }
- }
-
- /**
- * We assume this is only called for 'document' target
- */
- protected PageDirectiveAdapter getAdapterInstance(INodeNotifier target) {
- // if our instance already exists with a different
- // target, then, somehow, the document node must
- // have changed for a model, so we should release
- // old adapter and create new one for new document
- // node. This is probably a programming error.
- if (pageDirectiveAdapterInstance != null) {
- if (target != pageDirectiveAdapterInstance.getTarget()) {
- release();
- pageDirectiveAdapterInstance = new PageDirectiveAdapterImpl(target);
- }
- // else return the one we have
- }
- else {
- // if is equal to null, create a new one
- pageDirectiveAdapterInstance = new PageDirectiveAdapterImpl(target);
- }
- Assert.isNotNull(pageDirectiveAdapterInstance);
- return pageDirectiveAdapterInstance;
- }
-
- public AdapterFactory copy() {
-
- return new PageDirectiveAdapterFactory(this.adapterKey, this.shouldRegisterAdapter);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
deleted file mode 100644
index b78e8d1aa9..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
+++ /dev/null
@@ -1,608 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.document;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jst.jsp.core.PageDirectiveAdapter;
-import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP;
-import org.eclipse.jst.jsp.core.modelhandler.EmbeddedTypeStateData;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistry;
-import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistryImpl;
-import org.eclipse.wst.sse.core.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.util.Debug;
-import org.eclipse.wst.sse.core.util.StringUtils;
-import org.eclipse.wst.xml.core.document.XMLNode;
-
-/**
- * This class has the responsibility to provide
- * an embedded factory registry for JSP Aware INodeAdapter Factories
- * to use.
- *
- * Typically, the embedded type is to be considered a feature of
- * the document, so JSP Aware AdpaterFactories should call
- * getAdapter(PageDirectiveAdapter.class) directoy on the document
- * (or owning document) node.
- */
-public class PageDirectiveAdapterImpl implements PageDirectiveAdapter {
-
- protected static final String STR_CHARSET = "charset"; //$NON-NLS-1$
- private final static Object adapterType = PageDirectiveAdapter.class;
- private IStructuredModel model;
- protected final String[] JAVASCRIPT_LANGUAGE_KEYS = new String[]{"javascript", "javascript1.0", "javascript1.1_3", "javascript1.2", "javascript1.3", "javascript1.4", "javascript1.5", "javascript1.6", "jscript", "sashscript"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- protected final String[] JAVA_LANGUAGE_KEYS = new String[]{"java"}; //$NON-NLS-1$
-
- /**
- * Constructor for PageDirectiveAdapterImpl.
- */
- public PageDirectiveAdapterImpl(INodeNotifier target) {
- super();
- notifierAtCreation = target;
- // we need to remember our instance of model,
- // in case we need to "signal" a re-init needed.
- if (target instanceof XMLNode) {
- XMLNode node = (XMLNode) target;
- model = node.getModel();
- }
-
- }
-
- /**
- * parses the full contentType value into its two parts
- * the contentType, and the charset, if present. Note: this
- * method is a lightly modified version of a method in AbstractHeadParser.
- * There, we're mostly interested in the charset part of contentTypeValue.
- * Here, we're mostly interested in the mimeType part.
- */
- private String getMimeTypeFromContentTypeValue(String contentTypeValue) {
- if (contentTypeValue == null)
- return null;
- String cleanContentTypeValue = StringUtils.stripNonLetterDigits(contentTypeValue);
- StringTokenizer tokenizer = new StringTokenizer(cleanContentTypeValue, ";= \t\n\r\f"); //$NON-NLS-1$
- int tLen = tokenizer.countTokens();
- // if contains encoding should have three tokens, the mimetype, the word 'charset', and the encoding value
- String[] tokens = new String[tLen];
- int j = 0;
- while (tokenizer.hasMoreTokens()) {
- tokens[j] = tokenizer.nextToken();
- j++;
- }
- //
- // Following is the common form for target expression
- // <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
- // But apparrently is also valid without the content type there,
- // just the charset, as follows:
- // <META http-equiv="Content-Type" content="charset=UTF-8">
- // So we'll loop through tokens and key off of 'charset'
-
- int charsetPos = -1;
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].equalsIgnoreCase(STR_CHARSET)) {
- charsetPos = i;
- break;
- }
- }
- //String charset = null;
- String contentType = null;
- if (charsetPos > -1) {
- // case where charset was present
- // int charsetValuePos = charsetPos + 1;
- // if (charsetValuePos < tokens.length) {
- // charset = tokens[charsetValuePos];
- // }
- int contentTypeValuePos = charsetPos - 1;
- if (contentTypeValuePos > -1) {
- contentType = tokens[contentTypeValuePos];
- }
- }
- else {
- // charset was not present, so if there's
- // a value, we assume its the contentType value
- if (tokens.length > 0) {
- contentType = tokens[0];
- }
- }
- return contentType;
- }
-
- private EmbeddedTypeHandler embeddedTypeHandler;
- private List embeddedFactoryRegistry = new ArrayList();
- private String cachedLanguage;
- private String cachedContentType;
- private INodeNotifier notifierAtCreation;
-
- private int firstLanguagePosition = -1;
- private int firstContentTypePosition = -1;
-
- private boolean reinitializing;
-
- /*
- * @see INodeAdapter#isAdapterForType(Object)
- */
- public boolean isAdapterForType(Object type) {
- return (type == adapterType);
- }
-
- /*
- * @see INodeAdapter#notifyChanged(INodeNotifier, int, Object, Object, Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- public void setEmbeddedType(EmbeddedTypeHandler handler) {
- // if really the same handler, no need for further processing
- if (embeddedTypeHandler == handler) {
- return;
- }
- // then one exists, and the new one is truely different, so we need to
- // release and remove current factories
- if (embeddedTypeHandler != null) {
- Iterator list = embeddedFactoryRegistry.iterator();
- while (list.hasNext()) {
- AdapterFactory factory = (AdapterFactory) list.next();
- factory.release();
- }
-
- embeddedFactoryRegistry.clear();
- }
-
- embeddedTypeHandler = handler;
- // when the handler is set, "transfer" its factories to our own list.
- // note: our own list may also be added to else where, such as on
- // "editor side".
- if (embeddedTypeHandler != null) {
- Iterator iterator = embeddedTypeHandler.getAdapterFactories().iterator();
- while (iterator.hasNext()) {
- AdapterFactory factory = (AdapterFactory) iterator.next();
- embeddedFactoryRegistry.add(factory);
- }
- }
- }
-
- /**
- * @see PageDirectiveAdapter#adapt(INodeNotifier, Object)
- */
- public INodeAdapter adapt(INodeNotifier notifier, Object type) {
- INodeAdapter result = null;
- // if embeddedContentType hasn't been set,
- // then we can not adapt it.
- if (embeddedTypeHandler != null) {
- if (embeddedFactoryRegistry != null) {
- Iterator iterator = embeddedFactoryRegistry.iterator();
- AdapterFactory factory = null;
- while (iterator.hasNext()) {
- factory = (AdapterFactory) iterator.next();
- if (factory.isFactoryForType(type)) {
- result = factory.adapt(notifier);
- break;
- }
- }
- }
- }
- return result;
-
- }
-
- /**
- * @see PageDirectiveAdapter#getEmbeddedType()
- */
- public EmbeddedTypeHandler getEmbeddedType() {
- if (embeddedTypeHandler == null) {
- embeddedTypeHandler = getDefaultEmbeddedType();
- }
- return embeddedTypeHandler;
- }
-
- public void addEmbeddedFactory(AdapterFactory factory) {
- // should we check if already exists in list?
- embeddedFactoryRegistry.add(factory);
- }
-
- // /**
- // * Used by PageDirectiveWatchers to signal that some important attribute has changed, and
- // * any cached values should be re-calcuated
- // */
- // void changed() {
- // // we won't actually check if change is needed, if the model state is already changing.
- // if (!model.isReinitializationNeeded()) {
- // // go through our list of page watcher adapters, and updates the attributes
- // // we're interested in, if and only if they are the earliest occurance in the resource
- // String potentialContentType = null;
- // String potentialLanguage = null;
- // int contentTypePosition = -1;
- // int languagePosition = -1;
- // Iterator iterator = pageDirectiveWatchers.iterator();
- // while (iterator.hasNext()) {
- // PageDirectiveWatcher pdWatcher = (PageDirectiveWatcher) iterator.next();
- // String contentType = pdWatcher.getContentType();
- // String language = pdWatcher.getLanguage();
- // int offset = pdWatcher.getOffset();
- // if (potentialContentType == null || (hasValue(contentType) && (offset < contentTypePosition))) {
- // potentialContentType = contentType;
- // contentTypePosition = offset;
- // }
- // }
- // // now we have the best candiates for cached values, let's see if they've really changed from
- // // what we had. If so, note we go through the setters so side effects can take place there.
- // potentialContentType = getMimeTypeFromContentTypeValue(potentialContentType);
- // if (potentialContentType == null || potentialContentType.length() == 0) {
- // //potentialContentType = getDefaultContentType();
- // } else {
- // setCachedContentType(potentialContentType);
- // }
- //
- // if (potentialLanguage != null && hasValue(potentialLanguage)) {
- // setCachedLanguage(potentialLanguage);
- // }
- // }
- // }
- void changedContentType(int elementOffset, String newValue) {
- // only need to process if this new value is
- // earlier in the file than our current value
- if (firstContentTypePosition == -1 || elementOffset <= firstContentTypePosition) {
- // dw_TODO: update embedded partitioner in JSP document partitioner
- // nsd_TODO: update embedded partitioner in JSP document partitioner
-
- // no need to change current value, if we're told some
- // earlier value is null or blank (sounds like an error, anyway)
- if (hasValue(newValue)) {
- firstContentTypePosition = elementOffset;
- String potentialContentType = getMimeTypeFromContentTypeValue(newValue);
- // only do the set processing if different
- // from what it already is
- // if (!potentialContentType.equalsIgnoreCase(cachedLanguage)) {
- setCachedContentType(potentialContentType);
- // }
- }
- }
- }
-
- /**
- * Used by PageDirectiveWatchers to signal that some important attribute has changed, and
- * any cached values should be re-calcuated
- */
- void changedLanguage(int elementOffset, String newValue) {
- // only need to process if this new value is
- // earlier in the file than our current value
- // has to be less than or equal to, in case our previous earliest one,
- // is itself changing!
- if (firstLanguagePosition == -1 || elementOffset <= firstLanguagePosition) {
-
- // no need to change current value, if we're told some
- // earlier value is null or blank (sounds like an error, anyway)
- if (hasValue(newValue)) {
- firstLanguagePosition = elementOffset;
- // only do the set processing if different
- // from what it already is
- if (!newValue.equalsIgnoreCase(cachedLanguage)) {
- setCachedLanguage(newValue);
- }
- }
-
- // dw_TODO: set language in document partitioner
- // nsd_TODO: set language in document partitioner
- }
- }
-
- /**
- * Used by PageDirectiveWatchers to signal that some important attribute has changed, and
- * any cached values should be re-calcuated
- */
- void changedPageEncoding(int elementOffset, String newValue) {
-
- // we don't currently track active value, since
- // just need during read and write (where its
- // calculated. We will need in future, to
- // acurately clone a model and to display
- // "current encoding" to user in status bar.
- }
-
- /**
- * Method hasValue.
- * @param contentType
- * @return boolean
- */
- private boolean hasValue(String value) {
- if (value != null && value.length() > 0)
- return true;
- else
- return false;
- }
-
- /**
- * Returns the cachedContentType.
- * @return String
- */
- public String getContentType() {
- if (cachedContentType == null) {
- cachedContentType = getDefaultContentType();
- }
- return cachedContentType;
- }
-
- /**
- * Method getDefaultContentType.
- * @return String
- */
- private String getDefaultContentType() {
- return "text/html"; //$NON-NLS-1$
- }
-
- /**
- * Returns the cachedLanguage.
- * @return String
- */
- public String getLanguage() {
- if (cachedLanguage == null)
- cachedLanguage = getDefaultLanguage();
- return cachedLanguage;
- }
-
- /**
- * Method getDefaultLanguage.
- * @return String
- */
- private String getDefaultLanguage() {
- return "java"; //$NON-NLS-1$
- }
-
- /**
- * Sets the cachedContentType.
- * @param cachedContentType The cachedContentType to set
- */
- public void setCachedContentType(String newContentType) {
- // if the passed in value is the same as existing, there's nothing to do.
- // if its different, then we need to change the contentHandler as well
- // and, more to the point, signal a re-initializtation is needed.
- // Note: if the value we're getting set to does not have a handler in the registry,
- // we'll actually not set it to null or anything, we'll just continue on with the one
- // we have. This is pretty important to avoid re-initializing on every key stroke if someone
- // is typing in a new content type, but haven't yet finished the whole "word".
- // However, if an contentType is not recognized, the registry returns the one
- // for XML.
- // if (this.cachedContentType != null && this.cachedContentType.equalsIgnoreCase(newContentType)) { // then do nothing
- // } else {
- this.cachedContentType = newContentType;
- // see if we can update embedded handler
- // if (this.cachedContentType == null || this.cachedContentType.length() == 0) { // do nothing, don't can't get a new handler, so we'll keep what we have
- // } else {
-
- // getHandler should always return something (never null), based
- // on the rules in the factory.
- EmbeddedTypeHandler handler = getHandlerFor(this.cachedContentType);
- // we do this check for re-init here, instead of in setEmbeddedType,
- // since setEmbeddedType is called during the normal initializtion
- // process, when re-init is not needed (since there is no content)
- if (embeddedTypeHandler != null && handler != null && embeddedTypeHandler != handler) {
- // changing this embedded handler here may
- // be in the middle of anotify loop, not sure
- // if that'll cause problems.
- setEmbeddedType(handler);
- modelReinitNeeded(embeddedTypeHandler, handler);
- }
- // }
-
- // }
-
- }
-
- /**
- * This method is used to re-init based on embeddedTypeHandler
- * changing. It is given priority over the language change, since
- * there its more important to have old and new handlers's in the
- * stateData field.
- */
- private void modelReinitNeeded(EmbeddedTypeHandler oldHandler, EmbeddedTypeHandler newHandler) {
- if (model.isReinitializationNeeded()) {
- System.out.println("already being initialized"); //$NON-NLS-1$
- }
-
- try {
- model.aboutToChangeModel();
- model.setReinitializeStateData(new EmbeddedTypeStateData(oldHandler, newHandler));
- model.setReinitializeNeeded(true);
- }
- finally {
- model.changedModel();
- }
- }
-
- /**
- * Method modelReinitNeeded.
- */
- private void modelReinitNeeded(String oldlanguage, String newLanguage) {
- // bit of a short cut for now .... we dont' need language at the moment,
- // but should set the state data
- if (model.isReinitializationNeeded()) {
- if (Debug.displayWarnings) {
- System.out.println("already being initialized"); //$NON-NLS-1$
- }
- }
- else {
- try {
- // if already being re-initialized, we don't want to
- // reset the data in the stateData field.
- model.aboutToChangeModel();
- model.setReinitializeStateData(newLanguage);
- model.setReinitializeNeeded(true);
- }
- finally {
- model.changedModel();
- }
- }
- }
-
- public void setCachedLanguage(String newLanguage) {
- if (cachedLanguage != null && languageStateChanged(cachedLanguage, newLanguage)) { // a complete re-init overkill in current system, since really just need for
- // the line style providers,
- // BUT, a change in language could effect other things,
- // and we don't expect to happen often so a little overkill isn't too bad.
- // The deep problem is that there is no way to get at the "edit side" adpapters
- // specifically here in model class.
- // we have to do the model changed sequence to get the
- // screen to update.
- // do not signal again, if signaled once (the reinit state data will be wrong.
- // (this needs to be improved in future)
- if (!model.isReinitializationNeeded()) {
- modelReinitNeeded(cachedLanguage, newLanguage);
- }
- }
- setLanguage(newLanguage);
- }
-
- /**
- * This is public access method, used especially
- * from loader, for JSP Fragment support.
- */
- public void setLanguage(String newLanguage) {
- this.cachedLanguage = newLanguage;
- IDocumentPartitioner partitioner = ((IDocumentExtension3) model.getStructuredDocument()).getDocumentPartitioner(IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING);
- if (partitioner instanceof StructuredTextPartitionerForJSP) {
- ((StructuredTextPartitionerForJSP) partitioner).setLanguage(newLanguage);
- }
- }
-
- /**
- * Method languageStateChange.
- * @param cachedLanguage
- * @param newLanguage
- * @return boolean
- */
- private boolean languageStateChanged(String cachedLanguage, String newLanguage) {
- boolean result = false; // languages are equal, then no change in state
- if (!cachedLanguage.equalsIgnoreCase(newLanguage)) {
- boolean oldLanguageKnown = languageKnown(cachedLanguage);
- boolean newLanguageKnown = languageKnown(newLanguage);
- result = newLanguageKnown || (!newLanguageKnown && oldLanguageKnown);
- }
- return result;
- }
-
- /**
- * Method languageKnown.
- * @param cachedLanguage
- * @return boolean
- */
- private boolean languageKnown(String language) {
- return (StringUtils.contains(JAVA_LANGUAGE_KEYS, language, false) || StringUtils.contains(JAVASCRIPT_LANGUAGE_KEYS, language, false));
- }
-
- private IFile getFile(IStructuredModel model) {
- String location = model.getBaseLocation();
- IPath path = new Path(location);
- if (!path.toFile().exists() && path.segmentCount() > 1) {
- return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- return null;
- }
-
- private EmbeddedTypeHandler getHandlerFor(String contentType) {
- EmbeddedTypeRegistry reg = getEmbeddedContentTypeRegistry();
- EmbeddedTypeHandler handler = null;
- if (reg != null)
- handler = reg.getTypeFor(contentType);
- return handler;
- }
-
- /**
- * Gets the embeddedContentTypeRegistry.
- * @return Returns a EmbeddedContentTypeRegistry
- */
- private EmbeddedTypeRegistry getEmbeddedContentTypeRegistry() {
- return EmbeddedTypeRegistryImpl.getInstance();
- }
-
- /**
- * For JSP files, text/html is the default
- * content type. This may want this different
- * for types like jsv (jsp for voice xml)
- * For now, hard code to new instance.
- * In future, should get instance from registry.
- *
- * Specification cites HTML as the default contentType.
- */
- protected EmbeddedTypeHandler getDefaultEmbeddedType() {
- return getHandlerFor(getDefaultContentType());
- }
-
- public void contentSettingsChanged(IResource resource) {
- // Note: we currently get notified multiple times,
- // I assume since there's mulitple fields in the properties.
- // For now, I'll assume that once we get notified, all the
- // fields are accurate, so if we're reinitializing, don't
- // check any further. To NOT do this causes concurrent modification
- // exceptions. To do it, may cause us to miss when user changes
- // two fields at once. Will need to test.
- if (reinitializing)
- return;
- if (resource == null)
- return;
- IFile file = getFile(model);
- if (file == null)
- return;
- // String filename = null;
- // if (resource.FILE == resource.getType()) {
- // filename = resource.getLocation().toString();
- // }
- IProject project = file.getProject();
- if (project == null)
- return;
- if (!project.equals(resource.getProject()))
- return;
- // Note: these change notifications appear to be coming
- // in based on any change in project. I'm not sure how
- // to tell if they are for my particular file, or
- // if there's some other error I'm making in listeners.
- // the setters below should be smart enough
- // to know if a meaningful change occurred, or
- // not. Note: we seem to get called a lot (for resources other than our own?)
- // with lots of 'null' values. The logic below may prevent the correct unsetting
- // of a property (such as changing from a language setting back to 'none').
- // We may need a 'none' id, or something, to help detect that case, since we can't
- // always assume the 'null' is accurate.
- }
-
- public INodeNotifier getTarget() {
- return notifierAtCreation;
- }
-
- public void release(Object type) {
- if (embeddedTypeHandler != null) {
- if (embeddedFactoryRegistry != null) {
- Iterator iterator = embeddedFactoryRegistry.iterator();
- AdapterFactory factory = null;
- while (iterator.hasNext()) {
- factory = (AdapterFactory) iterator.next();
- if (factory.isFactoryForType(type)) {
- factory.release();
- }
- }
- }
- }
-
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcher.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcher.java
deleted file mode 100644
index f0cd6b1bc1..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcher.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.document;
-
-import org.eclipse.wst.sse.core.INodeAdapter;
-
-interface PageDirectiveWatcher extends INodeAdapter {
-
- String getContentType();
-
- String getLanguage();
-
- int getOffset();
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherFactory.java
deleted file mode 100644
index 39c933bdf9..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherFactory.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.document;
-
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.PropagatingAdapterFactory;
-import org.eclipse.wst.xml.core.document.XMLElement;
-import org.eclipse.wst.xml.core.internal.propagate.PropagatingAdapterFactoryImpl;
-import org.w3c.dom.Node;
-
-public class PageDirectiveWatcherFactory extends PropagatingAdapterFactoryImpl implements PropagatingAdapterFactory {
-
- /**
- * Constructor for PageDirectiveWatcherFactory.
- */
- public PageDirectiveWatcherFactory() {
- this(PageDirectiveWatcher.class, true);
- }
-
- /**
- * Constructor for PageDirectiveWatcherFactory.
- * @param adapterKey
- * @param registerAdapters
- */
- public PageDirectiveWatcherFactory(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- protected INodeAdapter createAdapter(INodeNotifier target) {
- PageDirectiveWatcher result = null;
- if (target instanceof XMLElement) {
- XMLElement xmlElement = (XMLElement) target;
- if (xmlElement.getNodeType() == Node.ELEMENT_NODE) {
- // if (xmlElement.getNodeName() == JSP12Namespace.ElementName.DIRECTIVE_PAGE) { // not sure why identity to JSP11Namespace.ElementName.DIRECTIVE_PAGE doesn't work
- if (xmlElement.getNodeName().equals("jsp:directive.page")) { //$NON-NLS-1$
- result = new PageDirectiveWatcherImpl(xmlElement);
- }
-
- }
- }
- return result;
-
- }
-
- public AdapterFactory copy() {
- return new PageDirectiveWatcherFactory(this.adapterKey, this.shouldRegisterAdapter);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherImpl.java
deleted file mode 100644
index bb85d5c112..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherImpl.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.document;
-
-import org.eclipse.jst.jsp.core.PageDirectiveAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.xml.core.document.XMLDocument;
-import org.eclipse.wst.xml.core.document.XMLElement;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.internal.document.AttrImpl;
-
-
-
-/**
- * The responsibility of this class is to monitor page directives and if
- * a change in embedded type is is made, it will signal
- * the structuredModel that it needs to reinitialize itself.
- */
-class PageDirectiveWatcherImpl implements PageDirectiveWatcher {
-
- private static Object adapterType = PageDirectiveWatcher.class;
- XMLElement targetElement;
-
- /**
- * Constructor for PageDirectiveWatcherImpl.
- */
- public PageDirectiveWatcherImpl(XMLElement target) {
- super();
- targetElement = target;
- String contentTypeValue = target.getAttribute("contentType"); //$NON-NLS-1$
- if (contentTypeValue != null) {
- // using concrete class below, since "changed" is something of an internal method
- PageDirectiveAdapterImpl pageDirectiveAdapter = (PageDirectiveAdapterImpl) ((XMLDocument) targetElement.getOwnerDocument()).getAdapterFor(PageDirectiveAdapter.class);
- pageDirectiveAdapter.changedContentType(((IndexedRegion) targetElement).getStartOffset(), contentTypeValue);
- }
- String languageValue = target.getAttribute("language"); //$NON-NLS-1$
- if (languageValue != null) {
- // using concrete class below, since "changed" is something of an internal method
- PageDirectiveAdapterImpl pageDirectiveAdapter = (PageDirectiveAdapterImpl) ((XMLDocument) targetElement.getOwnerDocument()).getAdapterFor(PageDirectiveAdapter.class);
- pageDirectiveAdapter.changedLanguage(((IndexedRegion) targetElement).getStartOffset(), languageValue);
- }
-
-
- }
-
- /**
- * @see com.ibm.sse.model.INodeAdapter#isAdapterForType(Object)
- */
- public boolean isAdapterForType(Object type) {
- return (type == adapterType);
- }
-
- /**
- * @see com.ibm.sse.model.INodeAdapter#notifyChanged(INodeNotifier, int, Object, Object, Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // we should only be added to page directives, so if we see a page directive
- // change, we need to check its attributes, and notify the PageDirectiveAdapter when
- // certain ones chane, so it can make its "centralized" decisions.
- if (notifier instanceof XMLNode) {
-
- switch (eventType) {
- case INodeNotifier.CHANGE :
- if (changedFeature instanceof AttrImpl) {
- AttrImpl attribute = (AttrImpl) changedFeature;
- String name = attribute.getName();
- if (name.equals("contentType")) { //$NON-NLS-1$
- // using concrete class below, since "changed" is something of an internal method
- PageDirectiveAdapterImpl pageDirectiveAdapter = (PageDirectiveAdapterImpl) ((XMLDocument) targetElement.getOwnerDocument()).getAdapterFor(PageDirectiveAdapter.class);
- pageDirectiveAdapter.changedContentType(((IndexedRegion) targetElement).getStartOffset(), (String) newValue);
- }
- if (name.equals("language")) { //$NON-NLS-1$ //$NON-NLS-2$
- // using concrete class below, since "changed" is something of an internal method
- PageDirectiveAdapterImpl pageDirectiveAdapter = (PageDirectiveAdapterImpl) ((XMLDocument) targetElement.getOwnerDocument()).getAdapterFor(PageDirectiveAdapter.class);
- pageDirectiveAdapter.changedLanguage(((IndexedRegion) targetElement).getStartOffset(), (String) newValue);
- }
- }
-
- break;
- case INodeNotifier.REMOVE :
- //System.out.println("removed"+new Date().toString());
- break;
-
-
- default :
- break;
- }
- }
-
- }
-
- /**
- * @see com.ibm.sed.content.impl.PageDirectiveWatcher#getContentType()
- */
- public String getContentType() {
- String contentTypeValue = targetElement.getAttribute("contentType"); //$NON-NLS-1$
- return contentTypeValue;
- }
-
- /**
- * @see com.ibm.sed.content.impl.PageDirectiveWatcher#getLanguage()
- */
- public String getLanguage() {
- String languageValue = targetElement.getAttribute("language"); //$NON-NLS-1$
- return languageValue;
- }
-
- /**
- * @see com.ibm.sed.content.impl.PageDirectiveWatcher#getOffset()
- */
- public int getOffset() {
- return targetElement.getStartOffset();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/SetupParticipantForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/SetupParticipantForJSP.java
deleted file mode 100644
index 7595babd9a..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/SetupParticipantForJSP.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.document;
-
-import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP;
-
-/**
- * @deprecated - not used and will be removed in WTP 1.0M4
- */
-
-public class SetupParticipantForJSP implements IDocumentSetupParticipant {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
- */
- public void setup(IDocument document) {
- if (document != null) {
- IDocumentPartitioner partitioner = new StructuredTextPartitionerForJSP();
- document.setDocumentPartitioner(partitioner);
- partitioner.connect(document);
-
- // setup empty model here? coordinated via model manager?
-
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/CompilationUnitHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/CompilationUnitHelper.java
deleted file mode 100644
index dbc62cd065..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/CompilationUnitHelper.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.eclipse.jst.jsp.core.internal.java;
-
-import org.eclipse.jdt.core.WorkingCopyOwner;
-
-/**
- * To ensure there is only one instance of ProblemRequestor and WorkingCopyOwner
- * for JSP plugins. These were removed from JSPTranslation to ensure that the
- * JSPTranslation was not held in memory by any type of JDT lists (caching
- * search results, etc...)
- *
- * @author pavery
- */
-public class CompilationUnitHelper {
-
- private JSPProblemRequestor fProblemRequestor = null;
- private WorkingCopyOwner fWorkingCopyOwner = null;
- private static CompilationUnitHelper instance;
-
- private CompilationUnitHelper() {
- // force use of instance
- }
-
- public synchronized static final CompilationUnitHelper getInstance() {
-
- if (instance == null)
- instance = new CompilationUnitHelper();
- return instance;
- }
-
- public JSPProblemRequestor getProblemRequestor() {
-
- if (fProblemRequestor == null)
- fProblemRequestor = new JSPProblemRequestor();
- return fProblemRequestor;
- }
-
- public WorkingCopyOwner getWorkingCopyOwner() {
-
- if (fWorkingCopyOwner == null) {
- fWorkingCopyOwner = new WorkingCopyOwner() {
- public String toString() {
- return "JSP Working copy owner";
- }
- };
- }
- return fWorkingCopyOwner;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/EscapedTextUtil.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/EscapedTextUtil.java
deleted file mode 100644
index b9cf610548..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/EscapedTextUtil.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-
-
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-/**
- * class to handle chunks of text/regions
- * with escaped character data
- * @author pavery
- */
-public class EscapedTextUtil {
-
- public static Properties fXMLtoJavaLookup = null;
-
- /**
- * @return unescaped full text of that region, "" if there is no text
- */
- public static String getUnescapedText(IStructuredDocumentRegion parent, ITextRegion r) {
- String test = (parent != r) ? parent.getFullText(r) : parent.getFullText();
- return getUnescapedText(test);
- }
-
- public static String getUnescapedText(String test) {
- initLookup();
- StringBuffer buffer = new StringBuffer();
- if (test != null) {
- StringTokenizer st = new StringTokenizer(test, "&;", true); //$NON-NLS-1$
- String tok1, tok2, tok3, transString;
- while (st.hasMoreTokens()) {
- tok1 = tok2 = tok3 = transString = ""; //$NON-NLS-1$
- tok1 = st.nextToken();
- if (tok1.equals("&") && st.hasMoreTokens()) //$NON-NLS-1$
- {
- tok2 = st.nextToken();
- if (st.hasMoreTokens()) {
- tok3 = st.nextToken();
- }
- }
- if (!(transString = fXMLtoJavaLookup.getProperty(tok1 + tok2 + tok3, "")).equals("")) //$NON-NLS-2$ //$NON-NLS-1$
- {
- buffer.append(transString);
- }
- else {
- buffer.append(tok1 + tok2 + tok3);
- }
- }
- return buffer.toString();
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * initialize lookup tables
- */
- private static void initLookup() {
- fXMLtoJavaLookup = new Properties();
- fXMLtoJavaLookup.setProperty("&apos;", "'"); //$NON-NLS-2$ //$NON-NLS-1$
- fXMLtoJavaLookup.setProperty("&quot;", "\""); //$NON-NLS-2$ //$NON-NLS-1$
- fXMLtoJavaLookup.setProperty("&amp;", "&"); //$NON-NLS-2$ //$NON-NLS-1$
- fXMLtoJavaLookup.setProperty("&lt;", "<"); //$NON-NLS-2$ //$NON-NLS-1$
- fXMLtoJavaLookup.setProperty("&gt;", ">"); //$NON-NLS-2$ //$NON-NLS-1$
- fXMLtoJavaLookup.setProperty("&nbsp;", " "); //$NON-NLS-2$ //$NON-NLS-1$
- }
-
- /**
- * Get the String representation of an entity reference.
- */
- public static String translateEntityReference(String entity) {
- return fXMLtoJavaLookup.getProperty(entity, entity);
- }
-}
-
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IJSPTranslation.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IJSPTranslation.java
deleted file mode 100644
index cb79f3e1cd..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IJSPTranslation.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-import java.util.List;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-
-/**
- * An object that holds a translated JSP String along with
- * position mapping from Java to JSP, and JSP to Java.
- *
- * @author pavery
- *
- */
-public interface IJSPTranslation {
-
- /**
- * The string contents of the translated document.
- * @return the string contents of the translated document.
- */
- public String getJavaText();
-
- /**
- * The corresponding java offset in the translated document for a given jsp offset.
- * @param jspPosition
- * @return the java offset that maps to jspOffset, -1 if the position has no mapping.
- */
- public int getJavaOffset(int jspOffset);
-
- /**
- * The corresponding jsp offset in the source document for a given jsp offset in the translated document.
- * @param javaPosition
- * @return the jsp offset that maps to javaOffset, -1 if the position has no mapping.
- */
- public int getJspOffset(int javaOffset);
-
- /**
- * The corresponding CompilationUnit for the translated JSP document
- * @return an ICompilationUnit of the translation
- */
- public ICompilationUnit getCompilationUnit();
-
- /**
- * Returns the IJavaElements corresponding to the JSP range in the JSP StructuredDocument
- *
- * @param jspStart staring offset in the JSP document
- * @param jspEnd ending offset in the JSP document
- * @return IJavaElements corresponding to the JSP selection
- */
- public IJavaElement[] getElementsFromJspRange(int jspStart, int jspEnd);
-
- /**
- * Must be set true in order for problems to be collected during reconcile.
- * If set false, problems will be ignored during reconcile.
- * @param collect
- */
- public void setProblemCollectingActive(boolean collect);
-
- /**
- * Reconciles the compilation unit for this JSPTranslation
- */
- public void reconcileCompilationUnit();
-
- /**
- * @return the List of problems collected during reconcile of the compilation unit
- */
- public List getProblems();
-
- // add these API once finalized
- // getJspEdits(TextEdit javaEdit)
- // getJavaRanges()
- // getJavaDocument()
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSP2ServletNameUtil.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSP2ServletNameUtil.java
deleted file mode 100644
index cc9a91eff8..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSP2ServletNameUtil.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-import java.io.File;
-
-/**
- * @author pavery
- */
-public class JSP2ServletNameUtil {
-
- /**
- * WAS mangles Tom&Jerry as: _Tom_26_Jerry; this takes in the mangled name
- * and returns the original name.
- *
- * Unmangles the qualified type name. If an underscore is found
- * it is assumed to be a mangled representation of a non-alpha,
- * non-digit character of the form _NN_, where NN are hex digits
- * representing the encoded character. This routine converts it
- * back to the original character.
- */
- public final static String unmangle(String qualifiedTypeName) {
- if(qualifiedTypeName.charAt(0) != '_')
- return qualifiedTypeName;
-
- StringBuffer buf = new StringBuffer();
- String possible = "";
-
- // remove the .java extension if there is one
- if(qualifiedTypeName.endsWith(".java"))//$NON-NLS-1$
- qualifiedTypeName = qualifiedTypeName.substring(0, qualifiedTypeName.length() - 5);
-
- for(int i = 1; i < qualifiedTypeName.length(); i++) { // start at index 1 b/c 1st char is always '_'
- char c = qualifiedTypeName.charAt(i);
- if(c == '_') {
- int endIndex = qualifiedTypeName.indexOf('_', i+1);
- if(endIndex == -1)
- buf.append(c);
- else {
- char unmangled;
- try {
- possible = qualifiedTypeName.substring(i+1, endIndex);
- if(isValid(possible)) {
- unmangled = (char)Integer.decode("0x" + possible).intValue();//$NON-NLS-1$
- i = endIndex;
- }
- else {
- unmangled = c;
- }
-
- } catch(NumberFormatException e) {
- unmangled = c;
- }
- buf.append(unmangled);
- }
- } else {
- buf.append(c);
- }
- }
- return buf.toString();
- }
-
- /**
- * Determine if given string is a valid Hex representation of an ASCII character (eg. 2F -> /)
- * @param possible
- * @return
- */
- private static boolean isValid(String possible) {
- boolean result = false;
- if(possible.length() == 2){
- char c1 = possible.charAt(0);
- char c2 = possible.charAt(1);
- // 1st character must be a digit
- if(Character.isDigit(c1)) {
- // 2nd character must be digit or upper case letter A-F
- if(Character.isDigit(c2)) {
- result = true;
- }
- else if(Character.isUpperCase(c2) && (c2 == 'A' || c2 == 'B' || c2 == 'C'|| c2 == 'D'|| c2 == 'E'|| c2 == 'F')) {
- result = true;
- }
- }
- }
- return result;
- }
-
- /**
- * Mangle string to WAS-like specifications
- *
- */
- public final static String mangle(String name) {
- StringBuffer modifiedName = new StringBuffer();
-
- // extension (.jsp, .jspf, .jspx, etc...) should already be encoded in name
-
- int length = name.length();
- // in case name is forbidden (a number, class, for, etc...)
- modifiedName.append('_');
-
- // ensure rest of characters are valid
- for (int i=0; i< length; i++) {
- char currentChar = name.charAt(i);
- if (Character.isJavaIdentifierPart(currentChar) == true ) {
- modifiedName.append(currentChar);
- } else {
- modifiedName.append(mangleChar(currentChar));
- }
- }
- return modifiedName.toString();
-
- }
-
- /**
- * take a character and return its hex equivalent
- */
- private final static String mangleChar(char ch) {
- if ( ch == File.separatorChar ) {
- ch = '/';
- }
-
- if ( Character.isLetterOrDigit(ch) == true ) {
- return "" + ch; //$NON-NLS-1$
- }
- return "_" + Integer.toHexString(ch).toUpperCase() + "_"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java
deleted file mode 100644
index f5e2241a6b..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-
-
-/**
- * Extension of XMLJSPRegionHelper inteded to parse entire included JSP files.
- * Basically it expands the rules for what tags are parsed as JSP.
- *
- * @author pavery
- */
-class JSPIncludeRegionHelper extends XMLJSPRegionHelper {
- /**
- * @param JSPTranslator
- */
- public JSPIncludeRegionHelper(JSPTranslator translator) {
- super(translator);
- }
-
- // these methods determine what content gets added to the local scriplet, expression, declaration buffers
- /*
- * return true for elements whose contents we might want to add to the java file we are building
- */
- protected boolean isJSPStartRegion(IStructuredDocumentRegion sdRegion) {
- String type = sdRegion.getFirstRegion().getType();
- return type == XMLRegionContext.XML_TAG_OPEN || type == XMLJSPRegionContexts.JSP_DECLARATION_OPEN || type == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN || type == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN || type == XMLJSPRegionContexts.JSP_DIRECTIVE_OPEN || type == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME;
- }
-
- protected boolean isDeclaration(String tagName) {
- return tagName.equalsIgnoreCase("jsp:declaration") //$NON-NLS-1$
- || tagName.equalsIgnoreCase("<%!"); //$NON-NLS-1$
- }
-
- protected boolean isExpression(String tagName) {
- return tagName.equalsIgnoreCase("jsp:expression") //$NON-NLS-1$
- || tagName.equalsIgnoreCase("<%="); //$NON-NLS-1$
- }
-
- protected boolean isScriptlet(String tagName) {
- return tagName.equalsIgnoreCase("jsp:scriptlet") //$NON-NLS-1$
- || tagName.equalsIgnoreCase("<%"); //$NON-NLS-1$
- }
-
- protected boolean isIncludeDirective(String tagName) {
- return tagName.equalsIgnoreCase("jsp:directive.include") || //$NON-NLS-1$
- tagName.equalsIgnoreCase("include"); //$NON-NLS-1$
- }
-
- protected boolean isTaglibDirective(String tagName) {
- return tagName.equalsIgnoreCase("jsp:directive.taglib") //$NON-NLS-1$
- || tagName.equalsIgnoreCase("taglib"); //$NON-NLS-1$
- }
-
- protected boolean isPageDirective(String tagName) {
- return tagName.equalsIgnoreCase("jsp:directive.page") //$NON-NLS-1$
- || tagName.equalsIgnoreCase("page"); //$NON-NLS-1$
- }
-
- // different btwn XML-JSP and JSP tags
- protected String getRegionName(IStructuredDocumentRegion sdRegion) {
- ITextRegion nameRegion = null;
- String nameStr = ""; //$NON-NLS-1$
- int size = sdRegion.getRegions().size();
- if (size > 1) {
- // presumably XML-JSP <jsp:scriptlet> | <jsp:expression> | <jsp:declaration>
- nameRegion = sdRegion.getRegions().get(1);
- }
- else if (size == 1) {
- // presumably JSP open <% | <%= | <%!
- nameRegion = sdRegion.getRegions().get(0);
- }
- if (nameRegion != null)
- nameStr = fTextToParse.substring(sdRegion.getStartOffset(nameRegion), sdRegion.getTextEndOffset(nameRegion));
- return nameStr.trim();
- }
-
- protected void processOtherRegions(IStructuredDocumentRegion sdRegion) {
- processIncludeDirective(sdRegion);
- processPageDirective(sdRegion);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPProblemRequestor.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPProblemRequestor.java
deleted file mode 100644
index cf47682465..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPProblemRequestor.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.eclipse.jst.jsp.core.internal.java;
-
-/**
- * @author pavery
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.core.IProblemRequestor;
-import org.eclipse.jdt.core.compiler.IProblem;
-
-class JSPProblemRequestor implements IProblemRequestor {
-
- private boolean fIsActive = false;
-
- private boolean fIsRunning = false;
-
- private List fCollectedProblems;
-
- public void beginReporting() {
-
- fIsRunning = true;
- fCollectedProblems = new ArrayList();
- }
-
- public void acceptProblem(IProblem problem) {
-
- if (isActive())
- fCollectedProblems.add(problem);
- }
-
- public void endReporting() {
-
- fIsRunning = false;
- }
-
- public boolean isActive() {
-
- return fIsActive && fCollectedProblems != null;
- }
-
- /**
- * Sets the active state of this problem requestor.
- *
- * @param isActive
- * the state of this problem requestor
- */
- public void setIsActive(boolean isActive) {
-
- if (fIsActive != isActive) {
- fIsActive = isActive;
- if (fIsActive)
- startCollectingProblems();
- else
- stopCollectingProblems();
- }
- }
-
- /**
- * Tells this annotation model to collect temporary problems from now on.
- */
- private void startCollectingProblems() {
-
- fCollectedProblems = new ArrayList();
- }
-
- /**
- * Tells this annotation model to no longer collect temporary problems.
- */
- private void stopCollectingProblems() {
-
- // do nothing
- }
-
- /**
- * @return the list of collected problems
- */
- public List getCollectedProblems() {
-
- return fCollectedProblems;
- }
-
- public boolean isRunning() {
-
- return fIsRunning;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java
deleted file mode 100644
index f0d9f7b92e..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java
+++ /dev/null
@@ -1,561 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IBuffer;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.WorkingCopyOwner;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jst.jsp.core.internal.Logger;
-
-
-/**
- * <p>
- * An implementation of IJSPTranslation.
- * <br>
- * This object that holds the java translation of
- * a JSP file as well as a mapping of ranges from the translated Java to the JSP source,
- * and mapping from JSP source back to the translated Java.
- * </p>
- *
- * <p>
- * You may also use JSPTranslation to do CompilationUnit-esque things such as:
- * <ul>
- * <li>code select (get java elements for jsp selection)</li>
- * <li>reconcile</li>
- * <li>get java regions for jsp selection</li>
- * <li>get a JSP text edit based on a Java text edit</li>
- * <li>determine if a java offset falls within a jsp:useBean range</li>
- * <li>determine if a java offset falls within a jsp import statment</li>
- * </ul>
- * </p>
- *
- * @author pavery
- */
-public class JSPTranslation implements IJSPTranslation {
-
- // for debugging
- private static final boolean DEBUG;
- static {
- String value= Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jsptranslation"); //$NON-NLS-1$
- DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- /** the name of the class (w/out extension) **/
- private String fClassname = ""; //$NON-NLS-1$
- private IJavaProject fJavaProject = null;
- private HashMap fJava2JspMap = null;
- private HashMap fJsp2JavaMap = null;
- private HashMap fJava2JspImportsMap = null;
- private HashMap fJava2JspUseBeanMap = null;
- private HashMap fJava2JspIndirectMap = null;
-
- // don't want to hold onto model (via translator)
- // all relevant info is extracted in the constructor.
- //private JSPTranslator fTranslator = null;
- private String fJavaText = "";
- private String fJspText = "";
-
- private ICompilationUnit fCompilationUnit = null;
- private IProgressMonitor fProgressMonitor = null;
- /** lock to synchronize access to the compilation unit **/
- private byte[] fLock = null;
-
- public JSPTranslation(IJavaProject javaProj, JSPTranslator translator) {
-
- fLock = new byte[0];
- fJavaProject = javaProj;
- //fTranslator = translator;
-
- // can be null if it's an empty document (w/ NullJSPTranslation)
- if(translator != null) {
- fJavaText = translator.getTranslation().toString();
- fJspText = translator.getJspText();
- fClassname = translator.getClassname();
- fJava2JspMap = translator.getJava2JspRanges();
- fJsp2JavaMap = translator.getJsp2JavaRanges();
- fJava2JspImportsMap = translator.getJava2JspImportRanges();
- fJava2JspUseBeanMap = translator.getJava2JspUseBeanRanges();
- fJava2JspIndirectMap = translator.getJava2JspIndirectRanges();
- }
- }
-
- public IJavaProject getJavaProject() {
- return fJavaProject;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsp.core.internal.java.IJSPTranslation#getJavaText()
- */
- public String getJavaText() {
- //return (fTranslator != null) ? fTranslator.getTranslation().toString() : ""; //$NON-NLS-1$
- return fJavaText;
- }
-
- public String getJspText() {
- //return (fTranslator != null) ? fTranslator.getJspText() : ""; //$NON-NLS-1$
- return fJspText;
- }
-
- public String getJavaPath() {
- // create if necessary
- ICompilationUnit cu = getCompilationUnit();
- return (cu != null) ? cu.getPath().toString() : ""; //$NON-NLS-1$
- }
-
- /**
- *
- * @return the corresponding Java offset for a give JSP offset
- */
- public int getJavaOffset(int jspOffset) {
- int result = -1;
- int offsetInRange = 0;
- Position jspPos, javaPos = null;
-
- // iterate all mapped jsp ranges
- Iterator it = fJsp2JavaMap.keySet().iterator();
- while (it.hasNext()) {
- jspPos = (Position) it.next();
- // need to count the last position as included
- if (!jspPos.includes(jspOffset) && !(jspPos.offset+jspPos.length == jspOffset))
- continue;
-
- offsetInRange = jspOffset - jspPos.offset;
- javaPos = (Position) fJsp2JavaMap.get(jspPos);
- if(javaPos != null)
- result = javaPos.offset + offsetInRange;
- else {
-
- Logger.log(Logger.ERROR, "JavaPosition was null!" + jspOffset); //$NON-NLS-1$
- }
- break;
- }
- return result;
- }
-
- /**
- *
- * @return the corresponding JSP offset for a give Java offset
- */
- public int getJspOffset(int javaOffset) {
- int result = -1;
- int offsetInRange = 0;
- Position jspPos, javaPos = null;
-
- // iterate all mapped java ranges
- Iterator it = fJava2JspMap.keySet().iterator();
- while (it.hasNext()) {
- javaPos = (Position) it.next();
- // need to count the last position as included
- if (!javaPos.includes(javaOffset) && !(javaPos.offset+javaPos.length == javaOffset))
- continue;
-
- offsetInRange = javaOffset - javaPos.offset;
- jspPos = (Position) fJava2JspMap.get(javaPos);
-
- if(jspPos != null)
- result = jspPos.offset + offsetInRange;
- else {
- Logger.log(Logger.ERROR, "jspPosition was null!" + javaOffset); //$NON-NLS-1$
- }
- break;
- }
-
- return result;
- }
-
- /**
- *
- * @return a map of Positions in the Java document to corresponding Positions in the JSP document
- */
- public HashMap getJava2JspMap() {
- return fJava2JspMap;
- }
-
- /**
- *
- * @return a map of Positions in the JSP document to corresponding Positions in the Java document
- */
- public HashMap getJsp2JavaMap() {
- return fJsp2JavaMap;
- }
-
- /**
- * Checks if the specified java range covers more than one partition in the JSP file.
- *
- * <p>
- * ex.
- * <code>
- * <%
- * if(submit)
- * {
- * %>
- * <p> print this...</p>
- *
- * <%
- * }
- * else
- * {
- * %>
- * <p> print that...</p>
- * <%
- * }
- * %>
- * </code>
- * </p>
- *
- * the if else statement above spans 3 JSP partitions, so it would return true.
- * @param offset
- * @param length
- * @return <code>true</code> if the java code spans multiple JSP partitions, otherwise false.
- */
- public boolean javaSpansMultipleJspPartitions(int javaOffset, int javaLength) {
- HashMap java2jsp = getJava2JspMap();
- int count = 0;
- Iterator it = java2jsp.keySet().iterator();
- Position javaRange = null;
- while(it.hasNext()) {
- javaRange = (Position)it.next();
- if(javaRange.overlapsWith(javaOffset, javaLength))
- count++;
- if(count > 1)
- return true;
- }
- return false;
- }
-
- /**
- * Returns the Java positions for the given range in the Java document.
- *
- * @param offset
- * @param length
- * @return
- */
- public Position[] getJavaRanges(int offset, int length) {
-
- List results = new ArrayList();
- Iterator it = getJava2JspMap().keySet().iterator();
- Position p = null;
- while(it.hasNext()) {
- p = (Position)it.next();
- if(p.overlapsWith(offset, length))
- results.add(p);
- }
- return (Position[])results.toArray(new Position[results.size()]);
- }
-
- /**
- * Indicates if the java Offset falls within the user import ranges
- * @param javaOffset
- * @return true if the java Offset falls within the user import ranges, otherwise false
- */
- public boolean isImport(int javaOffset) {
- return isInRanges(javaOffset, fJava2JspImportsMap);
- }
-
- /**
- * Indicates if the java offset falls within the use bean ranges
- * @param javaOffset
- * @return true if the java offset falls within the user import ranges, otherwise false
- */
- public boolean isUseBean(int javaOffset) {
- return isInRanges(javaOffset, fJava2JspUseBeanMap);
- }
-
- /**
- * @param javaPos
- * @return
- */
- public boolean isIndirect(int javaOffset) {
- return isInRanges(javaOffset, fJava2JspIndirectMap, false);
- }
-
- private boolean isInRanges(int javaOffset, HashMap ranges) {
- return isInRanges(javaOffset, ranges, true);
- }
- /**
- * Tells you if the given offset is included in any of the ranges (Positions) passed in.
- * includeEndOffset tells whether or not to include the end offset of each range in the test.
- *
- * @param javaOffset
- * @param ranges
- * @param includeEndOffset
- * @return
- */
- private boolean isInRanges(int javaOffset, HashMap ranges, boolean includeEndOffset) {
-
- Iterator it = ranges.keySet().iterator();
- while(it.hasNext()) {
- Position javaPos = (Position)it.next();
- // also include the start and end offset (only if requested)
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81687
- if(javaPos.includes(javaOffset) || (includeEndOffset && javaPos.offset+javaPos.length == javaOffset))
- return true;
- }
- return false;
- }
-
- /**
- * Return the Java CompilationUnit associated with this JSPTranslation (this particular model)
- * When using methods on the CU, it's reccomended to synchronize on the CU for reliable
- * results.
- *
- * The method is synchronized to ensure that <code>createComplilationUnit</code> doesn't
- * get entered 2 or more times simultaneously. A side effect of that is 2 compilation units
- * can be created in the JavaModelManager, but we only hold one reference to it in
- * fCompilationUnit. This would lead to a leak since only one instance of the CU is
- * discarded in the <code>release()</code> method.
- *
- * @return a CompilationUnit representation of this JSPTranslation
- */
- public ICompilationUnit getCompilationUnit() {
- synchronized(fLock) {
- try {
- if (fCompilationUnit == null) {
- fCompilationUnit = createCompilationUnit();
- }
- }
- catch (JavaModelException jme) {
- if(DEBUG)
- Logger.logException("error creating JSP working copy... ", jme); //$NON-NLS-1$
- }
- }
- return fCompilationUnit;
- }
-
- /**
- * Originally from ReconcileStepForJava. Creates an ICompilationUnit from the contents of the JSP document.
- *
- * @return an ICompilationUnit from the contents of the JSP document
- */
- private ICompilationUnit createCompilationUnit() throws JavaModelException {
-
- IPackageFragment packageFragment = null;
- IJavaElement je = getJavaProject();
-
- if (je == null || !je.exists())
- return null;
-
- switch (je.getElementType()) {
- case IJavaElement.PACKAGE_FRAGMENT :
- je = je.getParent();
- // fall through
-
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) je;
- packageFragment = packageFragmentRoot.getPackageFragment(IPackageFragmentRoot.DEFAULT_PACKAGEROOT_PATH);
- break;
-
- case IJavaElement.JAVA_PROJECT :
- IJavaProject jProject = (IJavaProject) je;
-
- if (!jProject.exists()) {
- if(DEBUG) {
- System.out.println("** Abort create working copy: cannot create working copy: JSP is not in a Java project");
- }
- return null;
- }
-
- packageFragmentRoot = null;
- IPackageFragmentRoot[] packageFragmentRoots = jProject.getPackageFragmentRoots();
- int i = 0;
- while (i < packageFragmentRoots.length) {
- if (!packageFragmentRoots[i].isArchive() && !packageFragmentRoots[i].isExternal()) {
- packageFragmentRoot = packageFragmentRoots[i];
- break;
- }
- i++;
- }
- if (packageFragmentRoot == null) {
- if(DEBUG) {
- System.out.println("** Abort create working copy: cannot create working copy: JSP is not in a Java project with source package fragment root");
- }
- return null;
- }
- packageFragment = packageFragmentRoot.getPackageFragment(IPackageFragmentRoot.DEFAULT_PACKAGEROOT_PATH);
- break;
-
- default :
- return null;
- }
-
- ICompilationUnit cu = packageFragment.getCompilationUnit(getClassname() + ".java").getWorkingCopy(getWorkingCopyOwner(), getProblemRequestor(), getProgressMonitor()); //$NON-NLS-1$
- setContents(cu);
-
- if(DEBUG) {
- System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
- System.out.println("(+) JSPTranslation ["+ this + "] finished creating CompilationUnit: " + cu);
- System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
- }
-
- return cu;
- }
-
- /**
- *
- * @return the problem requestor for the CompilationUnit in this JSPTranslation
- */
- private JSPProblemRequestor getProblemRequestor() {
- return CompilationUnitHelper.getInstance().getProblemRequestor();
- }
-
- /**
- *
- * @return the IWorkingCopyOwner for this CompilationUnit in this JSPTranslation
- */
- public WorkingCopyOwner getWorkingCopyOwner() {
- return CompilationUnitHelper.getInstance().getWorkingCopyOwner();
- }
-
- /**
- *
- * @return the progress monitor used in long operations (reconcile, creating the CompilationUnit...) in this JSPTranslation
- */
- private IProgressMonitor getProgressMonitor() {
- if (fProgressMonitor == null)
- fProgressMonitor = new NullProgressMonitor();
- return fProgressMonitor;
- }
-
- /**
- *
- * @return the List of problems collected during reconcile of the compilation unit
- */
- public List getProblems() {
- List problems = getProblemRequestor().getCollectedProblems();
- return problems != null ? problems : new ArrayList();
- }
-
- /**
- * Must be set true in order for problems to be collected during reconcile.
- * If set false, problems will be ignored during reconcile.
- * @param collect
- */
- public void setProblemCollectingActive(boolean collect) {
- ICompilationUnit cu = getCompilationUnit();
- if(cu != null) {
- getProblemRequestor().setIsActive(collect);
- }
- }
-
- /**
- * Reconciles the compilation unit for this JSPTranslation
- */
- public void reconcileCompilationUnit() {
- ICompilationUnit cu = getCompilationUnit();
- if (cu != null) {
- try {
- synchronized(cu) {
- cu.makeConsistent(getProgressMonitor());
- cu.reconcile(ICompilationUnit.NO_AST, true, getWorkingCopyOwner(), getProgressMonitor());
- }
- }
- catch (JavaModelException e) {
- Logger.logException(e);
- }
- }
- }
-
- /**
- * Set contents of the compilation unit to the translated jsp text.
- * @param the ICompilationUnit on which to set the buffer contents
- */
- private void setContents(ICompilationUnit cu) {
- if (cu == null)
- return;
-
- synchronized (cu) {
- IBuffer buffer;
- try {
-
- buffer = cu.getBuffer();
- }
- catch (JavaModelException e) {
- e.printStackTrace();
- buffer = null;
- }
-
- if (buffer != null)
- buffer.setContents(getJavaText());
- }
- }
-
- /**
- * Returns the IJavaElements corresponding to the JSP range in the JSP StructuredDocument
- *
- * @param jspStart staring offset in the JSP document
- * @param jspEnd ending offset in the JSP document
- * @return IJavaElements corresponding to the JSP selection
- */
- public IJavaElement[] getElementsFromJspRange(int jspStart, int jspEnd) {
-
- int javaPositionStart = getJavaOffset(jspStart);
- int javaPositionEnd = getJavaOffset(jspEnd);
-
- IJavaElement[] EMTPY_RESULT_SET = new IJavaElement[0];
- IJavaElement[] result = EMTPY_RESULT_SET;
- try {
- ICompilationUnit cu = getCompilationUnit();
- if (cu != null && cu.getBuffer().getLength() > 0 && javaPositionStart > 0 && javaPositionEnd >= javaPositionStart) {
- synchronized (cu) {
- result = cu.codeSelect(javaPositionStart, javaPositionEnd - javaPositionStart);
- }
- }
-
- if (result == null || result.length == 0)
- return EMTPY_RESULT_SET;
- }
- catch (JavaModelException x) {
- Logger.logException(x);
- }
-
- return result;
- }
-
- public String getClassname() {
- return fClassname;
- }
-
- /**
- * Must discard compilation unit, or else they can leak in the JavaModelManager
- */
- public void release() {
-
- synchronized(fLock) {
- if(fCompilationUnit != null) {
- try {
- if(DEBUG) {
- System.out.println("------------------------------------------------------------------");
- System.out.println("(-) JSPTranslation [" + this +"] discarding CompilationUnit: " + fCompilationUnit);
- System.out.println("------------------------------------------------------------------");
- }
- fCompilationUnit.discardWorkingCopy();
- }
- catch (JavaModelException e) {
- // we're done w/ it anyway
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java
deleted file mode 100644
index 8873a28aca..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.eclipse.wst.xml.core.document.XMLNode;
-
-/**
- * An adapter for getting a JSPTranslation of the document.
- *
- * @author pavery
- */
-public class JSPTranslationAdapter implements INodeAdapter, IDocumentListener {
-
- // for debugging
- private static final boolean DEBUG;
- static {
- String value= Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jsptranslation"); //$NON-NLS-1$
- DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private IDocument fJspDocument = null;
- private IDocument fJavaDocument = null;
- private JSPTranslationExtension fJSPTranslation = null;
- private boolean fDocumentIsDirty = true;
- private XMLModel fXMLModel;
- private JSPTranslator fTranslator = null;
- private NullProgressMonitor fTranslationMonitor = null;
-
- public JSPTranslationAdapter(XMLModel xmlModel) {
- setXMLModel(xmlModel);
- initializeJavaPlugins();
- }
-
- /**
- * Initialize the required Java Plugins
- */
- protected void initializeJavaPlugins() {
- JavaCore.getPlugin();
- }
-
- /**
- * @see com.ibm.sse.model.INodeAdapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- return type.equals(IJSPTranslation.class);
- }
-
- /**
- * @see com.ibm.sse.model.INodeAdapter#notifyChanged(com.ibm.sse.model.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // nothing to do
- }
-
- /**
- * Automatically set through the setXMLModel(XMLModel)
- *
- * @param doc
- */
- private void setDocument(IDocument doc) {
- if (fJspDocument != null)
- fJspDocument.removeDocumentListener(this);
- if (doc != null) {
- doc.addDocumentListener(this);
- fJspDocument = doc;
- }
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- // do nothing
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent event) {
- // mark translation for rebuilding
- fDocumentIsDirty = true;
- }
-
- /**
- * @see com.ibm.sse.editor.IReleasable#release()
- */
- public void release() {
-
- if(fJspDocument != null)
- fJspDocument.removeDocumentListener(this);
-
- if(fTranslationMonitor != null)
- fTranslationMonitor.setCanceled(true);
-
- if(fJSPTranslation != null) {
-
- if(DEBUG)
- System.out.println("JSPTranslationAdapter releasing:" + fJSPTranslation);
-
- fJSPTranslation.release();
- }
- }
-
- /**
- * Returns the JSPTranslation for this adapter.
- *
- * @see com.ibm.sse.editor.jsp.java.JSPTranslation
- * @return a JSPTranslationExtension
- */
- public synchronized JSPTranslationExtension getJSPTranslation() {
-
- if (fJSPTranslation == null || fDocumentIsDirty) {
- JSPTranslator translator = null;
- if (getXMLModel() != null && getXMLModel().getIndexedRegion(0) != null) {
- translator = getTranslator((XMLNode) getXMLModel().getIndexedRegion(0));
- translator.translate();
- StringBuffer javaContents = translator.getTranslation();
- fJavaDocument = new Document(javaContents.toString());
-
- }
- else {
- // empty document case
- translator = new JSPTranslator();
- StringBuffer emptyContents = translator.getEmptyTranslation();
- fJavaDocument = new Document(emptyContents.toString());
- }
- // it's going to be rebuilt, so we release it here
- if(fJSPTranslation != null) {
- if(DEBUG)
- System.out.println("JSPTranslationAdapter releasing:" + fJSPTranslation);
- fJSPTranslation.release();
- }
- fJSPTranslation = new JSPTranslationExtension(getXMLModel().getStructuredDocument(), fJavaDocument, getJavaProject(), translator);
- fDocumentIsDirty = false;
- }
- return fJSPTranslation;
- }
-
- /**
- * Returns the JSPTranslator for this adapter. If it's null, a new
- * translator is created with the xmlNode. Otherwise the
- * translator.reset(xmlNode) is called to reset the current local
- * translator.
- *
- * @param xmlNode
- * the first node of the JSP document to be translated
- * @return the JSPTranslator for this adapter (creates if null)
- */
- private JSPTranslator getTranslator(XMLNode xmlNode) {
- if (fTranslator == null) {
- fTranslationMonitor = new NullProgressMonitor();
- fTranslator = new JSPTranslator();
- fTranslator.reset(xmlNode, fTranslationMonitor);
- }
- else
- fTranslator.reset(xmlNode, fTranslationMonitor);
- return fTranslator;
- }
-
- /**
- * set the XMLModel for this adapter. Must be called.
- *
- * @param xmlModel
- */
- public void setXMLModel(XMLModel xmlModel) {
- fXMLModel = xmlModel;
- setDocument(fXMLModel.getStructuredDocument());
- }
-
- /**
- * @return the XMLModel for this adapter.
- */
- public XMLModel getXMLModel() {
- return fXMLModel;
- }
-
- /**
- * Gets (or creates via JavaCore) a JavaProject based on the location of
- * this adapter's XMLModel. Returns null for non IFile based models.
- *
- * @return the java project where
- */
- public IJavaProject getJavaProject() {
-
- IJavaProject javaProject = null;
- try {
- String baseLocation = getXMLModel().getBaseLocation();
- // 20041129 (pa) the base location changed for xml model
- // because of FileBuffers, so this code had to be updated
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=79686
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IPath filePath = new Path(baseLocation);
- IFile file = null;
- IProject project = null;
- if (filePath.segmentCount() > 1) {
- file = root.getFile(filePath);
- }
- if (file != null) {
- project = file.getProject();
- }
-// IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(baseLocation));
-// for (int i = 0; project == null && i < files.length; i++) {
-// if (files[i].getType() != IResource.PROJECT) {
-// project = files[i].getProject();
-// break;
-// }
-// }
- if(project != null) {
- javaProject = JavaCore.create(project);
- }
- }
- catch (Exception ex) {
- if (getXMLModel() != null)
- Logger.logException("(JSPTranslationAdapter) problem getting java project from the XMLModel's baseLocation > " + getXMLModel().getBaseLocation(), ex); //$NON-NLS-1$
- else
- Logger.logException("(JSPTranslationAdapter) problem getting java project", ex); //$NON-NLS-1$
- }
- return javaProject;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapterFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapterFactory.java
deleted file mode 100644
index 32095cf622..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapterFactory.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.xml.core.document.XMLNode;
-
-/**
- * Factory for JSPTranslationAdapters.
- *
- * @author pavery
- *
- */
-public class JSPTranslationAdapterFactory extends AbstractAdapterFactory {
-
- private JSPTranslationAdapter fAdapter = null;
-
- // for debugging
- private static final boolean DEBUG;
- static {
- String value= Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jsptranslation"); //$NON-NLS-1$
- DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- public JSPTranslationAdapterFactory() {
- super();
- }
-
- /**
- * @see com.ibm.sse.model.AdapterFactory#copy()
- */
- public AdapterFactory copy() {
- return new JSPTranslationAdapterFactory();
- }
-
- protected INodeAdapter createAdapter(INodeNotifier target) {
- if (target instanceof XMLNode && fAdapter == null) {
- fAdapter = new JSPTranslationAdapter(((XMLNode) target).getModel());
- if(DEBUG) {
- System.out.println("(+) JSPTranslationAdapterFactory [" + this + "] created adapter: " + fAdapter);
- }
- }
- return fAdapter;
- }
-
- /**
- * @see com.ibm.sse.model.AbstractAdapterFactory#isFactoryForType(java.lang.Object)
- */
-
- public boolean isFactoryForType(Object type) {
- return type.equals(IJSPTranslation.class);
- }
-
- /**
- * @see com.ibm.sse.model.AbstractAdapterFactory#release()
- */
- public void release() {
- if (fAdapter != null) {
- if(DEBUG) {
- System.out.println("(-) JSPTranslationAdapterFactory [" + this + "] releasing adapter: " + fAdapter);
- }
- fAdapter.release();
- }
- super.release();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
deleted file mode 100644
index 5ca51fa79f..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.text.edits.DeleteEdit;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-
-
-/**
- * Adds the notion of IDocuments (jsp Document and java Document)
- * Used for TextEdit translation
- * @author pavery
- */
-public class JSPTranslationExtension extends JSPTranslation {
-
- // for debugging
- private static final boolean DEBUG;
- static {
- String value= Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jsptranslation"); //$NON-NLS-1$
- DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- // just a convenience data structure
- // to keep track of java position deltas
- private class PositionDelta {
-
- public boolean isDeleted = false;
- public int preOffset = 0;
- public int preLength = 0;
- public int postOffset = 0;
- public int postLength = 0;
-
- public PositionDelta(int preOffset, int preLength) {
- this.preOffset = preOffset;
- this.preLength = preLength;
- }
- public void setPostEditData(int postOffset, int postLength, boolean isDeleted) {
- this.postOffset = postOffset;
- this.postLength = postLength;
- this.isDeleted = isDeleted;
- }
- }
-
- private IDocument fJspDocument = null;
- private IDocument fJavaDocument = null;
-
- public JSPTranslationExtension(IDocument jspDocument, IDocument javaDocument, IJavaProject javaProj, JSPTranslator translator) {
- super(javaProj, translator);
- fJspDocument = jspDocument;
- fJavaDocument = javaDocument;
-
- // make sure positions are added to Java and JSP documents
- // this is necessary for text edits
- addPositionsToDocuments();
- }
-
- public IDocument getJspDocument() {
- return fJspDocument;
- }
-
- public IDocument getJavaDocument() {
- return fJavaDocument;
- }
-
- public String getJavaText() {
- return getJavaDocument() != null ? getJavaDocument().get() : ""; //$NON-NLS-1$
- }
-
- /**
- * Returns a corresponding TextEdit for the JSP file given a TextEdit for a Java file.
- * Note: This method actually applies the Java edit to the internal Java document.
- *
- * @param javaEdit
- * @return the corresponding JSP edits (not applied to the document yet)
- */
- public TextEdit getJspEdit(TextEdit javaEdit) {
-
- List jspEdits = new ArrayList();
-
- int offset = javaEdit.getOffset();
- int length = javaEdit.getLength();
-
- if(javaEdit instanceof MultiTextEdit && javaEdit.getChildren().length > 0) {
-
- IRegion r = TextEdit.getCoverage(getAllEdits(javaEdit));
- offset = r.getOffset();
- length = r.getLength();
- }
-
- // get java ranges that will be affected by the edit
- Position[] javaPositions = getJavaRanges(offset, length);
-
- // record position data before the change
- Position[] jspPositions = new Position[javaPositions.length];
- PositionDelta[] deltas = new PositionDelta[javaPositions.length];
- for(int i=0; i<javaPositions.length; i++) {
- deltas[i] = new PositionDelta(javaPositions[i].offset, javaPositions[i].length);
- // isIndirect means the position doesn't actually exist as exact text
- // mapping from java <-> jsp (eg. an import statement)
- if(!isIndirect(javaPositions[i].offset))
- jspPositions[i] = (Position)getJava2JspMap().get(javaPositions[i]);
- }
-
- if(DEBUG) {
- System.out.println("================================================");
- System.out.println("deltas:");
- String javaText = getJavaText();
- for(int i=0; i<deltas.length; i++)
- System.out.println("pos[" + deltas[i].preOffset + ":" + deltas[i].preLength + "]" + javaText.substring(deltas[i].preOffset, deltas[i].preOffset + deltas[i].preLength) );
- System.out.println("===============================================");
- }
-
- // apply the edit to the java document
- try {
- javaEdit.apply(getJavaDocument());
- } catch (MalformedTreeException e) {
- Logger.logException(e);
- } catch (BadLocationException e) {
- Logger.logException(e);
- }
- // now at this point Java positions are unreliable since they were updated after applying java edit.
-
- String newJavaText = getJavaDocument().get();
- if(DEBUG)
- System.out.println("java post format text:\n" + newJavaText); //$NON-NLS-1$
-
- // record post edit data
- for(int i=0; i<javaPositions.length; i++)
- deltas[i].setPostEditData(javaPositions[i].offset, javaPositions[i].length, javaPositions[i].isDeleted);
-
- // create appropriate text edits for deltas
- Position jspPos = null;
- String replaceText = ""; //$NON-NLS-1$
- for(int i=0; i<deltas.length; i++) {
- jspPos = jspPositions[i];
- // can be null if it's an indirect mapping position
- // or if something was added into java that was not originally in JSP (like a new import...)
-
- if(jspPos != null) {
- if(deltas[i].isDeleted) {
- jspEdits.add(new DeleteEdit(jspPos.offset, jspPos.length));
- }
- else {
- replaceText = newJavaText.substring(deltas[i].postOffset, deltas[i].postOffset + deltas[i].postLength);
- jspEdits.add(new ReplaceEdit(jspPos.offset, jspPos.length, replaceText));
- }
- if(DEBUG)
- debugReplace(deltas, jspPos, replaceText, i);
- }
- else {
- // the new Java text has no corresponding JSP position
- // possible new import?
- if(isImport(javaPositions[i].getOffset()) && replaceText.lastIndexOf("import ") != -1) { //$NON-NLS-1$
- replaceText = newJavaText.substring(deltas[i].postOffset, deltas[i].postOffset + deltas[i].postLength);
- String importText = replaceText.substring(replaceText.lastIndexOf("import "), replaceText.indexOf(";")); //$NON-NLS-1$ //$NON-NLS-2$
- // evenutally need to check if it's XML-JSP
- importText = "<%@page import=\"" + importText + "\" %>\n"; //$NON-NLS-1$ //$NON-NLS-2$
- jspEdits.add(new InsertEdit(0, importText));
- }
- }
- }
- return createMultiTextEdit((TextEdit[])jspEdits.toArray(new TextEdit[jspEdits.size()]));
- }
-
-
- /**
- * Combines an array of edits into one MultiTextEdit (with the appropriate coverage region)
- * @param edits
- * @return
- */
- private TextEdit createMultiTextEdit(TextEdit[] edits) {
-
- if(edits.length == 0)
- return new MultiTextEdit();
-
- IRegion region = TextEdit.getCoverage(edits);
- MultiTextEdit multiEdit = new MultiTextEdit(region.getOffset(), region.getLength());
- for (int i = 0; i < edits.length; i++) {
- addToMultiEdit(edits[i], multiEdit);
- }
- return multiEdit;
- }
-
-
- private void addToMultiEdit(TextEdit edit, MultiTextEdit multiEdit) {
-
- // check for overlap here
- // discard overlapping edits..
- // possible exponential performance hit... need a better way...
- TextEdit[] children = multiEdit.getChildren();
- for (int i = 0; i < children.length; i++) {
- if(children[i].covers(edit))
- // don't add
- return;
- }
- multiEdit.addChild(edit);
- }
-
-
- /**
- * @param translation
- */
- private void addPositionsToDocuments() {
-
- // can be null if it's a NullJSPTranslation
- if(getJavaDocument() != null && getJspDocument() != null) {
-
- HashMap java2jsp = getJava2JspMap();
- Iterator it = java2jsp.keySet().iterator();
- Position javaPos = null;
- while(it.hasNext()) {
- javaPos =(Position)it.next();
- try {
-
- fJavaDocument.addPosition(javaPos);
-
- } catch (BadLocationException e) {
- if(DEBUG) {
- System.out.println("tyring to add Java Position:[" + javaPos.offset + ":" + javaPos.length + "] to " + getJavaPath()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- //System.out.println("substring :[" + fJavaDocument.get().substring(javaPos.offset) + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- Logger.logException(e);
- }
- }
-
- try {
-
- fJspDocument.addPosition((Position)java2jsp.get(javaPos));
-
- } catch (BadLocationException e) {
- if(DEBUG) {
- System.out.println("tyring to add JSP Position:[" + ((Position)java2jsp.get(javaPos)).offset + ":" +((Position)java2jsp.get(javaPos)).length + "] to " + getJavaPath()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Logger.logException(e);
- }
- }
- }
- }
- }
-
- /**
- * Recursively gets all child edits
- * @param javaEdit
- * @return all child edits
- */
- private TextEdit[] getAllEdits(TextEdit javaEdit) {
-
- List result = new ArrayList();
- if(javaEdit instanceof MultiTextEdit) {
- TextEdit[] children = javaEdit.getChildren();
- for (int i = 0; i < children.length; i++)
- result.addAll(Arrays.asList(getAllEdits(children[i])));
- }
- else
- result.add(javaEdit);
- return (TextEdit[])result.toArray(new TextEdit[result.size()]);
- }
-
- /**
- * @param deltas
- * @param jspPos
- * @param replaceText
- * @param jspText
- * @param i
- */
- private void debugReplace(PositionDelta[] deltas, Position jspPos, String replaceText, int i) {
- String jspChunk;
- jspChunk = getJspDocument().get().substring(jspPos.offset, jspPos.offset + jspPos.length);
- if(!deltas[i].isDeleted) {
- System.out.println("replacing:"); //$NON-NLS-1$
- System.out.println("jsp:[" + jspChunk + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("w/ :[" + replaceText + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("--------------------------------"); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java
deleted file mode 100644
index 30b51feea9..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.text.edits.CopySourceEdit;
-import org.eclipse.text.edits.CopyTargetEdit;
-import org.eclipse.text.edits.DeleteEdit;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MoveSourceEdit;
-import org.eclipse.text.edits.MoveTargetEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.xml.core.document.XMLDocument;
-import org.eclipse.wst.xml.core.document.XMLModel;
-
-public class JSPTranslationUtil {
- protected IDocument fDocument = null;
- protected JSPTranslationExtension fTranslation = null;
-
- public JSPTranslationUtil(IDocument document) {
- fDocument = document;
- }
-
- public TextEdit translateTextEdit(TextEdit textEdit) {
- TextEdit translatedTextEdit = null;
-
- int javaOffset = textEdit.getOffset();
- int jspOffset = getTranslation().getJspOffset(textEdit.getOffset());
- int length = textEdit.getLength();
-
- if (textEdit instanceof MultiTextEdit) {
- translatedTextEdit = new MultiTextEdit();
- TextEdit[] children = ((MultiTextEdit) textEdit).getChildren();
- for (int i = 0; i < children.length; i++) {
- TextEdit translatedChildTextEdit = translateTextEdit(children[i]);
- if (translatedChildTextEdit != null)
- ((MultiTextEdit) translatedTextEdit).addChild(translatedChildTextEdit);
- }
- } else if (textEdit instanceof ReplaceEdit) {
- if (jspOffset == -1)
- return null;
-
- if (!getTranslation().javaSpansMultipleJspPartitions(javaOffset, length))
- translatedTextEdit = new ReplaceEdit(jspOffset, length, ((ReplaceEdit) textEdit).getText());
- } else if (textEdit instanceof InsertEdit) {
- translatedTextEdit = new InsertEdit(jspOffset, ((InsertEdit) textEdit).getText());
- } else if (textEdit instanceof DeleteEdit) {
- translatedTextEdit = new DeleteEdit(jspOffset, length);
- TextEdit[] children = ((DeleteEdit) textEdit).getChildren();
- for (int i = 0; i < children.length; i++) {
- TextEdit translatedChildTextEdit = translateTextEdit(children[i]);
- if (translatedChildTextEdit != null)
- ((DeleteEdit) translatedTextEdit).addChild(translatedChildTextEdit);
- }
- } else if (textEdit instanceof CopySourceEdit) {
- translatedTextEdit = new CopySourceEdit(jspOffset, length);
- ((CopySourceEdit) translatedTextEdit).setTargetEdit(((CopySourceEdit) textEdit).getTargetEdit());
- ((CopySourceEdit) translatedTextEdit).setSourceModifier(((CopySourceEdit) textEdit).getSourceModifier());
- } else if (textEdit instanceof CopyTargetEdit) {
- translatedTextEdit = new CopyTargetEdit(jspOffset);
- ((CopyTargetEdit) textEdit).getSourceEdit().setTargetEdit((CopyTargetEdit) translatedTextEdit);
- } else if (textEdit instanceof MoveSourceEdit) {
- translatedTextEdit = new MoveSourceEdit(jspOffset, length);
- ((MoveSourceEdit) translatedTextEdit).setTargetEdit(((MoveSourceEdit) textEdit).getTargetEdit());
- } else if (textEdit instanceof MoveTargetEdit) {
- translatedTextEdit = new MoveTargetEdit(jspOffset);
- ((MoveTargetEdit) textEdit).getSourceEdit().setTargetEdit((MoveTargetEdit) translatedTextEdit);
- } else {
- System.out.println("Need to translate " + textEdit); //$NON-NLS-1$
- }
-
- return translatedTextEdit;
- }
-
- public JSPTranslationExtension getTranslation() {
- if (fTranslation == null) {
- XMLModel xmlModel = (XMLModel) getModelManager().getExistingModelForRead(fDocument);
- try {
- XMLDocument xmlDoc = xmlModel.getDocument();
-
- JSPTranslationAdapter translationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
- if (translationAdapter != null)
- fTranslation = translationAdapter.getJSPTranslation();
- } finally {
- xmlModel.releaseFromRead();
- }
- }
-
- return fTranslation;
- }
-
- public ICompilationUnit getCompilationUnit() {
- return getTranslation().getCompilationUnit();
- }
-
- protected IModelManager getModelManager() {
- return StructuredModelManager.getModelManager();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
deleted file mode 100644
index e1fee7c7f0..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
+++ /dev/null
@@ -1,1785 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Stack;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDElementDeclaration;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDVariable;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.sse.core.contentmodel.CMDocumentTracker;
-import org.eclipse.wst.sse.core.contentmodel.CMNodeWrapper;
-import org.eclipse.wst.sse.core.parser.BlockMarker;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionCollection;
-import org.eclipse.wst.sse.core.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-import org.eclipse.wst.sse.core.util.StringUtils;
-import org.eclipse.wst.sse.core.util.URIResolver;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-import org.eclipse.wst.xml.core.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-
-/**
- * Translates a JSP document into a HttpServlet.
- * Keeps two way mapping from java translation to the original JSP source, which
- * can be obtained through getJava2JspRanges() and getJsp2JavaRanges().
- *
- * @author pavery
- */
-public class JSPTranslator {
-
- public static final String ENDL = "\n"; //$NON-NLS-1$
-
- private String fClassHeader = "public class _JSPServlet extends "; //$NON-NLS-1$
- private String fClassname = "_JSPServlet"; //$NON-NLS-1$
-
- private String fServiceHeader = "public void _jspService(javax.servlet.http.HttpServletRequest request," + //$NON-NLS-1$
- " javax.servlet.http.HttpServletResponse response)\n" + //$NON-NLS-1$
- "\t\tthrows java.io.IOException, javax.servlet.ServletException {\n" + //$NON-NLS-1$
- "javax.servlet.jsp.PageContext pageContext = null;\n" + //$NON-NLS-1$
- "javax.servlet.http.HttpSession session = null;\n" + //$NON-NLS-1$
- "javax.servlet.ServletContext application = null;\n" + //$NON-NLS-1$
- "javax.servlet.ServletConfig config = null;\n" + //$NON-NLS-1$
- "javax.servlet.jsp.JspWriter out = null;\n" + //$NON-NLS-1$
- "Object page = null;"; //$NON-NLS-1$
-
- private String fFooter = "}}"; //$NON-NLS-1$
- private String fException = "Throwable exception = null;"; //$NON-NLS-1$
- public static final String EXPRESSION_PREFIX = "out.print(\"\"+"; //$NON-NLS-1$
- public static final String EXPRESSION_SUFFIX = ");"; //$NON-NLS-1$
- private String fSuperclass = "javax.servlet.http.HttpServlet"; //$NON-NLS-1$
-
- /** fSourcePosition = position in JSP source*/
- private int fSourcePosition = -1;
- /** fRelativeOffest = offset in the buffer there the cursor is */
- private int fRelativeOffset = -1;
- /** fCursorPosition = offset in the translated java document */
- private int fCursorPosition = -1;
- /** some page directive attributes */
- private boolean fIsErrorPage, fCursorInExpression = false;
-
- /** user java code in body of the service method */
- private StringBuffer fUserCode = new StringBuffer();
- /** user defined vars declared in the beginning of the class */
- private StringBuffer fUserDeclarations = new StringBuffer();
- /** user defined imports */
- private StringBuffer fUserImports = new StringBuffer();
-
- private StringBuffer fImports = new StringBuffer(); // imports
- private StringBuffer fResult; // the final traslated java document string buffer
- private StringBuffer fCursorOwner = null; // the buffer where the cursor is
-
- private XMLModel fStructuredModel = null;
- private IStructuredDocument fStructuredDocument = null;
- private ModelQuery fModelQuery = null;
- //private XMLNode fPositionNode; // position in the DOM
- private IStructuredDocumentRegion fCurrentNode;
- private boolean fInCodeRegion = false; // flag for if cursor is in the current region being translated
-
- /**
- * these constants are to keep track of whether the code in question
- * is embedded (JSP as an attribute or within comment tags)
- * or is just standard JSP code, or identifies if it's an expression
- */
- protected final static int STANDARD_JSP = 0;
- protected final static int EMBEDDED_JSP = 1;
- protected final static int DECLARATION = 2;
- protected final static int EXPRESSION = 4;
- protected final static int SCRIPTLET = 8;
-
- /** used to avoid infinite looping include files */
- private Stack fIncludes = null;
- /** mostly for helper classes, so they parse correctly */
- private ArrayList fBlockMarkers = null;
- /** use only one inclue helper per file location */
- private HashMap fJSPIncludeHelperMap = null;
- /** for keeping track of offset in user buffers while document is being built*/
- private int fOffsetInUserImports = 0;
- private int fOffsetInUserDeclarations = 0;
- private int fOffsetInUserCode = 0;
-
- /** correlates ranges (positions) in java to ranges in jsp */
- private HashMap fJava2JspRanges = new HashMap();
-
- /** map of ranges in fUserImports (relative to the start of the buffer) to ranges in source JSP buffer. */
- private HashMap fImportRanges = new HashMap();
- /** map of ranges in fUserCode (relative to the start of the buffer) to ranges in source JSP buffer. */
- private HashMap fCodeRanges = new HashMap();
- /** map of ranges in fUserDeclarations (relative to the start of the buffer) to ranges in source JSP buffer. */
- private HashMap fDeclarationRanges = new HashMap();
-
- private HashMap fUseBeanRanges = new HashMap();
- /** ranges that don't directly map from java code to JSP code (eg. <%@include file="included.jsp"%> */
- private HashMap fIndirectRanges = new HashMap();
-
- private IProgressMonitor fProgressMonitor = null;
-
- /**
- * save JSP document text for later use
- * may just want to read this from the file or strucdtured document depending what is available
- * */
- private StringBuffer fJspTextBuffer = new StringBuffer();
-
- /**
- * Bits indicates what state the translator is in
- * use stateMask | MASK to set
- * use (stateMask & MASK) == MASK to check
- * USE stateMask
- */
-
- /** no state */
- public static final int S_NONE = 0;
-
- /**
- * configure using an XMLNode
- * @param node
- * @param monitor
- */
- private void configure(XMLNode node, IProgressMonitor monitor) {
-
- fProgressMonitor = monitor;
- fStructuredModel = node.getModel();
- //fPositionNode = node;
-
- fModelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- fStructuredDocument = fStructuredModel.getStructuredDocument();
-
- String className = createClassname(node);
- if (className.length() > 0) {
- setClassname(className);
- fClassHeader = "public class " + className + " extends "; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * memory saving configure (no StructuredDocument in memory)
- * currently doesn't handle included files
- *
- * @param jspFile
- * @param monitor
- */
- private void configure(IFile jspFile, IProgressMonitor monitor) {
- // when configured on a file
- // fStructuredModel, fPositionNode, fModelQuery, fStructuredDocument are all null
-
- fProgressMonitor = monitor;
-
- String className = createClassname(jspFile);
- if (className.length() > 0) {
- setClassname(className);
- fClassHeader = "public class " + className + " extends "; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Set the jsp text from an IFile
- * @param jspFile
- */
- private void setJspText(IFile jspFile) {
- try {
- BufferedInputStream in = new BufferedInputStream(jspFile.getContents());
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- String line = null;
- while ((line=reader.readLine()) != null){
- fJspTextBuffer.append(line);
- fJspTextBuffer.append(ENDL);
- }
- reader.close();
- }
- catch (CoreException e){
- Logger.logException(e);
- }
- catch(IOException e) {
- Logger.logException(e);
- }
- }
-
- /**
- * @param node
- * @return
- */
- private String createClassname(XMLNode node) {
-
- String classname = ""; //$NON-NLS-1$
- if (node != null) {
- String base = node.getModel().getBaseLocation();
- classname = JSP2ServletNameUtil.mangle(base);
- }
- return classname;
- }
-
- /**
- * @param jspFile
- * @return
- */
- private String createClassname(IFile jspFile) {
-
- String classname = ""; //$NON-NLS-1$
- if(jspFile != null) {
- classname = JSP2ServletNameUtil.mangle(jspFile.getFullPath().toString());
- }
- return classname;
- }
-
- public void setClassname(String classname) {
- this.fClassname = classname;
- }
-
- public String getClassname() {
- return this.fClassname != null ? this.fClassname : "GenericJspServlet"; //$NON-NLS-1$
- }
-
- /**
- * So that the JSPTranslator can be reused.
- */
- public void reset(XMLNode node, IProgressMonitor progress) {
-
- // initialize some things on node
- configure(node, progress);
- reset();
- // set the jsp text buffer
- fJspTextBuffer.append(fStructuredDocument.get());
- }
-
- /**
- * conservative version (no StructuredDocument/Model)
- * @param jspFile
- * @param progress
- */
- public void reset(IFile jspFile, IProgressMonitor progress) {
-
- // initialize some things on node
- configure(jspFile, progress);
- reset();
- // set the jsp text buffer
- setJspText(jspFile);
- }
-
- /**
- * Reinitialize some fields
- */
- private void reset() {
-
- // reset progress monitor
- if (fProgressMonitor != null)
- fProgressMonitor.setCanceled(false);
-
- // reinit fields
- fSourcePosition = -1;
- fRelativeOffset = -1;
- fCursorPosition = -1;
-
- fIsErrorPage = fCursorInExpression = false;
-
- fUserCode = new StringBuffer();
- fUserDeclarations = new StringBuffer();
- fUserImports = new StringBuffer();
-
- fImports = new StringBuffer(); // imports
- fResult = null;
- fCursorOwner = null; // the buffer where the cursor is
-
- fCurrentNode = null;
- fInCodeRegion = false; // flag for if cursor is in the current region
- // being translated
-
- if (fIncludes != null)
- fIncludes.clear();
-
- fBlockMarkers = null;
-
- fJSPIncludeHelperMap = null;
-
- fOffsetInUserImports = 0;
- fOffsetInUserDeclarations = 0;
- fOffsetInUserCode = 0;
-
- fJava2JspRanges.clear();
- fImportRanges.clear();
- fCodeRanges.clear();
- fUseBeanRanges.clear();
- fDeclarationRanges.clear();
- fIndirectRanges.clear();
-
- fJspTextBuffer = new StringBuffer();
- }
-
- /**
- * @return just the "shell" of a servlet, nothing contributed from the JSP doc
- */
- public final StringBuffer getEmptyTranslation() {
- reset();
- buildResult();
- return getTranslation();
- }
-
- /**
- * put the final java document together
- */
- private final void buildResult() {
- // to build the java document this is the order:
- //
- // + default imports
- // + user imports
- // + class header
- // [+ error page]
- // + user declarations
- // + service method header
- // + user code
- // + service method footer
- fResult = new StringBuffer(fImports.length() + fUserDeclarations.length() + fUserCode.length() + 2048);
- int javaOffset = 0;
-
- // default imports
- append(fImports);
- javaOffset += fImports.length();
- updateRanges(fImportRanges, javaOffset);
-
- //updateRanges(fIndirectImports, javaOffset);
- // user imports
- append(fUserImports);
- javaOffset += fUserImports.length();
-
- // class header
- fResult.append(fClassHeader); //$NON-NLS-1$
- javaOffset += fClassHeader.length();
- fResult.append(fSuperclass + "{\n"); //$NON-NLS-1$
- javaOffset += fSuperclass.length() + 2;
-
- updateRanges(fDeclarationRanges, javaOffset);
- // user declarations
- append(fUserDeclarations);
- javaOffset += fUserDeclarations.length();
-
- fResult.append(fServiceHeader);
- javaOffset += fServiceHeader.length();
- // error page
- if (fIsErrorPage) {
- fResult.append(fException);
- javaOffset += fException.length();
- }
- updateRanges(fCodeRanges, javaOffset);
-
- // user code
- append(fUserCode);
- javaOffset += fUserCode.length();
-
- // footer
- fResult.append(fFooter);
- javaOffset += fFooter.length();
-
- fJava2JspRanges.putAll(fImportRanges);
- fJava2JspRanges.putAll(fDeclarationRanges);
- fJava2JspRanges.putAll(fCodeRanges);
- }
-
- /**
- * @param javaRanges
- * @param offsetInJava
- */
- private void updateRanges(HashMap rangeMap, int offsetInJava) {
- // just need to update java ranges w/ the offset we now know
- Iterator it = rangeMap.keySet().iterator();
- while (it.hasNext())
- ((Position) it.next()).offset += offsetInJava;
- }
-
- /**
- * map of ranges (positions) in java document to ranges in jsp document
- * @return a map of java positions to jsp positions.
- */
- public HashMap getJava2JspRanges() {
- return fJava2JspRanges;
- }
-
- /**
- * map of ranges in jsp document to ranges in java document.
- * @return a map of jsp positions to java positions, or null if no translation has occured yet
- * (the map hasn't been built).
- */
- public HashMap getJsp2JavaRanges() {
- if (fJava2JspRanges == null)
- return null;
- HashMap flipFlopped = new HashMap();
- Iterator keys = fJava2JspRanges.keySet().iterator();
- Object range = null;
- while (keys.hasNext()) {
- range = keys.next();
- flipFlopped.put(fJava2JspRanges.get(range), range);
- }
- return flipFlopped;
- }
-
- public HashMap getJava2JspImportRanges() {
- return fImportRanges;
- }
-
- public HashMap getJava2JspUseBeanRanges() {
- return fUseBeanRanges;
- }
-
- public HashMap getJava2JspIndirectRanges() {
- return fIndirectRanges;
- }
-
- /**
- * Adds to the jsp<->java map by default
- * @param value a comma delimited list of imports
- */
- protected void addImports(String value) {
- addImports(value, true);
- }
-
- /**
- * Pass in a comma delimited list of import values,
- * appends each to the final result buffer
- * @param value a comma delimited list of imports
- */
- protected void addImports(String value, boolean addToMap) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81687
- // added the "addToMap" parameter to exclude imports originating
- // from included JSP files to be added to the jsp<->java mapping
- StringTokenizer st = new StringTokenizer(value, ",", false); //$NON-NLS-1$
- String tok = ""; //$NON-NLS-1$
- String appendage = ""; //$NON-NLS-1$
- while (st.hasMoreTokens()) {
- tok = st.nextToken();
- appendage = "import " + tok + ";" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$
- appendToBuffer(appendage, fUserImports, addToMap, fCurrentNode);
- }
- }
-
- /**
- /* keep track of cursor position inside the buffer
- /* appends buffer to the final result buffer
- */
- protected void append(StringBuffer buf) {
- if (getCursorOwner() == buf) {
- fCursorPosition = fResult.length() + getRelativeOffset();
- }
- fResult.append(buf.toString());
- }
-
- /**
- * Only valid after a configure(...), translate(...) or translateFromFile(...) call
- * @return the current result (java translation) buffer
- */
- public final StringBuffer getTranslation() {
- return fResult;
- }
-
- /**
- * Only valid after a configure(...), translate(...) or translateFromFile(...) call
- * @return the text in the JSP file
- */
- public final String getJspText() {
- return fJspTextBuffer.toString();
- }
-
- /**
- * adds the variables for a tag in a taglib to the dummy java document
- * @param tagToAdd is the name of the tag whose variables we want to add
- */
- protected void addTaglibVariables(String tagToAdd) {
- if (fModelQuery != null) {
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5159
- TLDCMDocumentManager docMgr = TaglibController.getTLDCMDocumentManager(fStructuredDocument);
- if (docMgr == null)
- return;
- Iterator taglibs = docMgr.getCMDocumentTrackers(fCurrentNode.getStartOffset()).iterator();
- CMDocument doc = null;
- CMNamedNodeMap elements = null;
- while (taglibs.hasNext()) {
- doc = (CMDocument) taglibs.next();
- CMNode node = null;
- if ((elements = doc.getElements()) != null && (node = elements.getNamedItem(tagToAdd)) != null && node.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- if (node instanceof CMNodeWrapper) {
- node = ((CMNodeWrapper) node).getOriginNode();
- }
- // future_TODO
- // FOR TAGLIB 1.1 STYLE, WE NEED TO INSTANTIATE THE
- // TagExtraInfo class and get the variables that way
- // use reflection to create class...
- // VariableInfo[] getVariableInfo(TagData data)
- // THIS IS ONLY FOR TAGLIB 1.2 STYLE .tld files
- List list = ((TLDElementDeclaration) node).getVariables();
- Iterator it = list.iterator();
- while (it.hasNext()) {
- TLDVariable var = (TLDVariable) it.next();
- String varName = var.getNameGiven();
- if (varName == null) {
- varName = var.getNameFromAttribute();
- }
- if (varName != null) {
- String varClass = "java.lang.String"; //$NON-NLS-1$ // the default class...
- if (var.getVariableClass() != null) {
- varClass = var.getVariableClass();
- }
- // add to declarations...
- String newDeclaration = varClass + " " + varName + " = null;" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5159
- // not adding to map to avoid strange refactoring behavior
- appendToBuffer(newDeclaration, fUserCode, false, fCurrentNode);
-// fUserCode.append(newDeclaration);
-//
-// Position javaRange = new Position(fOffsetInUserCode, newDeclaration.length());
-// // will need to incrememnt offset in user code
-// Position jspRange = new Position(fCurrentNode.getStart(), fCurrentNode.getLength());
-// fCodeRanges.put(javaRange, jspRange);
-// fOffsetInUserCode += newDeclaration.length();
-
- }
- }
- }
- }
- }
- }
-
- /*
- * used by inner helper class (XMLJSPRegionHelper, JSPIncludeRegionHelper)
- */
- public List getBlockMarkers() {
- if (fBlockMarkers == null)
- fBlockMarkers = new ArrayList();
- return fBlockMarkers;
- }
-
- /**
- /* the main control loop for translating the document, driven by the structuredDocument nodes
- */
- public void translate() {
- setCurrentNode(fStructuredDocument.getFirstStructuredDocumentRegion());
-
- while (getCurrentNode() != null && !isCanceled()) {
-
- // intercept HTML comment flat node
- // also handles UNDEFINED (which is what CDATA comes in as)
- // basically this part will handle any "embedded" JSP containers
- if (getCurrentNode().getType() == XMLRegionContext.XML_COMMENT_TEXT || getCurrentNode().getType() == XMLRegionContext.XML_CDATA_TEXT || getCurrentNode().getType() == XMLRegionContext.UNDEFINED) {
- translateXMLCommentNode(getCurrentNode());
- }
- else // iterate through each region in the flat node
- {
- translateRegionContainer(getCurrentNode(), STANDARD_JSP);
- }
- if (getCurrentNode() != null)
- advanceNextNode();
- }
- buildResult();
- }
-
- protected void setDocumentContent(IDocument document, InputStream contentStream, String charset) {
- Reader in = null;
- try {
- in = new BufferedReader(new InputStreamReader(contentStream, charset), 2048);
- StringBuffer buffer = new StringBuffer(2048);
- char[] readBuffer = new char[2048];
- int n = in.read(readBuffer);
- while (n > 0) {
- buffer.append(readBuffer, 0, n);
- n = in.read(readBuffer);
- }
- document.set(buffer.toString());
- }
- catch (IOException x) {
- // ignore
- }
- finally {
- if (in != null) {
- try {
- in.close();
- }
- catch (IOException x) {
- // ignore
- }
- }
- }
- }
-
- /**
- *
- * @return the status of the translator's progrss monitor, false if the monitor is null
- */
- private boolean isCanceled() {
- return (fProgressMonitor == null) ? false : fProgressMonitor.isCanceled();
- }
-
- private void advanceNextNode() {
- setCurrentNode(getCurrentNode().getNext());
- if (getCurrentNode() != null)
- setSourceReferencePoint();
- }
-
- private void setSourceReferencePoint() {
- if (isJSP(getCurrentNode().getFirstRegion().getType())) {
- Iterator it = getCurrentNode().getRegions().iterator();
- ITextRegion r = null;
- while (it.hasNext()) {
- r = (ITextRegion) it.next();
- if (r.getType() == XMLJSPRegionContexts.JSP_CONTENT || r.getType() == XMLRegionContext.XML_CONTENT)
- break;
- else if (r.getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME)
- break;
- else if (r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE && getCurrentNode().getFullText(r).trim().equals("import")) //$NON-NLS-1$
- break;
- }
- }
- }
-
- /**
- * translates a region container (and XML JSP container, or <% JSP container)
- */
- protected void translateRegionContainer(ITextRegionCollection container, int JSPType) {
-
- ITextRegionCollection containerRegion = container;
- Iterator regions = containerRegion.getRegions().iterator();
- ITextRegion region = null;
- while (regions.hasNext()) {
- region = (ITextRegion) regions.next();
- String type = region.getType();
- // PMR 91930
- // CMVC 241869
- // content assist was not showing up in JSP inside a javascript region
- if (type == XMLRegionContext.BLOCK_TEXT) {
- // check if it's nested jsp in a script tag...
- if (region instanceof ITextRegionContainer) {
- translateJSPNode(region, regions, type, EMBEDDED_JSP);
- }
- else {
- //////////////////////////////////////////////////////////////////////////////////
- // THIS EMBEDDED JSP TEXT WILL COME OUT LATER WHEN PARTITIONING HAS
- // SUPPORT FOR NESTED XML-JSP
- // CMVC 241882
- decodeScriptBlock(containerRegion.getFullText(region), containerRegion.getStartOffset());
- //////////////////////////////////////////////////////////////////////////////////
- }
- }
- if (type != null && isJSP(type)) // <%, <%=, <%!, <%@
- {
- translateJSPNode(region, regions, type, JSPType);
- }
- else if (type != null && type == XMLRegionContext.XML_TAG_OPEN) {
- translateXMLNode(containerRegion, regions);
- }
- }
- //}
- }
-
- /*//////////////////////////////////////////////////////////////////////////////////
- * ** TEMP WORKAROUND FOR CMVC 241882
- * Takes a String and blocks out jsp:scriptlet, jsp:expression, and jsp:declaration
- * @param blockText
- * @return
- */
- private void decodeScriptBlock(String blockText, int startOfBlock) {
- XMLJSPRegionHelper helper = new XMLJSPRegionHelper(this);
- helper.addBlockMarker(new BlockMarker("jsp:scriptlet", null, XMLJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
- helper.addBlockMarker(new BlockMarker("jsp:expression", null, XMLJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
- helper.addBlockMarker(new BlockMarker("jsp:declaration", null, XMLJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
- helper.addBlockMarker(new BlockMarker("jsp:directive.include", null, XMLJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
- helper.addBlockMarker(new BlockMarker("jsp:directive.taglib", null, XMLJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
- helper.reset(blockText, startOfBlock);
- // force parse
- helper.forceParse();
- helper.writeToBuffers();
- }
-
- /*
- * returns string minus CDATA open and close text
- */
- final public String stripCDATA(String text) {
- String resultText = ""; //$NON-NLS-1$
- String CDATA_OPEN = "<![CDATA["; //$NON-NLS-1$
- String CDATA_CLOSE = "]]>"; //$NON-NLS-1$
- int start = 0;
- int end = text.length();
- while (start < text.length()) {
- if (text.indexOf(CDATA_OPEN, start) > -1) {
- end = text.indexOf(CDATA_OPEN, start);
- resultText += text.substring(start, end);
- start = end + CDATA_OPEN.length();
- }
- else if (text.indexOf(CDATA_CLOSE, start) > -1) {
- end = text.indexOf(CDATA_CLOSE, start);
- resultText += text.substring(start, end);
- start = end + CDATA_CLOSE.length();
- }
- else {
- end = text.length();
- resultText += text.substring(start, end);
- break;
- }
- }
- return resultText;
- }
-
- // END OF WORKAROUND CODE...
- ///////////////////////////////////////////////////////////////////////////////////////
- /**
- * determines if the type is a pure JSP type (not XML)
- */
- protected boolean isJSP(String type) {
- return ((type == XMLJSPRegionContexts.JSP_DIRECTIVE_OPEN || type == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN || type == XMLJSPRegionContexts.JSP_DECLARATION_OPEN || type == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN || type == XMLJSPRegionContexts.JSP_CONTENT) && type != XMLRegionContext.XML_TAG_OPEN);
- // checking XML_TAG_OPEN so <jsp:directive.xxx/> gets treated like other XML jsp tags
- }
-
- /**
- * translates the various XMLJSP type nodes
- * @param regions the regions of the XMLNode
- */
- protected void translateXMLNode(ITextRegionCollection container, Iterator regions) {
- // contents must be valid XHTML, translate escaped CDATA into what it really is...
- ITextRegion r = null;
- if (regions.hasNext()) {
- r = (ITextRegion) regions.next();
- if (r.getType() == XMLRegionContext.XML_TAG_NAME || r.getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME) // <jsp:directive.xxx comes in as this
- {
- String fullTagName = container.getFullText(r).trim();
- if (fullTagName.indexOf(':') > -1) {
- addTaglibVariables(fullTagName); // it may be a taglib
- }
- StringTokenizer st = new StringTokenizer(fullTagName, ":.", false); //$NON-NLS-1$
- if (st.hasMoreTokens() && st.nextToken().equals("jsp")) //$NON-NLS-1$
- {
- if (st.hasMoreTokens()) {
- String jspTagName = st.nextToken();
- if (jspTagName.equals("useBean")) //$NON-NLS-1$
- {
- advanceNextNode(); // get the content
- if (getCurrentNode() != null) {
- translateUseBean(container); // 'regions' should be all the useBean attributes
- }
- }
- else if (jspTagName.equals("scriptlet")) //$NON-NLS-1$
- {
- // <jsp:scriptlet>scriptlet content...</jsp:scriptlet>
- IStructuredDocumentRegion sdr = getCurrentNode().getNext();
- if(sdr != null) {
- translateScriptletString(sdr.getText(), sdr, sdr.getStartOffset(), sdr.getEndOffset());
- }
- advanceNextNode();
- }
- else if (jspTagName.equals("expression")) //$NON-NLS-1$
- {
- // <jsp:expression>expression content...</jsp:expression>
- IStructuredDocumentRegion sdr = getCurrentNode().getNext();
- if(sdr != null) {
- translateExpressionString(sdr.getText(), sdr, sdr.getStartOffset(), sdr.getEndOffset());
- }
- advanceNextNode();
- }
- else if (jspTagName.equals("declaration")) //$NON-NLS-1$
- {
- // <jsp:declaration>declaration content...</jsp:declaration>
- IStructuredDocumentRegion sdr = getCurrentNode().getNext();
- if(sdr != null) {
- translateDeclarationString(sdr.getText(), sdr, sdr.getStartOffset(), sdr.getEndOffset());
-
- }
- advanceNextNode();
- }
- else if (jspTagName.equals("directive")) //$NON-NLS-1$
- {
- if (st.hasMoreTokens()) {
- String directiveName = st.nextToken();
- if (directiveName.equals("taglib")) { //$NON-NLS-1$
- handleTaglib();
- return;
- }
- else if (directiveName.equals("include")) { //$NON-NLS-1$
-
- String fileLocation = ""; //$NON-NLS-1$
- String attrValue = ""; //$NON-NLS-1$
- // CMVC 258311
- // PMR 18368, B663
- // skip to required "file" attribute, should be safe because
- // "file" is the only attribute for the include directive
- while (r != null && regions.hasNext() && !r.getType().equals(XMLRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
- r = (ITextRegion) regions.next();
- }
- attrValue = getAttributeValue(r, regions);
- if (attrValue != null)
- handleIncludeFile(fileLocation);
- }
- else if (directiveName.equals("page")) { //$NON-NLS-1$
-
- // 20040702 commenting this out
- // bad if currentNode is referenced after here w/ the current list
- // see: https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3035
- // setCurrentNode(getCurrentNode().getNext());
- if (getCurrentNode() != null) {
- translatePageDirectiveAttributes(regions); // 'regions' are attributes for the directive
- }
- }
- }
- }
- else if(jspTagName.equals("include")) { //$NON-NLS-1$
-
- // <jsp:include page="filename") />
- while(regions.hasNext()) {
- r = (ITextRegion)regions.next();
- if(r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME && getCurrentNode().getText(r).equals("page")) { //$NON-NLS-1$
- String filename = getAttributeValue(r, regions);
- handleIncludeFile(filename);
- break;
- }
- }
- }
- }
- }
- else {
- // tag name is not jsp
- // handle embedded jsp attributes...
- ITextRegion embedded = null;
- Iterator attrRegions = null;
- ITextRegion attrChunk = null;
- while (regions.hasNext()) {
- embedded = (ITextRegion) regions.next();
- if (embedded instanceof ITextRegionContainer) {
- // parse out container
- attrRegions = ((ITextRegionContainer) embedded).getRegions().iterator();
- while (attrRegions.hasNext()) {
- attrChunk = (ITextRegion) attrRegions.next();
- String type = attrChunk.getType();
- // CMVC 263661, embedded JSP in attribute support
- // only want to translate one time per embedded region
- // so we only translate on the JSP open tags (not content)
- if (type == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN || type == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN || type == XMLJSPRegionContexts.JSP_DECLARATION_OPEN || type == XMLJSPRegionContexts.JSP_DIRECTIVE_OPEN) {
- // now call jsptranslate
- //System.out.println("embedded jsp OPEN >>>> " + ((ITextRegionContainer)embedded).getText(attrChunk));
- translateEmbeddedJSPInAttribute((ITextRegionContainer) embedded);
- }
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * goes through comment regions, checks if any are an embedded JSP container
- * if it finds one, it's sends the container into the translation routine
- */
- protected void translateXMLCommentNode(IStructuredDocumentRegion node) {
- Iterator it = node.getRegions().iterator();
- ITextRegion commentRegion = null;
- while (it != null && it.hasNext()) {
- commentRegion = (ITextRegion) it.next();
- if (commentRegion instanceof ITextRegionContainer) {
- translateRegionContainer((ITextRegionContainer) commentRegion, EMBEDDED_JSP); // it's embedded jsp...iterate regions...
- }
- }
- }
-
- /**
- * determines which type of JSP node to translate
- */
- protected void translateJSPNode(ITextRegion region, Iterator regions, String type, int JSPType) {
- if (type == XMLJSPRegionContexts.JSP_DIRECTIVE_OPEN && regions != null) {
- translateDirective(regions);
- }
- else {
- ITextRegionCollection contentRegion = null;
- if (JSPType == STANDARD_JSP && (setCurrentNode(getCurrentNode().getNext())) != null) {
- contentRegion = getCurrentNode();
- }
- else if (JSPType == EMBEDDED_JSP && region instanceof ITextRegionCollection) {
- // CMVC 263661
- translateEmbeddedJSPInBlock((ITextRegionCollection) region);
- // ensure the rest of this method won't be called
- contentRegion = null;
- }
- if (contentRegion != null) {
- if (type == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN) {
- translateExpression(contentRegion);
- }
- else if (type == XMLJSPRegionContexts.JSP_DECLARATION_OPEN) {
- translateDeclaration(contentRegion);
- }
- else if (type == XMLJSPRegionContexts.JSP_CONTENT || type == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN) {
- translateScriptlet(contentRegion);
- }
- }
- else {
- // this is the case of an attribute w/ no region <p align="<%%>">
- setCursorOwner(getJSPTypeForRegion(region));
- }
- }
- }
-
- /**
- * Pass the ITextRegionCollection which is the embedded region
- * @param iterator
- */
- private void translateEmbeddedJSPInBlock(ITextRegionCollection collection) {
- Iterator regions = collection.getRegions().iterator();
- ITextRegion region = null;
- while (regions.hasNext()) {
- region = (ITextRegion) regions.next();
- if (isJSP(region.getType()))
- break;
- region = null;
- }
- if (region != null) {
- translateEmbeddedJSPInAttribute(collection);
- }
- }
-
- /*
- * for example:
- * <a href="index.jsp?p=<%=abc%>b=<%=xyz%>">abc</a>
- */
- private void translateEmbeddedJSPInAttribute(ITextRegionCollection embeddedContainer) {
- // THIS METHOD IS A FIX FOR CMVC 263661 (jsp embedded in attribute regions)
-
- // loop all regions
- ITextRegionList embeddedRegions = embeddedContainer.getRegions();
- ITextRegion delim = null;
- ITextRegion content = null;
- String type = null;
- for(int i=0; i<embeddedRegions.size(); i++) {
-
- // possible delimiter, check later
- delim = embeddedRegions.get(i);
- type = delim.getType();
-
- // check next region to see if it's content
- if(i+1<embeddedRegions.size()) {
- if(embeddedRegions.get(i+1).getType() == XMLJSPRegionContexts.JSP_CONTENT)
- content = embeddedRegions.get(i+1);
- }
-
- if(content != null) {
- int contentStart = embeddedContainer.getStartOffset(content);
- int rStart = fCurrentNode.getStartOffset() + contentStart;
- int rEnd = fCurrentNode.getStartOffset() + embeddedContainer.getEndOffset(content);
-
- boolean inThisRegion = rStart <= fSourcePosition && rEnd >= fSourcePosition;
- //int jspPositionStart = fCurrentNode.getStartOffset() + contentStart;
-
- if(type == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN) {
- fLastJSPType = EXPRESSION;
- translateExpressionString(embeddedContainer.getText(content), fCurrentNode, contentStart, content.getLength());
- }
- else if(type == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN) {
- fLastJSPType = SCRIPTLET;
- translateScriptletString(embeddedContainer.getText(content), fCurrentNode, contentStart, content.getLength());
- }
- else if(type == XMLJSPRegionContexts.JSP_DECLARATION_OPEN) {
- fLastJSPType = DECLARATION;
- translateDeclarationString(embeddedContainer.getText(content), fCurrentNode, contentStart, content.getLength());
- }
-
- // calculate relative offset in buffer
- if (inThisRegion) {
- setCursorOwner(fLastJSPType);
- int currentBufferLength = getCursorOwner().length();
- setRelativeOffset((fSourcePosition - contentStart) + currentBufferLength);
- if (fLastJSPType == EXPRESSION) {
- // if an expression, add then length of the enclosing paren..
- setCursorInExpression(true);
- setRelativeOffset(getRelativeOffset() + EXPRESSION_PREFIX.length());
- }
- }
- }
- else {
- type = null;
- content = null;
- }
- }
- }
-
- private int fLastJSPType = SCRIPTLET;
-
- /**
- * JSPType is only used internally in this class to describe tye type of region to be translated
- * @param region
- * @return int
- */
- private int getJSPTypeForRegion(ITextRegion region) {
- String regionType = region.getType();
- int type = SCRIPTLET;
- if (regionType == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN)
- type = SCRIPTLET;
- else if (regionType == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN)
- type = EXPRESSION;
- else if (regionType == XMLJSPRegionContexts.JSP_DECLARATION_OPEN)
- type = DECLARATION;
- else if (regionType == XMLJSPRegionContexts.JSP_CONTENT)
- type = fLastJSPType;
- // remember the last type, in case the next type that comes in is JSP_CONTENT
- fLastJSPType = type;
- return type;
- }
-
- /**
- /* <%@ %>
- /* need to pass in the directive tag region
- */
- protected void translateDirective(Iterator regions) {
- ITextRegion r = null;
- String regionText, attrValue = ""; //$NON-NLS-1$
- while (regions.hasNext() && (r = (ITextRegion) regions.next()) != null && r.getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME) { // could be XML_CONTENT = "", skips attrs?
- regionText = getCurrentNode().getText(r);
- if (regionText.indexOf("taglib") > -1) { //$NON-NLS-1$
- // add custom tag block markers here
- handleTaglib();
- return;
- }
- else if (regionText.equals("include")) { //$NON-NLS-1$
- String fileLocation = ""; //$NON-NLS-1$
- // CMVC 258311
- // PMR 18368, B663
- // skip to required "file" attribute, should be safe because
- // "file" is the only attribute for the include directive
- while (r != null && regions.hasNext() && !r.getType().equals(XMLRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
- r = (ITextRegion) regions.next();
- }
- fileLocation = getAttributeValue(r, regions);
- if (attrValue != null)
- handleIncludeFile(fileLocation);
- }
- else if (regionText.indexOf("page") > -1) { //$NON-NLS-1$
- translatePageDirectiveAttributes(regions);
- }
- }
- }
-
- /*
- * This method should ideally only be called once per run through JSPTranslator
- * This is intended for use by inner helper classes that need to add block markers to their own parsers.
- * This method only adds markers that came from <@taglib> directives, (not <@include>),
- * since include file taglibs are handled on the fly when they are encountered.
- * * @param regions
- */
- protected void handleTaglib() {
- // get/create TLDCMDocument
- TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(fStructuredDocument);
- if (mgr != null) {
- List trackers = mgr.getCMDocumentTrackers(getCurrentNode().getEnd());
- Iterator it = trackers.iterator();
- CMDocumentTracker tracker = null;
- Iterator taglibRegions = null;
- IStructuredDocumentRegion sdRegion = null;
- ITextRegion r = null;
- while (it.hasNext()) {
- tracker = (CMDocumentTracker) it.next();
- sdRegion = tracker.getStructuredDocumentRegion();
- taglibRegions = sdRegion.getRegions().iterator();
- while (taglibRegions.hasNext()) {
- r = (ITextRegion) taglibRegions.next();
- if (r.getType().equals(XMLJSPRegionContexts.JSP_DIRECTIVE_NAME)) {
- if (sdRegion.getText(r).equals("taglib")) { //$NON-NLS-1$
- addBlockMarkers(tracker.getDocument());
- }
- }
- }
- }
- }
- }
-
- /*
- * adds block markers to JSPTranslator's block marker list for all elements in doc
- * @param doc
- */
- protected void addBlockMarkers(CMDocument doc) {
- if (doc.getElements().getLength() > 0) {
- Iterator elements = doc.getElements().iterator();
- CMNode node = null;
- while (elements.hasNext()) {
- node = (CMNode) elements.next();
- getBlockMarkers().add(new BlockMarker(node.getNodeName(), null, XMLJSPRegionContexts.JSP_CONTENT, true));
- }
- }
- }
-
- /**
- * If r is an attribute name region, this method will safely return the value for that attribute.
- * @param r
- * @param remainingRegions
- * @return the value for the attribute name (r), or null if isn't one
- */
- protected String getAttributeValue(ITextRegion r, Iterator remainingRegions) {
- if (r.getType().equals(XMLRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
- if (remainingRegions.hasNext() && (r = (ITextRegion) remainingRegions.next()) != null && r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (remainingRegions.hasNext() && (r = (ITextRegion) remainingRegions.next()) != null && r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- // handle include for the filename
- return StringUtils.stripQuotes(getCurrentNode().getText(r));
- }
- }
- }
- return null;
- }
-
- /**
- * takes an emnumeration of the attributes of a directive tag
- */
- protected void translatePageDirectiveAttributes(Iterator regions) {
- ITextRegion r = null;
- String attrName, attrValue;
- // iterate all attributes
- while (regions.hasNext() && (r = (ITextRegion) regions.next()) != null && r.getType() != XMLJSPRegionContexts.JSP_CLOSE) {
- attrName = attrValue = null;
- if (r.getType().equals(XMLRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
-
- attrName = getCurrentNode().getText(r).trim();
- if(attrName.length() > 0) {
- if (regions.hasNext() && (r = (ITextRegion) regions.next()) != null && r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (regions.hasNext() && (r = (ITextRegion) regions.next()) != null && r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-
- attrValue = StringUtils.strip(getCurrentNode().getText(r));
- }
- // has equals, but no value?
- }
- setDirectiveAttribute(attrName, attrValue);
- }
- }
- }
- }
-
- /**
- * sets the appropriate page directive attribute
- */
- protected void setDirectiveAttribute(String attrName, String attrValue) {
- if (attrValue == null)
- return; // uses default (if there was one)
- if (attrName.equals("extends")) //$NON-NLS-1$
- {
- fSuperclass = attrValue;
- }
- else if (attrName.equals("import")) //$NON-NLS-1$
- {
- addImports(attrValue);
- }
- else if (attrName.equals("session")) //$NON-NLS-1$
- {
- //fSession = ("true".equalsIgnoreCase(attrValue)); //$NON-NLS-1$
- }
- else if (attrName.equals("buffer")) //$NON-NLS-1$
- {
- // ignore for now
- }
- else if (attrName.equals("autoFlush")) //$NON-NLS-1$
- {
- // ignore for now
- }
- else if (attrName.equals("isThreadSafe")) //$NON-NLS-1$
- {
- //fThreadSafe = "true".equalsIgnoreCase(attrValue); //$NON-NLS-1$
- }
- else if (attrName.equals("isErrorPage")) //$NON-NLS-1$
- {
- fIsErrorPage = Boolean.valueOf(attrValue).booleanValue();
- }
- }
-
- protected void handleIncludeFile(String filename) {
- if (filename != null) {
- String fileLocation = null;
- if (getResolver() != null) {
- fileLocation = (getIncludes().empty())
- ? getResolver().getLocationByURI(StringUtils.strip(filename))
- : getResolver().getLocationByURI(StringUtils.strip(filename), (String) getIncludes().peek());
- }
- else {
- // shouldn't happen
- fileLocation = StringUtils.strip(filename);
- }
- // hopefully, a resolver is present and has returned a canonical file path
- if (!getIncludes().contains(fileLocation) && getBaseLocation() != null && !fileLocation.equals(getBaseLocation())) {
- getIncludes().push(fileLocation);
- JSPIncludeRegionHelper helper = getIncludesHelper(fileLocation);
- helper.parse(fileLocation);
- helper.writeToBuffers();
- getIncludes().pop();
- }
- }
- }
-
- /*
- * one helper per fileLocation
- */
- protected JSPIncludeRegionHelper getIncludesHelper(String fileLocation) {
- // lazy creation
- if (fJSPIncludeHelperMap == null) {
- fJSPIncludeHelperMap = new HashMap();
- }
- JSPIncludeRegionHelper helper = (JSPIncludeRegionHelper) fJSPIncludeHelperMap.get(fileLocation);
- if (helper == null) {
- helper = new JSPIncludeRegionHelper(this);
- fJSPIncludeHelperMap.put(fileLocation, helper);
- }
- return helper;
- }
-
- private URIResolver getResolver() {
- return (fStructuredModel != null) ? fStructuredModel.getResolver() : null;
- }
-
- /**
- *
- * @return java.lang.String
- */
- private String getBaseLocation() {
- if (getResolver() == null)
- return null;
- return getResolver().getFileBaseLocation();
- }
-
- private Stack getIncludes() {
- if (fIncludes == null)
- fIncludes = new Stack();
- return fIncludes;
- }
-
- protected void translateExpressionString(String newText, ITextRegionCollection embeddedContainer, int jspPositionStart, int jspPositionLength) {
- appendToBuffer(EXPRESSION_PREFIX, fUserCode, false, embeddedContainer);
- appendToBuffer(newText, fUserCode, true, embeddedContainer, jspPositionStart, jspPositionLength);
- appendToBuffer(EXPRESSION_SUFFIX, fUserCode, false, embeddedContainer);
- }
-
- protected void translateDeclarationString(String newText, ITextRegionCollection embeddedContainer, int jspPositionStart, int jspPositionLength) {
- appendToBuffer(newText, fUserDeclarations, true, embeddedContainer, jspPositionStart, jspPositionLength);
- appendToBuffer(ENDL, fUserDeclarations, false, embeddedContainer);
- }
-
- /**
- * used by XMLJSPRegionHelper for included JSP files
- *
- * @param newText
- * @param embeddedContainer
- * @param jspPositionStart
- * @param jspPositionLength
- */
- protected void translateScriptletString(String newText, ITextRegionCollection embeddedContainer, int jspPositionStart, int jspPositionLength) {
- appendToBuffer(newText, fUserCode, true, embeddedContainer, jspPositionStart, jspPositionLength);
- }
-
- // the following 3 methods determine the cursor position
- // <%= %>
- protected void translateExpression(ITextRegionCollection region) {
- String newText = getUnescapedRegionText(region, EXPRESSION);
- appendToBuffer(EXPRESSION_PREFIX, fUserCode, false, fCurrentNode);
- appendToBuffer(newText, fUserCode, true, fCurrentNode);
- appendToBuffer(EXPRESSION_SUFFIX, fUserCode, false, fCurrentNode);
- }
-
- //
- // <%! %>
- protected void translateDeclaration(ITextRegionCollection region) {
- String newText = getUnescapedRegionText(region, DECLARATION);
- appendToBuffer(newText, fUserDeclarations, true, fCurrentNode);
- appendToBuffer(ENDL, fUserDeclarations, false, fCurrentNode);
- }
-
- //
- // <% %>
- protected void translateScriptlet(ITextRegionCollection region) {
- String newText = getUnescapedRegionText(region, SCRIPTLET);
- appendToBuffer(newText, fUserCode, true, fCurrentNode);
- }
-
- /**
- * Append using a region, probably indirect mapping (eg. <%@page include=""%>)
- * @param newText
- * @param buffer
- * @param addToMap
- * @param jspReferenceRegion
- */
- private void appendToBuffer(String newText, StringBuffer buffer, boolean addToMap, ITextRegionCollection jspReferenceRegion) {
- int start = 0, length = 0;
- if(jspReferenceRegion != null) {
- start = jspReferenceRegion.getStartOffset();
- length = jspReferenceRegion.getLength();
- }
- appendToBuffer(newText, buffer, addToMap, jspReferenceRegion, start, length, false);
- }
-
- private void appendToBuffer(String newText, StringBuffer buffer, boolean addToMap, ITextRegionCollection jspReferenceRegion, int jspPositionStart, int jspPositionLength) {
- appendToBuffer(newText, buffer, addToMap, jspReferenceRegion, jspPositionStart, jspPositionLength, true);
- }
-
- /**
- * Adds newText to the buffer passed in, and adds to translation mapping as specified by the addToMap flag.
- * some special cases to consider (that may be affected by changes to this method):
- * included files
- * scriplets in an attribute value
- * refactoring
- *
- * @param newText
- * @param buffer
- * @param addToMap
- */
- private void appendToBuffer(String newText, StringBuffer buffer, boolean addToMap, ITextRegionCollection jspReferenceRegion, int jspPositionStart, int jspPositionLength, boolean isIndirect) {
-
- // nothing to append
- if (jspReferenceRegion == null)
- return;
-
- // add a newline so translation looks cleaner
- newText += ENDL;
-
- if (buffer == fUserCode) {
- buffer.append(newText);
- if (addToMap) {
- if (isUsebeanTag(jspReferenceRegion)) {
- try {
- // requires special mapping
- appendUseBeanToBuffer(newText, jspReferenceRegion, isIndirect);
- }
- catch (Exception e){
- // still working out kinks
- Logger.logException(e);
- }
- }
- else {
- // all other cases
- Position javaRange = new Position(fOffsetInUserCode, newText.length());
- Position jspRange = new Position(jspPositionStart, jspPositionLength);
-
- fCodeRanges.put(javaRange, jspRange);
- if(isIndirect)
- fIndirectRanges.put(javaRange, jspRange);
- }
- }
- fOffsetInUserCode += newText.length();
- }
- else if (buffer == fUserDeclarations) {
- buffer.append(newText);
- if (addToMap) {
- Position javaRange = new Position(fOffsetInUserDeclarations, newText.length());
- Position jspRange = new Position(jspPositionStart, jspPositionLength);
-
- fDeclarationRanges.put(javaRange, jspRange);
- if(isIndirect)
- fIndirectRanges.put(javaRange, jspRange);
- }
- fOffsetInUserDeclarations += newText.length();
- }
- else if (buffer == fUserImports) {
- buffer.append(newText);
- if (addToMap) {
- appendImportToBuffer(jspReferenceRegion, isIndirect);
- }
- fOffsetInUserImports += newText.length();
- }
- }
-
- /**
- * @param jspReferenceRegion
- * @return
- */
- private boolean isUsebeanTag(ITextRegionCollection jspReferenceRegion) {
- ITextRegionList regions = jspReferenceRegion.getRegions();
- ITextRegion r = null;
- boolean isUseBean = false;
- for (int i = 0; i < regions.size(); i++) {
- r = regions.get(i);
- if (r.getType() == XMLRegionContext.XML_TAG_NAME && jspReferenceRegion.getText(r).equals("jsp:useBean")) { //$NON-NLS-1$
- isUseBean = true;
- break;
- }
- }
- return isUseBean;
- }
-
- /**
- * @param newText
- * @param jspReferenceRegion
- */
- private void appendImportToBuffer(ITextRegionCollection jspReferenceRegion, boolean isIndirect) {
- // these positions will be updated below
- // 7 is length of "import "
- Position javaRange = new Position(fOffsetInUserImports + 7, 1);
- Position jspRange = new Position(jspReferenceRegion.getStart(), jspReferenceRegion.getLength());
-
- // calculate JSP range by finding "import" attribute
- ITextRegionList regions = jspReferenceRegion.getRegions();
- int size = regions.size();
- ITextRegion r = null;
- for (int i = 0; i < size; i++) {
- r = regions.get(i);
- if(r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME)
- if(jspReferenceRegion.getText(r).trim().equals("import")) { //$NON-NLS-1$
- // get the attr value region
- if(size > i+2) {
- r = regions.get(i+2);
- if(r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- // use the length of the value (minus the quotes)
- // won't work for multiple
- String importText = jspReferenceRegion.getText(r);
- int quoteOffset = (importText.startsWith("\"") || importText.startsWith("'")) ? 1 : 0; //$NON-NLS-1$ //$NON-NLS-2$
- String strippedText = StringUtils.stripQuotesLeaveInsideSpace(importText);
- jspRange = new Position(jspReferenceRegion.getStartOffset(r)+quoteOffset, strippedText.length());
- // set java range length
- javaRange.setLength(strippedText.length());
- break;
- }
- }
- }
- }
-
- // put ranges in java -> jsp range map
- fImportRanges.put(javaRange, jspRange);
- if(isIndirect)
- fIndirectRanges.put(javaRange, jspRange);
- }
-
- /**
- * temp fix for 282295 until better mapping is in place
- * @param newText
- * @param jspReferenceRegion
- */
- private void appendUseBeanToBuffer(String newText, ITextRegionCollection jspReferenceRegion, boolean isIndirect) throws Exception {
- // java string looks like this (tokenized)
- // Type id = new Classname();\n
- // 0 1 2 3 4
- // or
- // Type id = null;\n // if there is no classname
- // 0 1 2 3
-
- //----------------------
- // calculate java ranges
- //----------------------
- StringTokenizer st = new StringTokenizer(newText, " ", false); //$NON-NLS-1$
- int i = 0;
- String[] parsedJava = new String[st.countTokens()];
- while (st.hasMoreTokens())
- parsedJava[i++] = st.nextToken();
-
- String type = parsedJava[0] != null ? parsedJava[0] : ""; //$NON-NLS-1$
- String id = parsedJava[1] != null ? parsedJava[1] : ""; //$NON-NLS-1$
- String className = parsedJava.length > 4 ? parsedJava[4] : ""; //$NON-NLS-1$
-
- Position javaTypeRange = new Position(fOffsetInUserCode, type.length());
- Position javaIdRange = new Position(fOffsetInUserCode + type.length() + 1, id.length());
- Position javaClassRange = new Position(fOffsetInUserCode + type.length() + 1 + id.length() + 7, 0);
- if(className.length() >= 4) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=86132
- int classNameLength = className.substring(0,className.indexOf('(')).length();
- javaClassRange = new Position(fOffsetInUserCode + type.length() + 1 + id.length() + 7, classNameLength);
- }
-
- //---------------------
- // calculate jsp ranges
- //---------------------
- ITextRegionList regions = jspReferenceRegion.getRegions();
- ITextRegion r = null;
- String attrName = "", attrValue = ""; //$NON-NLS-1$ //$NON-NLS-2$
- int quoteOffset = 0;
- Position jspTypeRange = null;
- Position jspIdRange = null;
- Position jspClassRange = null;
-
- for (int j = 0; j < regions.size(); j++) {
- r = regions.get(j);
- if (r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- attrName = jspReferenceRegion.getText(r);
- if (regions.size() >= j + 2 && regions.get(j + 2).getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- // get attr value
- r = regions.get(j + 2);
- attrValue = jspReferenceRegion.getText(r);
-
- // may have quotes
- quoteOffset = (attrValue.startsWith("\"") || attrValue.startsWith("'")) ? 1 : 0; //$NON-NLS-1$ //$NON-NLS-2$
-
- if (attrName.equals("type")) //$NON-NLS-1$
- jspTypeRange = new Position(jspReferenceRegion.getStartOffset(r) + quoteOffset, StringUtils.stripQuotesLeaveInsideSpace(attrValue).length());
- else if (attrName.equals("id")) //$NON-NLS-1$
- jspIdRange = new Position(jspReferenceRegion.getStartOffset(r) + quoteOffset, StringUtils.stripQuotesLeaveInsideSpace(attrValue).length());
- else if (attrName.equals("class")) //$NON-NLS-1$
- jspClassRange = new Position(jspReferenceRegion.getStartOffset(r) + quoteOffset, StringUtils.stripQuotesLeaveInsideSpace(attrValue).length());
- }
- }
- }
-
- // put ranges in java -> jsp range map
- if (!type.equals("") && jspTypeRange != null) { //$NON-NLS-1$
- fCodeRanges.put(javaTypeRange, jspTypeRange);
- // note: don't update offsets for this map when result is built
- // they'll be updated when code ranges offsets are updated
- fUseBeanRanges.put(javaTypeRange, jspTypeRange);
- if(isIndirect)
- fIndirectRanges.put(javaTypeRange, jspTypeRange);
- }
- if (!id.equals("") && jspIdRange != null) { //$NON-NLS-1$
- fCodeRanges.put(javaIdRange, jspIdRange);
- // note: don't update offsets for this map when result is built
- // they'll be updated when code ranges offsets are updated
- fUseBeanRanges.put(javaIdRange, jspTypeRange);
- if(isIndirect)
- fIndirectRanges.put(javaIdRange, jspTypeRange);
- }
- if (!className.equals("") && jspClassRange != null) { //$NON-NLS-1$
- fCodeRanges.put(javaClassRange, jspClassRange);
- // note: don't update offsets for this map when result is built
- // they'll be updated when code ranges offsets are updated
- fUseBeanRanges.put(javaClassRange, jspTypeRange);
- if(isIndirect)
- fIndirectRanges.put(javaClassRange, jspTypeRange);
- }
- }
-
- /**
- * Set the buffer to the current JSPType:
- * STANDARD_JSP, EMBEDDED_JSP, DECLARATION, EXPRESSION, SCRIPTLET
- * (for keepting track of cursor position when the final document is built)
- * @param JSPType the JSP type that the cursor is in
- */
- protected void setCursorOwner(int JSPType) {
- switch (JSPType) {
- case DECLARATION :
- setCursorOwner(fUserDeclarations);
- break;
- case EXPRESSION :
- case SCRIPTLET :
- setCursorOwner(fUserCode);
- break;
- default :
- setCursorOwner(fUserCode);
- }
- }
-
- /**
- * this piece of code iterates through fCurrentNodes
- * and clumps them together in a big text string
- * - unescaping characters if they are not CDATA
- * - simply appending if they are CDATA
- * it stops iteration when it hits a node that is an XML_TAG_NAME (which should be the region closing tag)
- */
- protected String getUnescapedRegionText(ITextRegionCollection stRegion, int JSPType) {
- StringBuffer buffer = new StringBuffer();
- int start = stRegion.getStartOffset();
- int end = stRegion.getEndOffset();
- // adjustment necessary for embedded region containers
- if (stRegion instanceof ITextRegionContainer && stRegion.getType() == XMLRegionContext.BLOCK_TEXT) {
- if (stRegion.getRegions() != null && stRegion.getRegions().size() > 1) {
- ITextRegion jspContent = stRegion.getRegions().get(1); // should be jspContent region
- start = stRegion.getStartOffset(jspContent);
- end = stRegion.getEndOffset(jspContent);
- }
- }
- int CDATAOffset = 0; // number of characters lost in conversion
- int bufferSize = 0;
- if (stRegion.getType() == XMLJSPRegionContexts.JSP_CONTENT || stRegion.getType() == XMLRegionContext.BLOCK_TEXT // need this for embedded JSP regions
- || stRegion.getType() == XMLRegionContext.XML_TAG_NAME) // need this in case there's no region...
- {
- fInCodeRegion = (start <= fSourcePosition && fSourcePosition <= end);
- if (fInCodeRegion) {
- setCursorOwner(JSPType);
- setRelativeOffset((fSourcePosition - start) + getCursorOwner().length());
- if (JSPType == EXPRESSION) {
- // if an expression, add then length of the enclosing paren..
- setCursorInExpression(true);
- setRelativeOffset(getRelativeOffset() + EXPRESSION_PREFIX.length());
- }
- }
- ITextRegion jspContent = null;
- if (stRegion.getRegions() != null && stRegion.getRegions().size() > 1)
- jspContent = stRegion.getRegions().get(1);
- return (jspContent != null) ? stRegion.getFullText(jspContent) : stRegion.getFullText(); // don't unescape if it's not an XMLJSP tag
- }
- else if (stRegion.getType() == XMLJSPRegionContexts.JSP_CLOSE) {
- // need to determine cursor owner so that the fCurosorPosition will be
- // correct even if there is no region after the cursor in the JSP file
- setCursorOwner(JSPType);
- }
- // iterate XMLCONTENT and CDATA regions
- // loop fCurrentNode until you hit </jsp:scriptlet> (or other closing tag name)
- while (getCurrentNode() != null && getCurrentNode().getType() != XMLRegionContext.XML_TAG_NAME) // need to stop on the ending tag name...
- {
- start = getCurrentNode().getStartOffset();
- end = getCurrentNode().getEndOffset();
- bufferSize = buffer.length();
- CDATAOffset = unescapeRegion(getCurrentNode(), buffer);
- fInCodeRegion = (start <= fSourcePosition && fSourcePosition <= end);
- if (fInCodeRegion) {
- setCursorOwner(JSPType);
- // this offset is sort of complicated...
- // it's composed of:
- // 1. the length of the start of the current region up till where the cursor is
- // 2. minus the number of characters lost in CDATA translation
- // 3. plus the length of the escaped buffer before the current region, but
- // is still within the jsp tag
- setRelativeOffset((fSourcePosition - getCurrentNode().getStartOffset()) + getCursorOwner().length() - CDATAOffset + bufferSize);
- if (JSPType == EXPRESSION) {
- setCursorInExpression(true);
- // if an expression, add then length of the enclosing paren..
- setRelativeOffset(getRelativeOffset() + EXPRESSION_PREFIX.length());
- }
- }
- if (getCurrentNode() != null)
- advanceNextNode();
- }
- return buffer.toString();
- }
-
- /**
- * @param r the region to be unescaped (XMLContent, XML ENTITY REFERENCE, or CDATA)
- * @param sb the stringbuffer to append the text to
- * @return the number of characters removed in unescaping this text
- */
- protected int unescapeRegion(ITextRegion r, StringBuffer sb) {
- String s = ""; //$NON-NLS-1$
- int lengthBefore = 0, lengthAfter = 0, cdata_tags_length = 0;
- if (r != null && (r.getType() == XMLRegionContext.XML_CONTENT || r.getType() == XMLRegionContext.XML_ENTITY_REFERENCE)) {
- lengthBefore = (getCurrentNode() != r) ? getCurrentNode().getFullText(r).length() : getCurrentNode().getFullText().length();
- s = EscapedTextUtil.getUnescapedText(getCurrentNode(), r);
- lengthAfter = s.length();
- sb.append(s);
- }
- else if (r != null && r.getType() == XMLRegionContext.XML_CDATA_TEXT) {
- if (r instanceof ITextRegionContainer) // only interested in contents
- {
- // navigate to next region container (which should be a JSP region)
- Iterator it = ((ITextRegionContainer) r).getRegions().iterator();
- ITextRegion temp = null;
- while (it.hasNext()) {
- temp = (ITextRegion) it.next();
- if (temp instanceof ITextRegionContainer || temp.getType() == XMLRegionContext.XML_CDATA_TEXT) {
- sb.append(getCurrentNode().getFullText(temp));
- }
- else if (temp.getType() == XMLRegionContext.XML_CDATA_OPEN || temp.getType() == XMLRegionContext.XML_CDATA_CLOSE) {
- cdata_tags_length += temp.getLength();
- }
- }
- }
- }
- return (lengthBefore - lengthAfter + cdata_tags_length);
- }
-
- //
- // <jsp:useBean>
- protected void translateUseBean(ITextRegionCollection container) {
- ITextRegion r = null;
- String attrName = null;
- String attrValue = null;
- String id = null;
- String type = null;
- String className = null;
-
- Iterator regions = container.getRegions().iterator();
- while (regions.hasNext() && (r = (ITextRegion) regions.next()) != null && (r.getType() != XMLRegionContext.XML_TAG_CLOSE || r.getType() != XMLRegionContext.XML_EMPTY_TAG_CLOSE)) {
-
- attrName = attrValue = null;
- if (r.getType().equals(XMLRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
- attrName = container.getText(r).trim();
- if (regions.hasNext() && (r = (ITextRegion) regions.next()) != null && r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (regions.hasNext() && (r = (ITextRegion) regions.next()) != null && r.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- attrValue = StringUtils.stripQuotes(container.getText(r));
- }
- // has equals, but no value?
- }
- // an attribute with no equals?
- }
- // (pa) might need different logic here if we wanna support more
- if (attrName != null && attrValue != null) {
- if (attrName.equals("id")) //$NON-NLS-1$
- id = attrValue;
- else if (attrName.equals("class")) //$NON-NLS-1$
- className = attrValue;
- else if (attrName.equals("type")) //$NON-NLS-1$
- type = attrValue;
- }
-
- }
- // has id w/ type and/or classname
- // Type id = new Classname();
- // or
- // Type id = null; // if there is no classname
- if (id != null && (type != null || className != null)) {
- if (type == null)
- type = className;
- String prefix = type + " " + id + " = "; //$NON-NLS-1$ //$NON-NLS-2$
- String suffix = "null;\n"; //$NON-NLS-1$
- if (className != null)
- suffix = "new " + className + "();\n"; //$NON-NLS-1$ //$NON-NLS-2$
- IStructuredDocumentRegion referenceRegion = fCurrentNode.getPrevious() != null ? fCurrentNode.getPrevious() : fCurrentNode;
- appendToBuffer(prefix + suffix, fUserCode, true, referenceRegion);
- }
- }
-
- final public int getCursorPosition() {
- return fCursorPosition;
- }
-
- protected boolean isCursorInExpression() {
- return fCursorInExpression;
- }
-
- protected void setCursorInExpression(boolean in) {
- fCursorInExpression = in;
- }
-
- final public void setSourceCursor(int i) {
- fSourcePosition = i;
- }
-
- final public int getSourcePosition() {
- return fSourcePosition;
- }
-
- final public TLDCMDocumentManager getTLDCMDocumentManager() {
- return TaglibController.getTLDCMDocumentManager(fStructuredDocument);
- }
-
- final public void setRelativeOffset(int relativeOffset) {
- this.fRelativeOffset = relativeOffset;
- }
-
- final public int getRelativeOffset() {
- return fRelativeOffset;
- }
-
- private void setCursorOwner(StringBuffer cursorOwner) {
- this.fCursorOwner = cursorOwner;
- }
-
- final public StringBuffer getCursorOwner() {
- return fCursorOwner;
- }
-
- private IStructuredDocumentRegion setCurrentNode(IStructuredDocumentRegion currentNode) {
- return this.fCurrentNode = currentNode;
- }
-
- final public IStructuredDocumentRegion getCurrentNode() {
- return fCurrentNode;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
deleted file mode 100644
index 8bd5363468..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.sse.core.parser.BlockMarker;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionHandler;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.util.Debug;
-import org.eclipse.wst.sse.core.util.StringUtils;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-
-
-/**
- * Parser/helper class for JSPTranslator. Used for parsing XML-JSP regions (in a script block)
- * A lot of logic borrowed from TLDCMDocumentManager. There should be only one XMLJSPRegionHelper per text file
- *
- * @author pavery
- */
-class XMLJSPRegionHelper implements StructuredDocumentRegionHandler {
- private final JSPTranslator fTranslator;
- protected JSPSourceParser fLocalParser = null;
- protected String fTextToParse = null;
- // need this if not at the start of the document (eg. parsing just a script block)
- protected int fStartOfTextToParse = 0;
- // buffers for text that this class parses
- protected List fScriptlets = new ArrayList();
- protected List fExpressions = new ArrayList();
- protected List fDeclarations = new ArrayList();
- // name of the open tag that was last handled (if we are interested in it)
- protected String fTagname = null;
- protected String fTextBefore = ""; //$NON-NLS-1$
- protected String fUnescapedText = ""; //$NON-NLS-1$
- protected String fStrippedText = ""; //$NON-NLS-1$
- // for reconciling cursor position later
- int fPossibleOwner = JSPTranslator.SCRIPTLET;
-
- public XMLJSPRegionHelper(JSPTranslator translator) {
- getLocalParser().addStructuredDocumentRegionHandler(this);
- this.fTranslator = translator;
- }
-
- protected JSPSourceParser getLocalParser() {
- if (fLocalParser == null)
- fLocalParser = new JSPSourceParser();
- return fLocalParser;
- }
-
- public void addBlockMarker(BlockMarker marker) {
- fLocalParser.addBlockMarker(marker);
- }
-
- public void reset(String textToParse) {
- reset(textToParse, 0);
- }
-
- public void reset(String textToParse, int start) {
- fStartOfTextToParse = start;
- getLocalParser().reset(textToParse);
- fTextToParse = textToParse;
- }
-
- public void forceParse() {
- getLocalParser().getDocumentRegions();
- fLocalParser = null;
- }
-
- /*
- * parse an entire file
- */
- public void parse(String filename) {
- // from outer class
- List blockMarkers = this.fTranslator.getBlockMarkers();
- reset(getContents(filename));
- // this adds the current markers from the outer class list
- // to this parser so parsing works correctly
- for (int i = 0; i < blockMarkers.size(); i++) {
- addBlockMarker((BlockMarker) blockMarkers.get(i));
- }
- forceParse();
- }
-
- /*
- * writes out scriptlet, expression, and declaration buffers
- * to the ongoing buffers in the JSPTranslator (calls to outer JSPTranslator methods)
- */
- public void writeToBuffers() {
- IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
- // currentNode should be the <%@page include="xxx"%> StructuredDocumentRegion
- for (int i = 0; i < fScriptlets.size(); i++) {
- this.fTranslator.translateScriptletString((String) fScriptlets.get(i), currentNode, currentNode.getStartOffset(), currentNode.getLength());
- }
- for (int i = 0; i < fExpressions.size(); i++) {
- this.fTranslator.translateExpressionString((String) fExpressions.get(i), currentNode, currentNode.getStartOffset(), currentNode.getLength());
- }
- for (int i = 0; i < fDeclarations.size(); i++) {
- this.fTranslator.translateDeclarationString((String) fDeclarations.get(i), currentNode, currentNode.getStartOffset(), currentNode.getLength());
- }
- }
-
- /*
- * listens to parser node parsed events
- * adds to local scriplet, expression, declaration buffers
- * determines which type of region the cursor is in, and adjusts cursor offset accordingly
- */
- public void nodeParsed(IStructuredDocumentRegion sdRegion) {
- // System.out.println("tagname > " + fTagname);
- // System.out.println("sdRegion > " + sdRegion.getType());
- // System.out.println("sdRegion text is >> " + fTextToParse.substring(sdRegion.getStartOffset(), sdRegion.getEndOffset()));
- // System.out.println("+++=======================");
- try {
- if (isJSPStartRegion(sdRegion)) {
- String nameStr = getRegionName(sdRegion);
- if (isJSPRegion(nameStr))
- fTagname = nameStr;
- else
- fTagname = null;
- }
- else if (sdRegion.getFirstRegion().getType() == XMLJSPRegionContexts.JSP_CONTENT) {
- if (fTagname != null) {
- // assign contents to one of the tables
- if (isScriptlet(fTagname)) {
- processScriptlet(sdRegion);
- }
- else if (isExpression(fTagname)) {
- processExpression(sdRegion);
- }
- else if (isDeclaration(fTagname)) {
- processDeclaration(sdRegion);
- }
- else {
- processOtherRegions(sdRegion);
- }
- }
- }
- else if (sdRegion.getFirstRegion().getType() == XMLRegionContext.XML_CONTENT) {
- if (fTagname != null) {
- processUseBean(sdRegion);
- processOtherRegions(sdRegion);
- }
- }
- else {
- fTagname = null;
- }
- // this updates cursor position
- checkCursorInRegion(sdRegion);
- }
- catch (NullPointerException e) {
- // logging this exception that I've seen a couple of times...
- // seems to happen during shutdown of unit tests, at which
- // point Logger has already been unloaded
- try {
- Logger.logException("XMLJSPRegionHelper: exception in node parsing", e); //$NON-NLS-1$
- }
- catch (NoClassDefFoundError ex) {
- // do nothing, since we're just ending
- }
- }
- }
-
- public void resetNodes() {
- // do nothing
- }
-
- private void checkCursorInRegion(IStructuredDocumentRegion sdRegion) {
- // if cursor is in this region...
- if (this.fTranslator.getSourcePosition() >= fStartOfTextToParse + sdRegion.getStartOffset() && this.fTranslator.getSourcePosition() <= fStartOfTextToParse + sdRegion.getEndOffset()) {
- int endOfNameTag = sdRegion.getStartOffset();
- int offset = fTextBefore.length() - fStrippedText.length();
- // offset in addtion to what's already in the buffer
- this.fTranslator.setRelativeOffset(this.fTranslator.getSourcePosition() - (fStartOfTextToParse + endOfNameTag) - offset);
- // outer class method
- this.fTranslator.setCursorOwner(fPossibleOwner);
- // add length of what's already in the buffer
- this.fTranslator.setRelativeOffset(this.fTranslator.getRelativeOffset() + this.fTranslator.getCursorOwner().length());
- if (fPossibleOwner == JSPTranslator.EXPRESSION) {
- // add length of expression prefix if necessary...
- this.fTranslator.setRelativeOffset(this.fTranslator.getRelativeOffset() + JSPTranslator.EXPRESSION_PREFIX.length());
- }
- }
- }
-
- protected void processDeclaration(IStructuredDocumentRegion sdRegion) {
- prepareText(sdRegion);
- fDeclarations.add(fStrippedText);
- fPossibleOwner = JSPTranslator.DECLARATION;
- }
-
- protected void processExpression(IStructuredDocumentRegion sdRegion) {
- prepareText(sdRegion);
- fExpressions.add(fStrippedText);
- fPossibleOwner = JSPTranslator.EXPRESSION;
- }
-
- protected void processScriptlet(IStructuredDocumentRegion sdRegion) {
- prepareText(sdRegion);
- fScriptlets.add(fStrippedText);
- fPossibleOwner = JSPTranslator.SCRIPTLET;
- }
-
- /*
- * Substitutes values for entity references, strips CDATA tags, and keeps
- * track of string length(s) for cursor position calculation later.
- * @param sdRegion
- */
- protected void prepareText(IStructuredDocumentRegion sdRegion) {
- fTextBefore = fTextToParse.substring(sdRegion.getStartOffset(), sdRegion.getEndOffset());
- fUnescapedText = EscapedTextUtil.getUnescapedText(fTextBefore);
- fStrippedText = this.fTranslator.stripCDATA(fUnescapedText);
- }
-
- protected void processUseBean(IStructuredDocumentRegion sdRegion) {
- if (fTagname != null && isUseBean(fTagname)) {
- // previous region has the actual attributes
- sdRegion = sdRegion.getPrevious();
- String beanClass, beanType, beanId, beanDecl = ""; //$NON-NLS-1$
- beanClass = getAttributeValue("class", sdRegion); //$NON-NLS-1$
- beanType = getAttributeValue("type", sdRegion); //$NON-NLS-1$
- beanId = getAttributeValue("id", sdRegion); //$NON-NLS-1$
-
- if (beanId != null && (beanType != null || beanClass != null)) {
- if (beanType.equals(""))
- beanType = beanClass;
- String prefix = beanType + " " + beanId + " = "; //$NON-NLS-1$ //$NON-NLS-2$
- String suffix = "null;\n"; //$NON-NLS-1$
- if (beanClass != null)
- suffix = "new " + beanClass + "();\n"; //$NON-NLS-1$ //$NON-NLS-2$
- beanDecl = prefix + suffix;
- }
-
- fScriptlets.add(beanDecl);
- fPossibleOwner = JSPTranslator.SCRIPTLET;
- }
- }
-
- protected void processOtherRegions(IStructuredDocumentRegion sdRegion) {
- processIncludeDirective(sdRegion);
- processPageDirective(sdRegion);
- }
-
- protected void processIncludeDirective(IStructuredDocumentRegion sdRegion) {
- if (isIncludeDirective(fTagname)) {
- // the directive name region itself contains the attrs...
- if (sdRegion.getRegions().get(0).getType() == XMLRegionContext.XML_CONTENT)
- sdRegion = sdRegion.getPrevious();
- String fileLocation = getAttributeValue("file", sdRegion); //$NON-NLS-1$
- this.fTranslator.handleIncludeFile(fileLocation);
- }
- else if (isPossibleCustomTag(fTagname)) {
- // this custom tag may define variables
- this.fTranslator.addTaglibVariables(fTagname);
- }
- else if (isTaglibDirective(fTagname)) {
- // also add the ones created here to the parent document
- String prefix = getAttributeValue("prefix", sdRegion); //$NON-NLS-1$
- List docs = this.fTranslator.getTLDCMDocumentManager().getCMDocumentTrackers(prefix, this.fTranslator.getCurrentNode().getEnd());
- Iterator it = docs.iterator();
- Iterator elements = null;
- CMNode node = null;
- CMDocument doc = null;
- BlockMarker marker = null;
- while (it.hasNext()) {
- doc = (CMDocument) it.next();
- elements = doc.getElements().iterator();
- while (elements.hasNext()) {
- node = (CMNode) elements.next();
- marker = new BlockMarker(node.getNodeName(), null, XMLJSPRegionContexts.JSP_CONTENT, true);
- // global scope is OK because we have encountered this <@taglib> directive
- // so it all markers from it should will be in scope
- // add to this local parser
- addBlockMarker(marker);
- // add to outer class marker list, for
- this.fTranslator.getBlockMarkers().add(marker);
- }
- }
- }
- }
-
- protected void processPageDirective(IStructuredDocumentRegion sdRegion) {
- if (isPageDirective(fTagname)) {
- while (sdRegion != null) {
- if (sdRegion.getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME)
- break;
- sdRegion = sdRegion.getPrevious();
- }
- String importValue = getAttributeValue("import", sdRegion); //$NON-NLS-1$
- if (importValue != "") { //$NON-NLS-1$
- // had to add "false" parameter to ensure these
- // imports don't get added to jsp <-> java map (since they are from an included file)
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81687
- this.fTranslator.addImports(importValue, false);
- }
- }
- }
-
- /*
- * convenience method to get an attribute value from attribute name
- */
- protected String getAttributeValue(String attrName, IStructuredDocumentRegion sdRegion) {
- String sdRegionText = fTextToParse.substring(sdRegion.getStartOffset(), sdRegion.getEndOffset());
- String textRegionText, attrValue = ""; //$NON-NLS-1$
- Iterator it = sdRegion.getRegions().iterator();
- ITextRegion nameRegion, valueRegion = null;
- while (it.hasNext()) {
- nameRegion = (ITextRegion) it.next();
- if (nameRegion.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- textRegionText = sdRegionText.substring(nameRegion.getStart(), nameRegion.getEnd());
- if (textRegionText.equalsIgnoreCase(attrName)) {
- while (it.hasNext()) {
- valueRegion = (ITextRegion) it.next();
- if (valueRegion.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- attrValue = sdRegionText.substring(valueRegion.getStart(), valueRegion.getEnd());
- break; // inner
- }
- }
- break; // outer
- }
- }
- }
- return StringUtils.stripQuotes(attrValue);
- }
-
- // these methods determine what content gets added to the local scriplet, expression, declaration buffers
- /*
- * return true for elements whose contents we might want to add to the java file we are building
- */
- protected boolean isJSPStartRegion(IStructuredDocumentRegion sdRegion) {
- return (sdRegion.getFirstRegion().getType() == XMLRegionContext.XML_TAG_OPEN || sdRegion.getFirstRegion().getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_OPEN);
- }
-
- protected boolean isJSPRegion(String tagName) {
- return isDeclaration(tagName) || isExpression(tagName) || isScriptlet(tagName) || isUseBean(tagName) || isIncludeDirective(tagName) || isPossibleCustomTag(tagName) || isTaglibDirective(tagName) || isPageDirective(tagName);
- }
-
- protected boolean isDeclaration(String tagName) {
- return tagName.equalsIgnoreCase("jsp:declaration"); //$NON-NLS-1$
- }
-
- protected boolean isExpression(String tagName) {
- return tagName.equalsIgnoreCase("jsp:expression"); //$NON-NLS-1$
- }
-
- protected boolean isScriptlet(String tagName) {
- return tagName.equalsIgnoreCase("jsp:scriptlet"); //$NON-NLS-1$
- }
-
- protected boolean isUseBean(String tagName) {
- return tagName.equalsIgnoreCase("jsp:useBean"); //$NON-NLS-1$
- }
-
- protected boolean isIncludeDirective(String tagName) {
- return tagName.equalsIgnoreCase("jsp:directive.include"); //$NON-NLS-1$
- }
-
- protected boolean isPossibleCustomTag(String tagName) {
- return tagName.indexOf(":") > 1; //$NON-NLS-1$
- }
-
- protected boolean isTaglibDirective(String tagName) {
- return tagName.equalsIgnoreCase("jsp:directive.taglib"); //$NON-NLS-1$
- }
-
- protected boolean isPageDirective(String tagName) {
- return tagName.equalsIgnoreCase("jsp:directive.page"); //$NON-NLS-1$
- }
-
- protected String getRegionName(IStructuredDocumentRegion sdRegion) {
- ITextRegion nameRegion = null;
- String nameStr = ""; //$NON-NLS-1$
- int size = sdRegion.getRegions().size();
- if (size > 1) {
- // presumably XML-JSP <jsp:scriptlet> | <jsp:expression> | <jsp:declaration>
- nameRegion = sdRegion.getRegions().get(1);
- nameStr = fTextToParse.substring(sdRegion.getStartOffset(nameRegion), sdRegion.getTextEndOffset(nameRegion));
- }
- return nameStr.trim();
- }
-
- /*
- * get the contents of a file as a String
- */
- protected String getContents(String fileName) {
- StringBuffer s = new StringBuffer();
- int c = 0;
- int count = 0;
- InputStream is = null;
- try {
- IPath filePath = new Path(fileName);
- IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
- if(f != null && !f.exists()) {
- f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(filePath);
- }
- if (f != null && f.exists()) {
- is = f.getContents();
- while ((c = is.read()) != -1) {
- count++;
- s.append((char) c);
- }
- }
- }
- catch (Exception e) {
- if (Debug.debugStructuredDocument)
- e.printStackTrace();
- }
- finally {
- try {
- if (is != null) {
- is.close();
- }
- }
- catch (Exception e) {
- // nothing to do
- }
- }
- return s.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/IndexWorkspaceJob.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/IndexWorkspaceJob.java
deleted file mode 100644
index 3a4d0db6fe..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/IndexWorkspaceJob.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jst.jsp.core.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-
-/**
- * Re-indexes the entire workspace.
- * Ensures the JSP Index is in a stable state before performing a search.
- * (like after a crash or if previous indexing was canceled)
- *
- * @author pavery
- */
-public class IndexWorkspaceJob extends Job {
-
- // for debugging
- static final boolean DEBUG;
- static {
- String value= Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspindexmanager"); //$NON-NLS-1$
- DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- /**
- * Visitor that retrieves jsp project paths for all jsp files in the workspace,
- * and adds the files to be indexed as they are encountered
- */
- private class JSPFileVisitor implements IResourceProxyVisitor {
- private List files = new ArrayList();
-
- // monitor from the Job
- IProgressMonitor fInnerMonitor = null;
- public JSPFileVisitor(IProgressMonitor monitor) {
- this.fInnerMonitor = monitor;
- }
-
- public boolean visit(IResourceProxy proxy) throws CoreException {
-
- // check job canceled
- if (this.fInnerMonitor != null && this.fInnerMonitor.isCanceled()) {
- setCanceledState();
- return false;
- }
-
- // check search support canceled
- if(JSPSearchSupport.getInstance().isCanceled()) {
- setCanceledState();
- return false;
- }
-
- if (proxy.getType() == IResource.FILE) {
-
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
- // check this before description
- // check name before actually getting the file (less work)
- if(getJspContentType().isAssociatedWith(proxy.getName())) {
- IFile file = (IFile) proxy.requestResource();
- if(file.exists()) {
-
- if(DEBUG)
- System.out.println("(+) IndexWorkspaceJob adding file: " + file.getName());
- // this call will check the ContentTypeDescription, so don't need to do it here.
- //JSPSearchSupport.getInstance().addJspFile(file);
- this.files.add(file);
- this.fInnerMonitor.subTask(proxy.getName());
-
- // don't search deeper for files
- return false;
- }
- }
- }
- return true;
- }
-
- public final IFile[] getFiles() {
- return (IFile[])this.files.toArray(new IFile[this.files.size()]);
- }
- }
-
- private IContentType fContentTypeJSP = null;
-
- public IndexWorkspaceJob() {
- // pa_TODO may want to say something like "Rebuilding JSP Index" to be more
- // descriptive instead of "Updating JSP Index" since they are 2 different things
- super(JSPCorePlugin.getResourceString("%JSPIndexManager.0"));
- setPriority(Job.LONG);
- setSystem(true);
- }
-
- IContentType getJspContentType() {
- if(this.fContentTypeJSP == null)
- this.fContentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
- return this.fContentTypeJSP;
- }
-
- /**
- * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
-
- IStatus status = Status.OK_STATUS;
-
- if(monitor.isCanceled()) {
- setCanceledState();
- return Status.CANCEL_STATUS;
- }
-
- if(DEBUG)
- System.out.println(" ^ IndexWorkspaceJob started: "); //$NON-NLS-1$
-
- long start = System.currentTimeMillis();
-
- try {
- JSPFileVisitor visitor = new JSPFileVisitor(monitor);
- // collect all jsp files
- ResourcesPlugin.getWorkspace().getRoot().accept(visitor, IResource.DEPTH_INFINITE);
- // request indexing
- // this is pretty much like faking an entire workspace resource delta
- JSPIndexManager.getInstance().indexFiles(visitor.getFiles());
- }
- catch (CoreException e) {
- if(DEBUG)
- e.printStackTrace();
- }
- finally {
- if(monitor != null)
- monitor.done();
- }
- long finish = System.currentTimeMillis();
- if(DEBUG)
- System.out.println(" ^ IndexWorkspaceJob finished\n total time running: " + (finish - start)); //$NON-NLS-1$
-
- return status;
- }
-
- void setCanceledState() {
- JSPIndexManager.getInstance().setIndexState(JSPIndexManager.S_CANCELED);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager.java
deleted file mode 100644
index c990aabe1a..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager.java
+++ /dev/null
@@ -1,501 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java.search;
-
-import java.io.File;
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.core.index.Index;
-import org.eclipse.jdt.internal.core.search.indexing.IndexManager;
-import org.eclipse.jst.jsp.core.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.osgi.framework.Bundle;
-
-/**
- * Responsible for keeping the JSP index up to date.
- *
- * @author pavery
- */
-public class JSPIndexManager implements IResourceChangeListener {
-
- // for debugging
- static final boolean DEBUG;
- static {
- String value= Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspindexmanager"); //$NON-NLS-1$
- DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private static final String PKEY_INDEX_STATE = "jspIndexState"; //$NON-NLS-1$
-
-
- // set to S_UPDATING once a resource change comes in
- // set to S_STABLE if:
- // - we know we aren't interested in the resource change
- // - or the ProcessFilesJob completes
- // set to S_CANCELED if an indexing job is canceled
- // set to S_REBUILDING if re-indexing the entire workspace
-
- // the int '0' is reserved for the default value if a preference is not there
- /** index is reliable to use*/
- public static final int S_STABLE = 1;
- /** index is being updated (from a resource delta)*/
- public static final int S_UPDATING = 2;
- /** entire index is being rebuilt */
- public static final int S_REBUILDING = 3;
- /** indexing job was canceled in the middle of it, index needs to be rebuilt */
- public static final int S_CANCELED = 4;
-
- /** symbolic name for OSGI framework */
- private final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi";
-
- /**
- * Collects JSP files from a resource delta.
- */
- private class JSPResourceVisitor implements IResourceDeltaVisitor {
- // using hash map ensures only one of each file
- // must be reset before every use
- private HashMap jspFiles = null;
-
- public JSPResourceVisitor() {
- this.jspFiles = new HashMap();
- }
-
- public boolean visit(IResourceDelta delta) throws CoreException {
-
- // in case JSP search was canceled (eg. when closing the editor)
- if(JSPSearchSupport.getInstance().isCanceled() || frameworkIsShuttingDown()) {
- setCanceledState();
- return false;
- }
-
- try {
- int kind = delta.getKind();
- boolean added = (kind & IResourceDelta.ADDED) == IResourceDelta.ADDED;
- boolean isInterestingChange = false;
- if((kind & IResourceDelta.CHANGED) == IResourceDelta.CHANGED) {
- int flags = delta.getFlags();
- // ignore things like marker changes
- isInterestingChange = (flags & IResourceDelta.CONTENT) == IResourceDelta.CONTENT || (flags & IResourceDelta.REPLACED) == IResourceDelta.REPLACED;
- }
- boolean removed = (kind & IResourceDelta.REMOVED) == IResourceDelta.REMOVED;
- if(added || isInterestingChange) {
-
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
- // quick check if it's even JSP related to improve performance
- // checking name from the delta before getting resource because it's lighter
- int numSegments = delta.getFullPath().segmentCount();
- String filename = delta.getFullPath().segment(numSegments-1);
- if (getJspContentType().isAssociatedWith(filename)) {
-
- IResource r = delta.getResource();
- if (r != null && r.getType() == IResource.FILE) {
- this.jspFiles.put(r.getFullPath(), r);
- }
- }
- }
- else if(removed) {
- // handle cleanup
- if(delta.getResource() != null) {
- IResource r = delta.getResource();
- if(r.getType() == IResource.FOLDER && r.exists()) {
- deleteIndex((IFile)r);
- }
- }
- }
- }
- catch (Exception e){
- // need to set state here somehow, and reindex
- // otherwise index will be unreliable
- if(DEBUG)
- Logger.logException("Delta analysis may not be complete", e); //$NON-NLS-1$
- }
- // if the delta has children, continue to add/remove files
- return true;
- }
-
- private void deleteIndex(IFile folder) {
- // cleanup index
- IndexManager im = JavaModelManager.getJavaModelManager().getIndexManager();
- IPath folderPath = folder.getFullPath();
- IPath indexLocation = JSPSearchSupport.getInstance().computeIndexLocation(folderPath);
- im.removeIndex(indexLocation);
-// im.indexLocations.removeKey(folderPath);
-// im.indexLocations.removeValue(indexLocation);
- File f = indexLocation.toFile();
- f.delete();
- }
-
- public IFile[] getFiles() {
- return (IFile[])this.jspFiles.values().toArray(new IFile[this.jspFiles.size()]);
- }
-
- public void reset() {
- this.jspFiles.clear();
- }
- }
- // end class JSPResourceVisitor
-
- /**
- * schedules JSP files for indexing by Java core
- */
- private class ProcessFilesJob extends Job {
- IFile[] jspFiles = null;
- ProcessFilesJob(String taskName, IFile[] files) {
- super(taskName);
- this.jspFiles = files;
- }
-
- protected IStatus run(IProgressMonitor monitor) {
-
- if(isCanceled(monitor) || frameworkIsShuttingDown()) {
- setCanceledState();
- return Status.CANCEL_STATUS;
- }
-
- long start = System.currentTimeMillis();
-
- try {
- // API indicates that monitor is never null
- monitor.beginTask("", this.jspFiles .length); //$NON-NLS-1$
- JSPSearchSupport ss = JSPSearchSupport.getInstance();
- String processingNFiles = ""; //$NON-NLS-1$
-
-
- for(int i = 0; i<this.jspFiles.length; i++) {
-
- if(isCanceled(monitor) || frameworkIsShuttingDown()) {
- setCanceledState();
- return Status.CANCEL_STATUS;
- }
- try {
- ss.addJspFile(this.jspFiles [i]);
- // JSP Indexer processing n files
- processingNFiles = JSPCorePlugin.getResourceString("%JSPIndexManager.2", new String[]{Integer.toString((this.jspFiles .length -i))});
- monitor.subTask(processingNFiles + " - " + this.jspFiles [i].getName());
- monitor.worked(1);
-
- if(DEBUG) {
- System.out.println("JSPIndexManager Job added file: " + this.jspFiles [i].getName()); //$NON-NLS-1$
- }
- }
- catch (Exception e){
- // RATLC00284776
- // ISSUE: we probably shouldn't be catching EVERY exception, but
- // the framework only allows to return IStatus in order to communicate
- // that something went wrong, which means the loop
- // won't complete, and we would hit the same problem the next time.
- //
- // a possible solution is to keep track of the exceptions logged
- // and only log a certain amt of the same one, otherwise skip it.
- if(!frameworkIsShuttingDown()) {
- String filename = this.jspFiles[i] != null ? this.jspFiles[i].getFullPath().toString() : ""; //$NON-NLS-1$
- Logger.logException("JSPIndexer problem indexing:" + filename, e); //$NON-NLS-1$
- }
- }
- } // end for
- }
- finally {
- // just in case something didn't follow API (monitor is null)
- if(monitor != null)
- monitor.done();
- }
-
- long finish = System.currentTimeMillis();
- long diff = finish - start;
- if(DEBUG) {
- fTotalTime += diff;
- System.out.println("============================================================================"); //$NON-NLS-1$
- System.out.println("this time: " + diff +" cumulative time for resource changed: " + fTotalTime); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("============================================================================"); //$NON-NLS-1$
- }
- return Status.OK_STATUS;
- }
-
- private boolean isCanceled(IProgressMonitor runMonitor) {
-
- boolean canceled = false;
- // check specific monitor passed into run method (the progress group in this case)
- // check main search support canceled
- if(runMonitor != null && runMonitor.isCanceled())
- canceled = true;
- else if(JSPSearchSupport.getInstance().isCanceled())
- canceled = true;
- return canceled;
- }
- }
- // end class ProcessFilesJob
-
- private static JSPIndexManager fSingleton = null;
- private JSPResourceVisitor fVisitor = null;
- private IContentType fContentTypeJSP = null;
-
- static long fTotalTime = 0;
-
- private JSPIndexManager(){
- // only one instance
- }
-
- public synchronized static JSPIndexManager getInstance() {
-
- if(fSingleton == null)
- fSingleton = new JSPIndexManager();
- return fSingleton;
- }
-
- /**
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
-
- // ignore resource changes if already rebuilding
- if(getIndexState() == S_REBUILDING)
- return;
- // previously canceled, needs entire index rebuild
- if(getIndexState() == S_CANCELED) {
- rebuildIndex();
- return;
- }
-
- // set flag, so we know if a job is going to be started
- // and the state will eventually be set back to S_STABLE
- boolean beganProcess = false;
- setUpdatingState();
-
- IResourceDelta delta = event.getDelta();
- if(delta != null) {
- // only care about adds or changes right now...
- int kind = delta.getKind();
- boolean added = (kind & IResourceDelta.ADDED) == IResourceDelta.ADDED;
- boolean changed = (kind & IResourceDelta.CHANGED) == IResourceDelta.CHANGED;
- if(added || changed) {
-
- // only analyze the full (starting at root) delta hierarchy
- if(delta.getFullPath().toString().equals("/")) { //$NON-NLS-1$
- try {
- JSPResourceVisitor v = getVisitor();
- // clear from last run
- v.reset();
- // count files, possibly do this in a job too...
- // don't include PHANTOM resources
- delta.accept(v, false);
-
- // process files from this delta
- IFile[] files = v.getFiles();
- if(files.length > 0) {
- //processFiles(files);
- indexFiles(files);
- beganProcess = true;
- }
- }
- catch (CoreException e) {
- // need to set state here somehow, and reindex
- // otherwise index will be unreliable
- if(DEBUG)
- Logger.logException(e);
- }
- catch (Exception e) {
- // need to set state here somehow, and reindex
- // otherwise index will be unreliable
- if(DEBUG)
- Logger.logException(e);
- }
- }
- }
-
- }
- // if we never kicked off process, job won't set back to stable
- // so we set it here
- if(!beganProcess) {
- setStableState();
- }
- }
-
- public synchronized void setIndexState(int state) {
- if(DEBUG) {
- System.out.println("JSPIndexManager setting index state to: " + state2String(state));
- }
- Plugin jspModelPlugin = JSPCorePlugin.getDefault();
- jspModelPlugin.getPluginPreferences().setValue(PKEY_INDEX_STATE, state);
- jspModelPlugin.savePluginPreferences();
-
- }
- private String state2String(int state) {
- String s = "UNKNOWN";
- switch(state) {
- case(S_STABLE):
- s = "S_STABLE";
- break;
- case(S_UPDATING):
- s = "S_UPDATING";
- break;
- case(S_CANCELED):
- s = "S_CANCELED";
- break;
- case(S_REBUILDING):
- s = "S_REBUILDING";
- break;
- }
- return s;
- }
- public int getIndexState() {
- return JSPCorePlugin.getDefault().getPluginPreferences().getInt(PKEY_INDEX_STATE);
- }
- public void setUpdatingState() {
- if(getIndexState() != S_CANCELED)
- setIndexState(S_UPDATING);
- }
- public void setCanceledState() {
- setIndexState(JSPIndexManager.S_CANCELED);
- }
- // ca
- public void setStableState() {
- if(getIndexState() != S_CANCELED)
- setIndexState(S_STABLE);
- }
- public void setRebuildingState() {
- setIndexState(S_REBUILDING);
- }
- public synchronized void rebuildIndexIfNeeded() {
- if(getIndexState() != S_STABLE) {
- rebuildIndex();
- }
- }
-
- private void rebuildIndex() {
-
- if(DEBUG)
- System.out.println("*** JSP Index unstable, requesting re-indexing");
-
- final IndexWorkspaceJob indexingJob = new IndexWorkspaceJob();
-
- indexingJob.addJobChangeListener(new JobChangeAdapter() {
- public void aboutToRun(IJobChangeEvent event) {
- super.aboutToRun(event);
- setRebuildingState();
- }
- public void done(IJobChangeEvent event) {
- super.done(event);
- setStableState();
- indexingJob.removeJobChangeListener(this);
- }
- });
- indexingJob.schedule();
-
- }
-
- /**
- * Creates and schedules a Job to process collected files.
- * All JSP indexing should be done through this method or processFiles(IFile file)
- * @param files
- */
- public final void indexFiles(IFile[] files) {
- // updating JSP Index
- String taskName = JSPCorePlugin.getResourceString("%JSPIndexManager.0");
-
- // Processing resource delta
- final Job processFiles = new ProcessFilesJob(taskName, files);
-
- // only show in verbose mode
- processFiles.setSystem(true);
-
- // don't use this rule
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4931
- //processFiles.setRule(new IndexFileRule());
-
- processFiles.setPriority(Job.LONG);
- processFiles.addJobChangeListener(new JobChangeAdapter() {
- public void done(IJobChangeEvent event) {
- super.done(event);
- setStableState();
- }
- });
- processFiles.schedule();
- }
-
-
- /**
- * Package protected for access by inner Job class in resourceChanged(...)
- * @return
- */
- JSPResourceVisitor getVisitor() {
-
- if(this.fVisitor == null) {
- this.fVisitor = new JSPResourceVisitor();
- }
- return this.fVisitor;
- }
-
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5091
- // makes sure IndexManager is aware of our indexes
- public void saveIndexes() {
- IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager();
- IPath jspModelWorkingLocation = JSPSearchSupport.getInstance().getModelJspPluginWorkingLocation();
-
- File folder = new File(jspModelWorkingLocation.toOSString());
- String[] files = folder.list();
- String locay = ""; //$NON-NLS-1$
- Index index = null;
- try {
- for(int i=0; i<files.length; i++) {
- if(files[i].toLowerCase().endsWith(".index")) { //$NON-NLS-1$
- locay = jspModelWorkingLocation.toString() +"/" + files[i]; //$NON-NLS-1$
- index = new Index(locay, "Index for " + locay, true /*reuse index file*/); //$NON-NLS-1$
- indexManager.saveIndex(index);
- }
- }
- }
- catch (Exception e) {
- // we should be shutting down, want to shut down quietly
- if(DEBUG)
- e.printStackTrace();
- }
- }
-
- IContentType getJspContentType() {
- if(this.fContentTypeJSP == null)
- this.fContentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
- return this.fContentTypeJSP;
- }
-
- /**
- * A check to see if the OSGI framework is shutting down.
- * @return true if the System Bundle is stopped (ie. the framework is shutting down)
- */
- boolean frameworkIsShuttingDown() {
- // in the Framework class there's a note:
- // set the state of the System Bundle to STOPPING.
- // this must be done first according to section 4.19.2 from the OSGi R3 spec.
- boolean shuttingDown = Platform.getBundle(OSGI_FRAMEWORK_ID).getState() == Bundle.STOPPING;
- if (DEBUG && shuttingDown) {
- System.out.println("JSPIndexManager: system is shutting down!");
- }
- return shuttingDown;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPPathIndexer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPPathIndexer.java
deleted file mode 100644
index cb454631e2..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPPathIndexer.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java.search;
-
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jst.jsp.core.contenttype.ContentTypeIdForJSP;
-
-/**
- * pa_TODO Still need to take into consideration:
- * - focus in workspace
- * - search pattern
- *
- * @author pavery
- */
-public class JSPPathIndexer {
-
- // for debugging
- static final boolean DEBUG;
- static {
- String value= Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspsearch"); //$NON-NLS-1$
- DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- // visitor that retrieves jsp project paths for all jsp files in the workspace
- class JSPFileVisitor implements IResourceProxyVisitor {
- // hash map forces only one of each file
- private HashMap fPaths = new HashMap();
- IJavaSearchScope fScope = null;
- SearchPattern fPattern = null;
-
- public JSPFileVisitor(SearchPattern pattern, IJavaSearchScope scope) {
- this.fPattern = pattern;
- this.fScope = scope;
- }
-
- public boolean visit(IResourceProxy proxy) throws CoreException {
-
- if(JSPSearchSupport.getInstance().isCanceled())
- return false;
-
- if (proxy.getType() == IResource.FILE) {
-
- IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
- // check this before description
- // check name before actually getting the file (less work)
- if(contentTypeJSP.isAssociatedWith(proxy.getName())) {
-
- IFile file = (IFile)proxy.requestResource();
- IContentDescription contentDescription = file.getContentDescription();
- String ctId = null;
- if (contentDescription != null) {
- ctId = contentDescription.getContentType().getId();
- }
- if (ContentTypeIdForJSP.ContentTypeID_JSP.equals(ctId)) {
- if (this.fScope.encloses(proxy.requestFullPath().toString())) {
-
- if (DEBUG)
- System.out.println("adding selected index path:" + file.getParent().getFullPath()); //$NON-NLS-1$
-
- fPaths.put(file.getParent().getFullPath(), JSPSearchSupport.getInstance().computeIndexLocation(file.getParent().getFullPath()));
- }
- }
- }
- // don't search deeper for files
- return false;
- }
- return true;
- }
-
- public IPath[] getPaths() {
- return (IPath[]) fPaths.values().toArray(new IPath[fPaths.size()]);
- }
- }
-
- public IPath[] getVisibleJspPaths(SearchPattern pattern, IJavaSearchScope scope) {
-
- JSPFileVisitor jspFileVisitor = new JSPFileVisitor(pattern, scope);
- try {
- ResourcesPlugin.getWorkspace().getRoot().accept(jspFileVisitor, 0);
- }
- catch (CoreException e) {
- e.printStackTrace();
- }
- return jspFileVisitor.getPaths();
- }
-}
-
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
deleted file mode 100644
index 2b4a0261cb..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java.search;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.search.SearchParticipant;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationExtension;
-import org.eclipse.wst.common.encoding.exceptions.UnsupportedCharsetExceptionWithDetail;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.xml.core.document.XMLDocument;
-import org.eclipse.wst.xml.core.document.XMLModel;
-
-
-/**
- * Created with a .jsp file, but should appear to be a .java file for indexing
- * and searching purposes. There are purposely few fields in this class,
- * and those fields are lightweight since it's possible for many JSP search
- * documents to exist in memory at one time (eg. after importing a project
- * with a large number of JSP files)
- *
- * @author pavery
- */
-public class JSPSearchDocument {
-
- private String UNKNOWN_PATH = "**path unknown**"; //$NON-NLS-1$
- private String fJSPPathString = UNKNOWN_PATH;
- private String fCUPath = UNKNOWN_PATH;
- private SearchParticipant fParticipant = null;
-
- /**
- * @param file
- * @param participant
- * @throws CoreException
- */
- public JSPSearchDocument(String filePath, SearchParticipant participant) {
-
- this.fJSPPathString = filePath;
- this.fParticipant = participant;
- }
-
- public SearchParticipant getParticipant() {
- return this.fParticipant;
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchDocument#getCharContents()
- */
- public char[] getCharContents() {
- JSPTranslation trans = getJSPTranslation();
- return trans != null ? trans.getJavaText().toCharArray() : new char[0];
- }
-
- public String getJavaText() {
- return new String(getCharContents());
- }
-
- private IModelManager getModelManager() {
- return StructuredModelManager.getModelManager();
- }
-
- /**
- * It's not recommended for clients to hold on to this JSPTranslation
- * since it's kind of large. If possible, hold on to the JSPSearchDocument,
- * which is more of a lightweight proxy.
- *
- * @return the JSPTranslation for the jsp file, or null if it's an unsupported file.
- */
- public final JSPTranslationExtension getJSPTranslation() {
- JSPTranslationExtension translation = null;
- IFile jspFile = getFile();
- if(!JSPSearchSupport.isJsp(jspFile))
- return translation;
-
- XMLModel xmlModel = null;
- try {
- // get existing model for read, then get document from it
- xmlModel = (XMLModel) getModelManager().getModelForRead(jspFile);
- // handle unsupported
- if (xmlModel != null) {
- setupAdapterFactory(xmlModel);
- XMLDocument doc = xmlModel.getDocument();
- JSPTranslationAdapter adapter = (JSPTranslationAdapter) doc.getAdapterFor(IJSPTranslation.class);
- translation = adapter.getJSPTranslation();
- }
- }
- catch (IOException e) {
- Logger.logException(e);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- catch (UnsupportedCharsetExceptionWithDetail e) {
- // no need to log this. Just consider it an invalid file for our
- // purposes.
- //Logger.logException(e);
- }
- finally {
- if (xmlModel != null)
- xmlModel.releaseFromRead();
- }
- return translation;
- }
-
- /**
- * add the factory for JSPTranslationAdapter here
- *
- * @param sm
- */
- private void setupAdapterFactory(IStructuredModel sm) {
- JSPTranslationAdapterFactory factory = new JSPTranslationAdapterFactory();
- sm.getFactoryRegistry().addFactory(factory);
- }
-
- /**
- * the path to the Java compilation unit
- *
- * @see org.eclipse.jdt.core.search.SearchDocument#getPath()
- */
- public String getPath() {
- JSPTranslation trans = getJSPTranslation();
- // caching the path since it's expensive to get translation
- if(this.fCUPath == null || this.fCUPath == UNKNOWN_PATH) {
- if(trans != null)
- this.fCUPath = trans.getJavaPath();
- }
- return fCUPath != null ? fCUPath : UNKNOWN_PATH;
- }
-
- public int getJspOffset(int javaOffset) {
- // copied from JSPTranslation
- int result = -1;
- int offsetInRange = 0;
- Position jspPos, javaPos = null;
- JSPTranslation trans = getJSPTranslation();
- if(trans != null) {
- HashMap java2jspMap = trans.getJava2JspMap();
-
- // iterate all mapped java ranges
- Iterator it = java2jspMap.keySet().iterator();
- while (it.hasNext()) {
- javaPos = (Position) it.next();
- // need to count the last position as included
- if (!javaPos.includes(javaOffset) && !(javaPos.offset+javaPos.length == javaOffset))
- continue;
-
- offsetInRange = javaOffset - javaPos.offset;
- jspPos = (Position) java2jspMap.get(javaPos);
-
- if(jspPos != null)
- result = jspPos.offset + offsetInRange;
- else {
- Logger.log(Logger.ERROR, "jspPosition was null!" + javaOffset); //$NON-NLS-1$
- }
- break;
- }
- }
- return result;
- }
-
- public IFile getFile() {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IPath jspPath = new Path(this.fJSPPathString);
- IFile jspFile = root.getFile(jspPath);
- if(!jspFile.exists()) {
- // possibly outside workspace
- jspFile = root.getFileForLocation(jspPath);
- }
- return jspFile;
- }
-
- public void release() {
- // nothing to do now since JSPTranslation is created on the fly
- }
-
- /**
- * for debugging
- */
- public String toString() {
- return "[JSPSearchDocument:" + this.fJSPPathString + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.core.search.SearchDocument#getEncoding()
- */
- public String getEncoding() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.core.search.SearchDocument#getByteContents()
- */
- public byte[] getByteContents() {
- // TODO Auto-generated method stub
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchParticipant.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchParticipant.java
deleted file mode 100644
index 044f5aaacc..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchParticipant.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchDocument;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.core.search.SearchParticipant;
-import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jdt.core.search.SearchRequestor;
-
-/**
- * Integration of JSP w/ java search.
- *
- * @author pavery
- */
-public class JSPSearchParticipant extends SearchParticipant {
-
- // for debugging
- private static final boolean DEBUG;
- static {
- String value= Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspsearch"); //$NON-NLS-1$
- DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- /**
- * Important to never return null here or else Java search participation will break.
- */
- public SearchDocument getDocument(String documentPath) {
-
- SearchDocument sDoc = JSPSearchSupport.getInstance().getSearchDocument(documentPath);
-
- if(sDoc == null){
- // return a dummy doc here so search participation doesn't break
- return new NullSearchDocument(documentPath);
- }
- return sDoc;
- }
-
- public String getDescription() {
- return "JSP"; //$NON-NLS-1$
- }
-
- public IPath[] selectIndexes(SearchPattern pattern, IJavaSearchScope scope) {
- JSPPathIndexer indexer = new JSPPathIndexer();
- return indexer.getVisibleJspPaths(pattern, scope);
- }
-
- public void indexDocument(SearchDocument document, IPath indexPath) {
- if (!(document instanceof JavaSearchDocumentDelegate))
- return;
-
- // use Java search indexing
- SearchEngine.getDefaultSearchParticipant().indexDocument(document, indexPath);
- }
-
- public void locateMatches(SearchDocument[] indexMatches, SearchPattern pattern, IJavaSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor) throws CoreException {
-
- if(monitor != null && monitor.isCanceled())
- return;
-
- // filter out null matches
- List filtered = new ArrayList();
- SearchDocument match = null;
- for (int i = 0; i < indexMatches.length; i++) {
- if (DEBUG)
- System.out.println("found possible matching JavaSearchDocumentDelegate: " + indexMatches[i]); //$NON-NLS-1$
- match = indexMatches[i];
- if (match != null) {
- // some matches may be null, or if the index is out of date, the file may not even exist
- if(match instanceof JavaSearchDocumentDelegate && ((JavaSearchDocumentDelegate)match).getFile().exists())
- filtered.add(match);
- }
- }
-
- indexMatches = (SearchDocument[]) filtered.toArray(new SearchDocument[filtered.size()]);
- SearchEngine.getDefaultSearchParticipant().locateMatches(indexMatches, pattern, scope, requestor, monitor);
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchParticipant#beginSearching()
- */
- public void beginSearching() {
- // nothing to do
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchParticipant#doneSearching()
- */
- public void doneSearching() {
- // nothing to do
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchParticipant#getDocument(org.eclipse.core.resources.IFile)
- */
- public SearchDocument getDocument(IFile file) {
- // never gets called?
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchScope.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchScope.java
deleted file mode 100644
index 49cc26de4f..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchScope.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java.search;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-
-/**
- * Used to constrain JSP/java search to certain paths and elements.
- * @author pavery
- */
-public class JSPSearchScope implements IJavaSearchScope {
-
- private boolean fEnclosesAll = false;
- private List fResourcePaths = null;
- private List fJavaElements = null;
-
- public JSPSearchScope() {
- // empty constructor just returns true for everything
- // everything is in scope
- this.fEnclosesAll = true;
- init();
- }
-
- public JSPSearchScope(String[] resourceStringPath) {
- init();
- fResourcePaths.addAll(Arrays.asList(resourceStringPath));
- }
-
- public JSPSearchScope(IJavaElement[] javaElement) {
- init();
- fJavaElements.addAll(Arrays.asList(javaElement));
- }
-
- private void init() {
- this.fResourcePaths = new ArrayList();
- this.fJavaElements = new ArrayList();
- }
-
- public boolean encloses(String resourcePathString) {
-
- if (this.fEnclosesAll)
- return true;
- else if (enclosesPath(resourcePathString))
- return true;
-
- return false;
- }
-
- public boolean encloses(IJavaElement element) {
-
- // pa_TOD implement
- if (this.fEnclosesAll)
- return true;
-
- return true;
- }
-
- public boolean encloses(IResourceProxy element) {
-
- if (this.fEnclosesAll)
- return true;
- else if (enclosesPath(element.requestFullPath().toOSString()))
- return true;
-
- return true;
- }
-
- public void addPath(String path) {
- this.fResourcePaths.add(path);
- }
-
- public void addElement(IJavaElement element) {
- this.fJavaElements.add(element);
- }
-
- private boolean enclosesPath(String possible) {
-
- String[] paths = (String[]) fResourcePaths.toArray(new String[fResourcePaths.size()]);
- for (int i = 0; i < paths.length; i++) {
- if (possible.equals(paths[i]))
- return true;
- }
- return false;
- }
-
- public String getDescription() {
-
- return "JSPSearchScope"; //$NON-NLS-1$
- }
-
- public IPath[] enclosingProjectsAndJars() {
-
- // pa_TODO
- return null;
- }
-
- public boolean includesBinaries() {
- return false;
- }
-
- public boolean includesClasspaths() {
- return false;
- }
-
- public void setIncludesBinaries(boolean includesBinaries) {
- // do nothing
- }
-
- public void setIncludesClasspaths(boolean includesClasspaths) {
- // do nothing
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java
deleted file mode 100644
index 6f007b524a..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java
+++ /dev/null
@@ -1,569 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java.search;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.zip.CRC32;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchDocument;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jdt.core.search.SearchRequestor;
-import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
-import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.core.search.indexing.IndexManager;
-import org.eclipse.jst.jsp.core.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.java.JSP2ServletNameUtil;
-
-/**
- * Central access to java indexing and search. All contact between JDT indexing
- * and Searching should be done through here.
- *
- * Clients should access the methods of this class via the single instance via
- * <code>getInstance()</code>.
- *
- * @author pavery
- */
-public class JSPSearchSupport {
-
- // for debugging
- static final boolean DEBUG;
- static {
- String value = Platform.getDebugOption("com.ibm.sse.model.jsp/debug/jspsearch"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private static JSPSearchSupport singleton = null;
-
- private JSPSearchParticipant fParticipant = null;
-
- private IPath fJspPluginLocation = null;
-
- // pa_TODO may be slow (esp for indexing entire workspace)
- private final CRC32 fChecksumCalculator = new CRC32();
-
- /** main cancel montior for all search support */
- private final IProgressMonitor fMonitor = new NullProgressMonitor();
-
- private JSPSearchSupport() {
- // force use of single instance
- }
-
- /**
- * This operation ensures that the live resource's search markers show up in
- * the open editor. It also allows the ability to pass in a ProgressMonitor
- */
- private class SearchJob extends Job implements IJavaSearchConstants {
-
- String fSearchText = ""; //$NON-NLS-1$
-
- IJavaSearchScope fScope = null;
-
- int fSearchFor = FIELD;
-
- int fLimitTo = ALL_OCCURRENCES;
-
- int fMatchMode = SearchPattern.R_PATTERN_MATCH;
-
- boolean fIsCaseSensitive = false;
-
- SearchRequestor fRequestor = null;
-
- IJavaElement fElement = null;
-
- // constructor w/ java element
- public SearchJob(IJavaElement element, IJavaSearchScope scope, SearchRequestor requestor) {
-
- super("JSP Search - " + element.getElementName());
- this.fElement = element;
- this.fScope = scope;
- this.fRequestor = requestor;
- }
-
- // constructor w/ search text
- public SearchJob(String searchText, IJavaSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
-
- super("JSP Search - " + searchText);
- this.fSearchText = searchText;
- this.fScope = scope;
- this.fSearchFor = searchFor;
- this.fLimitTo = limitTo;
- this.fMatchMode = matchMode;
- this.fIsCaseSensitive = isCaseSensitive;
- this.fRequestor = requestor;
- }
-
- public IStatus run(IProgressMonitor jobMonitor) {
-
- if (jobMonitor != null && jobMonitor.isCanceled())
- return Status.CANCEL_STATUS;
- if (JSPSearchSupport.getInstance().isCanceled())
- return Status.CANCEL_STATUS;
-
- SearchPattern javaSearchPattern = null;
- // if an element is available, use that to create search pattern
- // (eg. LocalVariable)
- // otherwise use the text and other paramters
- if (this.fElement != null)
- javaSearchPattern = SearchPattern.createPattern(this.fElement, this.fLimitTo);
- else
- javaSearchPattern = SearchPattern.createPattern(this.fSearchText, this.fSearchFor, this.fLimitTo, this.fMatchMode);
-
- if (javaSearchPattern != null) {
- JSPSearchParticipant[] participants = { getSearchParticipant() };
- SearchEngine engine = new SearchEngine();
- try {
- if (jobMonitor != null)
- jobMonitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
- engine.search(javaSearchPattern, participants, this.fScope, this.fRequestor, jobMonitor);
- } catch (CoreException e) {
- if (DEBUG)
- Logger.logException(e);
- }
- // non-CoreExceptions will permanently stall the Worker thread
- catch (Exception e) {
- if (DEBUG)
- Logger.logException(e);
- } finally {
- if (jobMonitor != null)
- jobMonitor.done();
- }
- }
- return Status.OK_STATUS;
- }
- }
-
- // end SearchJob
- /**
- * Runnable forces caller to wait until finished (as opposed to using a Job)
- */
- private class SearchRunnable implements IWorkspaceRunnable, IJavaSearchConstants {
-
- String fSearchText = ""; //$NON-NLS-1$
-
- IJavaSearchScope fScope = null;
-
- int fSearchFor = FIELD;
-
- int fLimitTo = ALL_OCCURRENCES;
-
- int fMatchMode = SearchPattern.R_PATTERN_MATCH;
-
- boolean fIsCaseSensitive = false;
-
- SearchRequestor fRequestor = null;
-
- IJavaElement fElement = null;
-
- // constructor w/ java element
- public SearchRunnable(IJavaElement element, IJavaSearchScope scope, SearchRequestor requestor) {
-
- this.fElement = element;
- this.fScope = scope;
- this.fRequestor = requestor;
- }
-
- // constructor w/ search text
- public SearchRunnable(String searchText, IJavaSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
-
- this.fSearchText = searchText;
- this.fScope = scope;
- this.fSearchFor = searchFor;
- this.fLimitTo = limitTo;
- this.fMatchMode = matchMode;
- this.fIsCaseSensitive = isCaseSensitive;
- this.fRequestor = requestor;
- }
-
- public void run(IProgressMonitor monitor) throws CoreException {
-
- if (monitor != null && monitor.isCanceled())
- return;
- if (JSPSearchSupport.getInstance().isCanceled())
- return;
-
- SearchPattern javaSearchPattern = null;
- // if an element is available, use that to create search pattern
- // (eg. LocalVariable)
- // otherwise use the text and other paramters
- if (this.fElement != null)
- javaSearchPattern = SearchPattern.createPattern(this.fElement, fLimitTo);
- else
- javaSearchPattern = SearchPattern.createPattern(fSearchText, fSearchFor, fLimitTo, fMatchMode);
-
- if (javaSearchPattern != null) {
- JSPSearchParticipant[] participants = { getSearchParticipant() };
- SearchEngine engine = new SearchEngine();
- try {
- if (monitor != null)
- monitor.beginTask("", 0); //$NON-NLS-1$
- engine.search(javaSearchPattern, participants, fScope, fRequestor, monitor);
- } catch (CoreException e) {
- Logger.logException(e);
- //throw e;
- }
- // non-CoreExceptions will permanently stall the Worker thread
- catch (Exception e) {
- Logger.logException(e);
- } finally {
- if (monitor != null)
- monitor.done();
- }
- }
- }
- }
-
- // end SearchRunnable
-
- /**
- * Clients should access the methods of this class via the single instance
- * via getInstance()
- *
- * @return
- */
- public synchronized static JSPSearchSupport getInstance() {
-
- if (singleton == null)
- singleton = new JSPSearchSupport();
- return singleton;
- }
-
- /**
- * Utility method to check if a file is a jsp file (since this is done
- * frequently)
- */
- public static boolean isJsp(IFile file) {
-
- boolean isJsp = false;
- InputStream is = null;
- try {
- if (file != null && file.exists()) {
-
- IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
- // check this before description, it's less expensive
- if (contentTypeJSP.isAssociatedWith(file.getName())) {
-
- IContentDescription contentDescription = file.getContentDescription();
- // it can be null
- if (contentDescription == null) {
- is = file.getContents();
- contentDescription = Platform.getContentTypeManager().getDescriptionFor(is, file.getName(), new QualifiedName[] { IContentDescription.CHARSET });
- }
- if (contentDescription != null) {
- String fileCtId = contentDescription.getContentType().getId();
- isJsp = (fileCtId != null && ContentTypeIdForJSP.ContentTypeID_JSP.equals(fileCtId));
- }
- }
- }
- } catch (IOException e) {
- // ignore, assume it's invalid JSP
- } catch (CoreException e) {
- // ignore, assume it's invalid JSP
- } finally {
- // must close input stream in case others need it
- if (is != null)
- try {
- is.close();
- } catch (Exception e) {
- // not sure how to recover at this point
- }
- }
- return isJsp;
- }
-
- /**
- * schedules a search document representing this JSP file for indexing (by
- * the java indexer)
- *
- * @param file
- * the JSP file
- * @return true if indexing was successful, false otherwise
- * @throws CoreException
- */
- public SearchDocument addJspFile(IFile file) {
- if (JSPSearchSupport.getInstance().isCanceled()) {
- return null;
- }
-
- if (DEBUG)
- System.out.println("adding JSP file:" + file.getFullPath()); //$NON-NLS-1$
-
- // create
- SearchDocument delegate = createSearchDocument(file);
- // null if not a jsp file
- if (delegate != null) {
- try {
- getSearchParticipant().scheduleDocumentIndexing(delegate, computeIndexLocation(file.getParent().getFullPath()));
- } catch (Exception e) {
- // ensure that failure here doesn't keep other documents from
- // being indexed
- // if peformed in a batch call (like JSPIndexManager)
- if (DEBUG)
- e.printStackTrace();
- }
- }
-
- if (DEBUG)
- System.out.println("scheduled" + delegate + "for indexing"); //$NON-NLS-1$ //$NON-NLS-2$
-
- return delegate;
- }
-
- /**
- * Perform a java search w/ the given parameters. Runs in a background Job
- * (results may still come in after this method call)
- *
- * @param searchText
- * the string of text to search on
- * @param searchFor
- * IJavaSearchConstants.TYPE, METHOD, FIELD, PACKAGE, etc...
- * @param limitTo
- * IJavaSearchConstants.DECLARATIONS,
- * IJavaSearchConstants.REFERENCES,
- * IJavaSearchConstants.IMPLEMENTORS, or
- * IJavaSearchConstants.ALL_OCCURRENCES
- * @param matchMode
- * allow * wildcards or not
- * @param isCaseSensitive
- * @param requestor
- * passed in to accept search matches (and do "something" with
- * them)
- */
- public void search(String searchText, IJavaSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
-
- JSPIndexManager.getInstance().rebuildIndexIfNeeded();
-
- SearchJob job = new SearchJob(searchText, scope, searchFor, limitTo, matchMode, isCaseSensitive, requestor);
- setCanceled(false);
- job.setUser(true);
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5032
- // pops up user operation blocked dialog if you perform a long search,
- // then open a file because it locks the workspace
- //job.setRule(ResourcesPlugin.getWorkspace().getRoot());
- job.schedule();
- }
-
- /**
- * Search for an IJavaElement, constrained by the given parameters. Runs in
- * a background Job (results may still come in after this method call)
- *
- * @param element
- * @param scope
- * @param requestor
- */
- public void search(IJavaElement element, IJavaSearchScope scope, SearchRequestor requestor) {
-
- JSPIndexManager.getInstance().rebuildIndexIfNeeded();
-
- SearchJob job = new SearchJob(element, scope, requestor);
- setCanceled(false);
- job.setUser(true);
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5032
- //job.setRule(ResourcesPlugin.getWorkspace().getRoot());
- job.schedule();
- }
-
- /**
- * Search for an IJavaElement, constrained by the given parameters. Runs in
- * an IWorkspace runnable (results will be reported by the end of this
- * method)
- *
- * @param element
- * @param scope
- * @param requestor
- */
- public void searchRunnable(IJavaElement element, IJavaSearchScope scope, SearchRequestor requestor) {
-
- JSPIndexManager.getInstance().rebuildIndexIfNeeded();
-
- SearchRunnable searchRunnable = new SearchRunnable(element, scope, requestor);
- try {
- setCanceled(false);
- ResourcesPlugin.getWorkspace().run(searchRunnable, JSPSearchSupport.getInstance().getProgressMonitor());
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @param jspFile
- * @return SearchDocument if the file is not null, exists, and is a JSP
- * file, otherwise null.
- */
- private SearchDocument createSearchDocument(IFile jspFile) {
-
- JavaSearchDocumentDelegate delegate = null;
- if (jspFile != null && jspFile.exists() && isJsp(jspFile)) {
-
- delegate = new JavaSearchDocumentDelegate(new JSPSearchDocument(jspFile.getFullPath().toString(), getSearchParticipant()));
- }
- return delegate;
-
- }
-
- /**
- * Centralized place to access JSPSearchDocuments (used by
- * JSPSearchParticipant and JSPSearchRequestor)
- *
- * @param searchDocPath
- * @param doc
- * @return the JSPSearchDocument or null if one is not found
- */
- public SearchDocument getSearchDocument(String searchDocPath) {
-
- SearchDocument delegate = null;
- IFile f = fileForCUPath(searchDocPath);
- if (f != null) {
- delegate = createSearchDocument(f);
- } else {
- // handle failure case... (file deleted maybe?)
- }
- return delegate;
- }
-
- /**
- * Unmangles the searchDocPath and returns the corresponding JSP file.
- *
- * @param searchDocPath
- */
- private IFile fileForCUPath(String searchDocPath) {
-
- String[] split = searchDocPath.split("/"); //$NON-NLS-1$
- String classname = split[split.length - 1];
-
- // ignore anything but .java matches (like .class binary matches)
- if(!searchDocPath.endsWith(".java")) {
- return null;
- }
-
- String filePath = JSP2ServletNameUtil.unmangle(classname);
-
- // try absolute path
- IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(filePath));
- // workspace relative then
- if(f == null) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=86009
- // must have a project name as well
- // which would mean >= 2 path segments
- IPath path = new Path(filePath);
- if(path.segmentCount() >= 2) {
- f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }
- return f;
- }
-
- JSPSearchParticipant getSearchParticipant() {
-
- if (this.fParticipant == null)
- this.fParticipant = new JSPSearchParticipant();
- return this.fParticipant;
- }
-
- // This is called from JSPPathIndexer
- // pa_TODO
- //how can we make sure participant indexLocations are updated at startup?
- public final IPath computeIndexLocation(IPath containerPath) {
-
- // pa_TODO there should be a non internal way to do this.
- IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager();
- SimpleLookupTable indexLocations = indexManager.indexLocations;
-
- String indexLocation = null;
- Object obj = indexLocations.get(containerPath);
- if (obj != null) {
- indexLocation = (String) obj;
- } else {
- // create index entry
- String pathString = containerPath.toOSString();
- this.fChecksumCalculator.reset();
- this.fChecksumCalculator.update(pathString.getBytes());
- String fileName = Long.toString(this.fChecksumCalculator.getValue()) + ".index"; //$NON-NLS-1$
- // this is the only difference from
- // IndexManager#computeIndexLocation(...)
- indexLocation = getModelJspPluginWorkingLocation().append(fileName).toOSString();
-
- // pa_TODO need to add to java path too, so JDT search support knows
- // there should be a non internal way to do this.
- indexLocations.put(containerPath, indexLocation);
- }
- return new Path(indexLocation);
- }
-
- // copied from JDT IndexManager
- public IPath getModelJspPluginWorkingLocation() {
-
- if (this.fJspPluginLocation != null)
- return this.fJspPluginLocation;
-
- IPath stateLocation = JSPCorePlugin.getDefault().getStateLocation();
-
- // pa_TODO workaround for
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=62267
- // copied from IndexManager
- String device = stateLocation.getDevice();
- if (device != null && device.charAt(0) == '/')
- stateLocation = stateLocation.setDevice(device.substring(1));
-
- return this.fJspPluginLocation = stateLocation;
- }
-
- /**
- * JSP Indexing and Search jobs check this
- *
- * @return
- */
- public synchronized final void setCanceled(boolean cancel) {
-
- fMonitor.setCanceled(cancel);
- }
-
- /**
- * JSP Indexing and Search jobs check this
- *
- * @return
- */
- public synchronized final boolean isCanceled() {
-
- return fMonitor.isCanceled();
- }
-
- /**
- * JSP Indexing and Search jobs check this
- *
- * @return
- */
- public final IProgressMonitor getProgressMonitor() {
-
- return this.fMonitor;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JavaSearchDocumentDelegate.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JavaSearchDocumentDelegate.java
deleted file mode 100644
index 83f13d1940..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JavaSearchDocumentDelegate.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.search.SearchDocument;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationExtension;
-
-
-/**
- * Wrapper method to set getPath() path to be the path of the compilation unit
- * for the jsp file. (since it's a final method, it needs to be set via constructor)
- *
- * @author pavery
- */
-public class JavaSearchDocumentDelegate extends SearchDocument {
-
- private JSPSearchDocument fJSPSearchDoc = null;
-
- public JavaSearchDocumentDelegate(JSPSearchDocument jspSearchDoc) {
-
- super(jspSearchDoc.getPath(), jspSearchDoc.getParticipant());
- this.fJSPSearchDoc = jspSearchDoc;
- }
-
- public byte[] getByteContents() {
-
- return this.fJSPSearchDoc.getByteContents();
- }
-
- public char[] getCharContents() {
-
- return this.fJSPSearchDoc.getCharContents();
- }
-
- public String getJavaText() {
- return this.fJSPSearchDoc.getJavaText();
- }
-
- public String getEncoding() {
-
- return this.fJSPSearchDoc.getEncoding();
- }
-
- public IFile getFile() {
-
- return this.fJSPSearchDoc.getFile();
- }
-
- public JSPTranslationExtension getJspTranslation() {
-
- return this.fJSPSearchDoc.getJSPTranslation();
- }
-
- public int getJspOffset(int javaOffset) {
-
- return this.fJSPSearchDoc.getJspOffset(javaOffset);
- }
-
- public void release() {
- this.fJSPSearchDoc.release();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/NullModelManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/NullModelManager.java
deleted file mode 100644
index 740dad3319..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/NullModelManager.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java.search;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Enumeration;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.common.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.IModelManagerListener;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.exceptions.ResourceAlreadyExists;
-import org.eclipse.wst.sse.core.exceptions.ResourceInUse;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.util.URIResolver;
-
-/**
- * Simple "null" implementation, entirely to more easily handle case where
- * model manager can't be retrieved due to workspace shutting down. Its intent
- * is to help minimize null checks (especially new null checks :)
- */
-public class NullModelManager implements IModelManager {
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#aboutToChangeModels()
- */
- public void aboutToChangeModels() {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#createStructuredDocumentFor(org.eclipse.core.resources.IFile)
- */
- public IStructuredDocument createStructuredDocumentFor(IFile iFile) throws IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#createNewStructuredDocumentFor(org.eclipse.core.resources.IFile)
- */
- public IStructuredDocument createNewStructuredDocumentFor(IFile iFile) throws ResourceAlreadyExists, IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#createStructuredDocumentFor(java.lang.String)
- */
- public IStructuredDocument createStructuredDocumentFor(String contentTypeId) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#createStructuredDocumentFor(java.lang.String,
- * java.io.InputStream, com.ibm.sse.model.util.URIResolver)
- */
- public IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver) throws IOException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#createStructuredDocumentFor(java.lang.String,
- * java.lang.String, com.ibm.sse.model.util.URIResolver)
- */
- public IStructuredDocument createStructuredDocumentFor(String filename, String content, URIResolver resolver) throws IOException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#createStructuredDocumentFor(java.lang.String,
- * java.io.InputStream, com.ibm.sse.model.util.URIResolver,
- * java.lang.String)
- */
- public IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver, String ianaEncodingName) throws IOException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#createUnManagedStructuredModelFor(org.eclipse.core.resources.IFile)
- */
- public IStructuredModel createUnManagedStructuredModelFor(IFile iFile) throws IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#createUnManagedStructuredModelFor(java.lang.String)
- */
- public IStructuredModel createUnManagedStructuredModelFor(String contentTypeId) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#createUnManagedStructuredModelFor(java.lang.String,
- * com.ibm.sse.model.util.URIResolver)
- */
- public IStructuredModel createUnManagedStructuredModelFor(String contentTypeId, URIResolver resolver) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#addModelManagerListener(com.ibm.sse.model.IModelManagerListener)
- */
- public void addModelManagerListener(IModelManagerListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#changedModels()
- */
- public void changedModels() {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#copyModelForEdit(java.lang.String,
- * java.lang.String)
- */
- public IStructuredModel copyModelForEdit(String oldId, String newId) throws ResourceInUse {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getExistingModelForEdit(java.lang.Object)
- */
- public IStructuredModel getExistingModelForEdit(Object id) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getExistingModelForEdit(org.eclipse.core.resources.IFile)
- */
- public IStructuredModel getExistingModelForEdit(IFile iFile) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getExistingModelForRead(java.lang.Object)
- */
- public IStructuredModel getExistingModelForRead(Object id) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getExistingModelForRead(org.eclipse.core.resources.IFile)
- */
- public IStructuredModel getExistingModelForRead(IFile iFile) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getExistingModelIds()
- */
- public Enumeration getExistingModelIds() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getModelForEdit(org.eclipse.core.resources.IFile)
- */
- public IStructuredModel getModelForEdit(IFile iFile) throws IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getModelForEdit(org.eclipse.core.resources.IFile,
- * java.lang.String, java.lang.String)
- */
- public IStructuredModel getModelForEdit(IFile iFile, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getModelForEdit(org.eclipse.core.resources.IFile,
- * com.ibm.encoding.resource.EncodingRule)
- */
- public IStructuredModel getModelForEdit(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getModelForRead(org.eclipse.core.resources.IFile,
- * com.ibm.encoding.resource.EncodingRule)
- */
- public IStructuredModel getModelForRead(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getModelForRead(org.eclipse.core.resources.IFile)
- */
- public IStructuredModel getModelForRead(IFile iFile) throws IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getModelForRead(org.eclipse.core.resources.IFile,
- * java.lang.String, java.lang.String)
- */
- public IStructuredModel getModelForRead(IFile iFile, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getModelForEdit(java.lang.String,
- * java.io.InputStream, com.ibm.sse.model.util.URIResolver)
- */
- public IStructuredModel getModelForEdit(String filename, InputStream inStream, URIResolver resolver) throws UnsupportedEncodingException, IOException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getModelForRead(java.lang.String,
- * java.io.InputStream, com.ibm.sse.model.util.URIResolver)
- */
- public IStructuredModel getModelForRead(String filename, InputStream inStream, URIResolver resolver) throws UnsupportedEncodingException, IOException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getNewModelForEdit(org.eclipse.core.resources.IFile,
- * boolean)
- */
- public IStructuredModel getNewModelForEdit(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getNewModelForRead(org.eclipse.core.resources.IFile,
- * boolean)
- */
- public IStructuredModel getNewModelForRead(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getReferenceCount(java.lang.Object)
- */
- public int getReferenceCount(Object id) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getReferenceCountForEdit(java.lang.Object)
- */
- public int getReferenceCountForEdit(Object id) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getReferenceCountForRead(java.lang.Object)
- */
- public int getReferenceCountForRead(Object id) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#isShared(java.lang.Object)
- */
- public boolean isShared(Object id) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#isSharedForEdit(java.lang.Object)
- */
- public boolean isSharedForEdit(Object id) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#isSharedForRead(java.lang.Object)
- */
- public boolean isSharedForRead(Object id) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#isStateChanging()
- */
- public boolean isStateChanging() {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#moveModel(java.lang.Object,
- * java.lang.Object)
- */
- public void moveModel(Object oldId, Object newId) {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#reloadModel(java.lang.Object,
- * java.io.InputStream)
- */
- public IStructuredModel reloadModel(Object id, InputStream inStream) throws UnsupportedEncodingException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#reinitialize(com.ibm.sse.model.IStructuredModel)
- */
- public IStructuredModel reinitialize(IStructuredModel model) throws IOException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#removeModelManagerListener(com.ibm.sse.model.IModelManagerListener)
- */
- public void removeModelManagerListener(IModelManagerListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#saveStructuredDocument(com.ibm.sse.model.text.IStructuredDocument,
- * org.eclipse.core.resources.IFile)
- */
- public void saveStructuredDocument(IStructuredDocument structuredDocument, IFile iFile) throws UnsupportedEncodingException, IOException, CoreException {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#calculateId(org.eclipse.core.resources.IFile)
- */
- public String calculateId(IFile file) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#calculateBaseLocation(org.eclipse.core.resources.IFile)
- */
- public String calculateBaseLocation(IFile file) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#createNewInstance(com.ibm.sse.model.IStructuredModel)
- */
- public IStructuredModel createNewInstance(IStructuredModel model) throws IOException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getExistingModelForRead(org.eclipse.jface.text.IDocument)
- */
- public IStructuredModel getExistingModelForRead(IDocument document) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelManager#getExistingModelForEdit(org.eclipse.jface.text.IDocument)
- */
- public IStructuredModel getExistingModelForEdit(IDocument document) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.model.IModelManager#getModelForEdit(com.ibm.sse.model.text.IStructuredDocument)
- */
- public IStructuredModel getModelForEdit(IStructuredDocument textFileBufferDocument) {
- // TODO Auto-generated method stub
- return null;
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.model.IModelManager#getModelForRead(com.ibm.sse.model.text.IStructuredDocument)
- */
- public IStructuredModel getModelForRead(IStructuredDocument textFileBufferDocument) {
- // TODO Auto-generated method stub
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/NullSearchDocument.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/NullSearchDocument.java
deleted file mode 100644
index ad99a1023d..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/NullSearchDocument.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.java.search;
-
-import org.eclipse.jdt.core.search.SearchDocument;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslator;
-
-
-
-/**
- * An empty servlet, safe for Java search participation
- *
- * @author pavery
- */
-public class NullSearchDocument extends SearchDocument {
-
- StringBuffer fEmptyServletBuffer = null;
-
- public NullSearchDocument(String documentPath) {
- super(documentPath, new JSPSearchParticipant()); //$NON-NLS-1$
- this.fEmptyServletBuffer = new JSPTranslator().getEmptyTranslation();
- }
-
- public byte[] getByteContents() {
- return this.fEmptyServletBuffer.toString().getBytes();
- }
-
- public char[] getCharContents() {
- return this.fEmptyServletBuffer.toString().toCharArray();
- }
-
- public String getEncoding() {
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPCodeRegion.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPCodeRegion.java
deleted file mode 100644
index b7b143465c..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPCodeRegion.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.parser;
-
-
-
-import org.eclipse.jst.jsp.core.contenttype.ContentTypeIdForJSP;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-
-public class JSPCodeRegion extends ForeignRegion {
-
- protected RegionParser fBlockNodeChecker = null;
-
- /**
- * JavaCodeRegion constructor comment.
- */
- public JSPCodeRegion() {
- super();
- }
-
- public JSPCodeRegion(String newContext, int newStart, int newTextLength, int newLength) {
- super(newContext, newStart, newTextLength, newLength, "jsp-java"); //$NON-NLS-1$
- }
-
- /**
- *
- * @return RegionParser
- */
- protected RegionParser getBlockNodeChecker() {
- if (fBlockNodeChecker == null) {
- IModelManager mmanager = StructuredModelManager.getModelManager();
- fBlockNodeChecker = mmanager.createStructuredDocumentFor(ContentTypeIdForJSP.ContentTypeID_JSP).getParser();
- }
- return fBlockNodeChecker;
- }
-
- /**
- * @see com.ibm.sed.interfaces.core.IRegionCodeAssistProcessor
- */
- public void setStructuredDocument(IStructuredDocument structuredDocument) {
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPDirectiveStructuredDocumentRegion.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPDirectiveStructuredDocumentRegion.java
deleted file mode 100644
index 33d026e530..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPDirectiveStructuredDocumentRegion.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.parser;
-
-import org.eclipse.wst.sse.core.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.text.XMLStructuredDocumentRegion;
-
-public class JSPDirectiveStructuredDocumentRegion extends XMLStructuredDocumentRegion {
- /**
- * JSPDirectiveStructuredDocumentRegion constructor comment.
- */
- public JSPDirectiveStructuredDocumentRegion() {
- super();
- }
-
- protected StructuredDocumentEvent reparse(Object requester, String changes, int requestStart, int lengthToReplace) {
- return null;
- }
-
- // This is a language specific method (e.g. HTML, Java, Prolog, etc.) so
- // could/should be made configurable.
- public StructuredDocumentEvent updateModel(Object requester, String changes, int requestStart, int lengthToReplace, IStructuredDocumentRegion flatnode) {
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPReParser.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPReParser.java
deleted file mode 100644
index 74f27c50bc..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPReParser.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.parser;
-
-
-import java.util.Iterator;
-
-import org.eclipse.jst.jsp.core.JSP12Namespace;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP11TLDNames;
-import org.eclipse.wst.sse.core.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException;
-import org.eclipse.wst.sse.core.internal.text.CoreNodeList;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionParser;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.sse.core.text.IStructuredTextReParser;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-import org.eclipse.wst.sse.core.util.Debug;
-import org.eclipse.wst.xml.core.internal.parser.XMLStructuredDocumentReParser;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-
-public class JSPReParser extends XMLStructuredDocumentReParser {
-
- /**
- * Allow a reparser to check for extra syntactic cases that require
- * parsing beyond the flatNode boundary.
- *
- * This implementation adds JSP language markers (comments are handled
- * elsewhere).
- */
- protected StructuredDocumentEvent checkForCrossStructuredDocumentRegionSyntax() {
- StructuredDocumentEvent result = super.checkForCrossStructuredDocumentRegionSyntax();
- // None of the superclass' cases were valid, so check for JSP cases
- if (result == null) {
- result = checkForJSP();
- }
- return result;
- }
-
- /**
- * A change to a JSP tag can result in all being reparsed.
- */
- private StructuredDocumentEvent checkForJSP() {
- StructuredDocumentEvent result = null;
- result = checkForCriticalKey("<%"); //$NON-NLS-1$
- if (result == null)
- result = checkForCriticalKey("<%="); //$NON-NLS-1$
- if (result == null)
- result = checkForCriticalKey("<%!"); //$NON-NLS-1$
- if (result == null)
- result = checkForCriticalKey("%>"); //$NON-NLS-1$
-
- return result;
- }
-
- /**
- * If a comment start or end tag is being added or deleted, we'll rescan
- * the whole document. The reason is that content that is revealed or
- * commented out can effect the interpretation of the rest of the
- * document. Note: for now this is very XML/JSP specific, can
- * refactor/improve later.
- */
- protected StructuredDocumentEvent checkForComments() {
-
- StructuredDocumentEvent result = super.checkForComments();
-
- if (result == null)
- result = checkForCriticalKey("<%--"); //$NON-NLS-1$
- if (result == null)
- result = checkForCriticalKey("--%>"); //$NON-NLS-1$
- // we'll also check for these degenerate cases
- if (result == null)
- result = checkForCriticalKey("<%---%>"); //$NON-NLS-1$
-
- return result;
- }
-
- /**
- * The core reparsing method ... after the dirty start and dirty end have
- * been calculated elsewhere. - this method overrides, does not extend
- * super's method. changes/fixes to super may have to be made here as
- * well.
- */
- protected StructuredDocumentEvent reparse(IStructuredDocumentRegion dirtyStart, IStructuredDocumentRegion dirtyEnd) {
- StructuredDocumentEvent result = null;
- int rescanStart = -1;
- int rescanEnd = -1;
- boolean firstTime = false;
- boolean detectedBreakingChange = false;
-
- //
- // "save" the oldNodes (that may be replaced) in a list
- CoreNodeList oldNodes = formOldNodes(dirtyStart, dirtyEnd);
-
- if (containsBreakingChange(oldNodes) || isBreakingWithNestedTag(dirtyStart, dirtyEnd)) {
- if (Debug.debugTaglibs)
- System.out.println("reparse: is taglib or include"); //$NON-NLS-1$
- detectedBreakingChange = true;
- rescanStart = 0;
- rescanEnd = fStructuredDocument.getLength() + fLengthDifference;
- oldNodes = formOldNodes(fStructuredDocument.getFirstStructuredDocumentRegion(), fStructuredDocument.getLastStructuredDocumentRegion());
- clearTaglibInfo();
- }
- else if (dirtyStart == null || dirtyEnd == null) {
- // dirtyStart or dirty end are null, then that means we didn't
- // have a
- // cached node, which means we have an empty document, so we
- // just need to rescan the changes
- rescanStart = 0;
- rescanEnd = fChanges.length();
- firstTime = true;
- }
- else {
- // set the start of the text to rescan
- rescanStart = dirtyStart.getStart();
- //
- // set the end of the text to rescan
- // notice we use the same rationale as for the rescanStart,
- // with the added caveat that length has to be added to it,
- // to compensate for the new text which has been added or deleted.
- // If changes has zero length, then "length" will be negative,
- // since
- // we are deleting text. Otherwise, use the difference between
- // what's selected to be replaced and the length of the new text.
- rescanEnd = dirtyEnd.getEnd() + fLengthDifference;
- }
-
- // now that we have the old stuff "saved" away, update the document
- // with the changes.
- fStructuredDocument.updateDocumentData(fStart, fLengthToReplace, fChanges);
- // ------------------ now the real work
- result = core_reparse(rescanStart, rescanEnd, oldNodes, firstTime);
- //
-
- // if we did not detect a breaking type of change at the beginning,
- // but
- // do now, then reparse all! If we did detect them, then we may or may
- // not detect again, but presumably we've already set up to re-parsed
- // everthing, so no need to do again.
- if ((!detectedBreakingChange) && (containsBreakingChange(oldNodes))) {
- clearTaglibInfo();
- // reparse all
- oldNodes = formOldNodes(fStructuredDocument.getFirstStructuredDocumentRegion(), fStructuredDocument.getLastStructuredDocumentRegion());
- result = core_reparse(0, fStructuredDocument.getLength(), oldNodes, firstTime);
- }
-
- // event is returned to the caller, incase there is
- // some optimization they can do
- return result;
- }
-
- /**
- * Verifies that the regions given, representing the contents of a
- * IStructuredDocumentRegion, contain regions that could alter the
- * behavior of the parser or the parsing of areas outside of the regions
- * given.
- */
- private boolean isBreakingChange(IStructuredDocumentRegion node, ITextRegionList regions) {
- return isTaglibOrInclude(node, regions) || isJspRoot(regions);
- }
-
- /**
- * Verifies that the regions given, representing the regions touched by a
- * text change have: 1) ...an insertion at the textEndOffset of an
- * XML_TAG_OPEN that's in it's own IStructuredDocumentRegion and preceded
- * by an unended IStructuredDocumentRegion 2) ...a deletion happening in
- * an XML_EMPTY_TAG_CLOSE that ends a ITextRegionContainer 3) ...an
- * insertion happening with a ' <' character somewhere in an XML attribute
- * name or value 4) ...a deletion of a normal XML_TAG_CLOSE since
- * subsequent tags become attribute values
- */
-
- private boolean isBreakingWithNestedTag(boolean changesIncludeA_lt, boolean delsIncludeA_gt, IStructuredDocumentRegion parent, ITextRegion region) {
- boolean result = false;
-
- IStructuredDocumentRegion previous = parent.getPrevious();
- // case 1 test
- if (parent.getRegions().size() == 1 && region.getType() == XMLRegionContext.XML_TAG_OPEN && (previous == null || (!previous.isEnded() || previous.getType() == XMLRegionContext.XML_CONTENT))) {
- result = true;
- }
- //case 2 test
- if (region instanceof ITextRegionContainer) {
- ITextRegionContainer container = (ITextRegionContainer) region;
- ITextRegion internal = container.getRegions().get(container.getRegions().size() - 1);
- if (internal.getType() == XMLRegionContext.WHITE_SPACE && container.getRegions().size() >= 2)
- internal = container.getRegions().get(container.getRegions().size() - 2);
- if (internal.getType() == XMLRegionContext.XML_EMPTY_TAG_CLOSE) {
- result = true;
- }
- }
- //case 3 test
- if (changesIncludeA_lt && (region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME || region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
- result = true;
- }
- //case 4 test
- if (delsIncludeA_gt && region.getType() == XMLRegionContext.XML_TAG_CLOSE) {
- result = true;
- }
- return result;
- }
-
- /**
- * Verifies that the regions given, representing the contents of a
- * IStructuredDocumentRegion, includes a jsp:root tag
- */
- private boolean isJspRoot(ITextRegionList regions) {
- return regions.size() > 1 && regions.get(0).getType() == XMLRegionContext.XML_TAG_OPEN && regions.get(1).getType() == XMLJSPRegionContexts.JSP_ROOT_TAG_NAME;
- }
-
- /**
- * Verifies that the regions given, representing the contents of a
- * IStructuredDocumentRegion, includes a valid taglib directive or include
- * directive
- */
- private boolean isTaglibOrInclude(IStructuredDocumentRegion node, ITextRegionList regions) {
- boolean sizeAndTypesMatch = (regions.size() > 1) && (regions.get(1).getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME)
- && (regions.get(0).getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_OPEN || regions.get(0).getType() == XMLRegionContext.XML_TAG_OPEN);
- if (!sizeAndTypesMatch)
- return false;
- ITextRegion region = regions.get(1);
- String directiveName = node.getText(region);
- return sizeAndTypesMatch
- && (directiveName.equals(JSP11TLDNames.TAGLIB) || directiveName.equals(JSP11TLDNames.INCLUDE) || directiveName.equals(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB) || directiveName
- .equals(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE));
- }
-
- private void clearTaglibInfo() {
- if (Debug.debugTaglibs)
- System.out.println("clearing taglib info"); //$NON-NLS-1$
- RegionParser parser = fStructuredDocument.getParser();
- if (parser instanceof StructuredDocumentRegionParser)
- ((StructuredDocumentRegionParser) parser).resetHandlers();
- }
-
- private boolean containsBreakingChange(IStructuredDocumentRegionList list) {
- boolean contains = false;
- for (int i = 0; i < list.getLength(); i++) {
- IStructuredDocumentRegion node = list.item(i);
- if (isBreakingChange(node, node.getRegions())) {
- contains = true;
- break;
- }
- }
- return contains;
- }
-
- protected IStructuredDocumentRegion findDirtyEnd(int end) {
-
- IStructuredDocumentRegion result = super.findDirtyEnd(end);
-
- // if not well formed, get one past, if its not null
-
- // now, if any of to-be-scanned flatnodes are the start of a jsp
- // region, we'll
- // reparse all the way to the end, to be sure we detect embedded
- // regions (or not-embedded regions) correctly.
- // notice we don't need to do if we're only processing one node.
- // notice too we have a strong assumption here that dirtyStart has
- // already been found!
- //
- // note that dirtyEnd is not checked in the do-block below, so we'll
- // check it first.
- if (isJSPEmbeddedStartOrEnd(result)) {
- result = fStructuredDocument.getLastStructuredDocumentRegion();
- }
- else {
- // when end node and start node are the same, we only need the
- // above
- // check, otherwise, there's a few cases that we'll search the
- // rest of the
- // flatnodes needlessly.
- if (result != dirtyStart) {
- IStructuredDocumentRegion searchNode = dirtyStart;
- do {
- if (isJSPEmbeddedStartOrEnd(searchNode)) {
- result = fStructuredDocument.getLastStructuredDocumentRegion();
- break;
- }
- else {
- searchNode = searchNode.getNext();
- }
- // if we get to the current dirty end, or end of
- // flatnodes, without finding JSP region then we
- // don't need to check further
- }
- while ((searchNode != result) && (searchNode != null));
- }
- }
- // result should never be null, but cachedNode needs to be protected
- // from being changed to null
- if (result != null)
- fStructuredDocument.setCachedDocumentRegion(result);
- dirtyEnd = result;
- return dirtyEnd;
- }
-
- private boolean isBreakingWithNestedTag(IStructuredDocumentRegion start, IStructuredDocumentRegion end) {
- boolean result = false;
- boolean changesIncludeA_lt = fChanges != null && fChanges.indexOf('<') >= 0;
- boolean delsIncludeA_gt = fDeletedText != null && fDeletedText.indexOf('>') >= 0;
-
- //List regions = new ArrayList();
- IStructuredDocumentRegion node = start;
- int endReplace = fStart + fLengthToReplace;
- while (end != null && node != end.getNext()) {
- Iterator i = node.getRegions().iterator();
- while (i.hasNext()) {
- ITextRegion region = (ITextRegion) i.next();
- if (intersects(node, region, fStart, endReplace)) {
-
- result = isBreakingWithNestedTag(changesIncludeA_lt, delsIncludeA_gt, node, region);
-
- if (result)
- break;
- }
- }
- node = node.getNext();
- if (result)
- break;
- }
- return result;
- }
-
- private boolean intersects(IStructuredDocumentRegion node, ITextRegion region, int low, int high) {
- int start = node.getStartOffset(region);
- int end = node.getEndOffset(region);
- return (end >= low && start <= high) || (start <= low && end >= low) || (start <= high && end >= high);
- }
-
- /**
- * Returns true if potentially could be a jsp embedded region. Things like
- * JSP Declaration can't be embedded.
- */
- private boolean isJSPEmbeddedStartOrEnd(IStructuredDocumentRegion flatNode) {
- boolean result = false;
- String type = flatNode.getType();
- result = ((type == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN) || (type == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN) || (type == XMLJSPRegionContexts.JSP_DECLARATION_OPEN));
- return result;
- }
-
- /**
- * extends super class behavior
- */
- protected boolean isPartOfBlockRegion(IStructuredDocumentRegion flatNode) {
- boolean result = false;
- String type = flatNode.getType();
- result = ((type == XMLJSPRegionContexts.JSP_CLOSE) || (type == XMLJSPRegionContexts.JSP_CONTENT) || super.isPartOfBlockRegion(flatNode));
- return result;
- }
-
- public IStructuredTextReParser newInstance() {
- return new JSPReParser();
- }
-
- public StructuredDocumentEvent quickCheck() {
- if (containsBreakingChange(new CoreNodeList(dirtyStart, dirtyEnd)))
- return null;
- return super.quickCheck();
- }
-
- public Object clone() {
- try {
- return super.clone();
- }
- catch (CloneNotSupportedException e) {
- // could only happen if some changes
- // superclass someday
- throw new SourceEditingRuntimeException(e);
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java
deleted file mode 100644
index 883637046a..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.parser;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.JSP12Namespace;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP12TLDNames;
-import org.eclipse.jst.jsp.core.internal.parser.internal.JSPTokenizer;
-import org.eclipse.wst.sse.core.internal.text.IRegionComparible;
-import org.eclipse.wst.sse.core.parser.BlockTokenizer;
-import org.eclipse.wst.sse.core.parser.JSPCapableParser;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionHandler;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionHandlerExtension;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionParser;
-import org.eclipse.wst.sse.core.parser.TagMarker;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-import org.eclipse.wst.sse.core.util.Debug;
-import org.eclipse.wst.sse.core.util.StringUtils;
-import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-
-/**
- * Takes input from the JSPTokenizer and creates a tag list
- */
-
-public class JSPSourceParser extends XMLSourceParser implements JSPCapableParser {
- protected class NestablePrefixHandler implements StructuredDocumentRegionHandler, StructuredDocumentRegionHandlerExtension {
-
- private static final String XMLNS = "xmlns:";
-
- /**
- * Enables a TLD owning the given prefix loaded from the given URI at
- * the anchorFlatNode. The list of additionalCMDocuments will claim to
- * not know any of its tags at positions earlier than that
- * IStructuredDocumentRegion's position.
- *
- * For taglib directives, the taglib is the anchor while taglibs
- * registered through include directives use the primary include
- * directive as their anchor.
- */
- protected void enableForTaglib(String prefix, IStructuredDocumentRegion anchorFlatNode) {
- if (prefix == null)
- return;
- List tagmarkers = ((JSPTokenizer) getTokenizer()).getNestablePrefixes();
- for (int i = 0; i < tagmarkers.size(); i++) {
- if (((TagMarker) tagmarkers.get(i)).getTagName().equals(prefix))
- return;
- }
- ((JSPTokenizer) getTokenizer()).getNestablePrefixes().add(new TagMarker(prefix, anchorFlatNode));
- }
-
- public void nodeParsed(IStructuredDocumentRegion aCoreFlatNode) {
- // could test > 1, but since we only care if there are 8 (<%@,
- // taglib, uri, =, where, prefix, =, what) [or 4 for includes]
- if (aCoreFlatNode.getNumberOfRegions() > 4 && aCoreFlatNode.getRegions().get(1).getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME) {
- ITextRegion name = aCoreFlatNode.getRegions().get(1);
- try {
- int offset = aCoreFlatNode.getStartOffset(name);
- int length = name.getTextLength();
- boolean taglibdetected = false;
- boolean taglibdirectivedetected = false;
- if (fCharSequenceSource instanceof IRegionComparible) {
- taglibdetected = ((IRegionComparible) fCharSequenceSource).regionMatches(offset, length, JSP12TLDNames.TAGLIB);
- taglibdirectivedetected = ((IRegionComparible) fCharSequenceSource).regionMatches(offset, length, JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
- }
- else {
- // old fashioned way
- String directiveName = getText(offset, length);
- taglibdetected = directiveName.equals(JSP12TLDNames.TAGLIB);
- taglibdirectivedetected = directiveName.equals(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
- }
- boolean processDirectiveName = taglibdetected || taglibdirectivedetected;
- if (processDirectiveName) {
- processTaglib(aCoreFlatNode);
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- //do nothing
- }
- }
- // could test > 1, but since we only care if there are 5 (<,
- // jsp:root, xmlns:prefix, =, where)
- else if (aCoreFlatNode.getNumberOfRegions() > 4 && (aCoreFlatNode.getRegions().get(1)).getType() == XMLJSPRegionContexts.JSP_ROOT_TAG_NAME) {
- processJSPRoot(aCoreFlatNode);
- }
- }
-
- protected void processJSPRoot(IStructuredDocumentRegion taglibFlatNode) {
- ITextRegionList regions = taglibFlatNode.getRegions();
- String prefix = null;
- boolean taglib = false;
- try {
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- int offset = taglibFlatNode.getStartOffset(region);
- int length = region.getTextLength();
-
- String name = getText(offset, length);
- if (name.startsWith(XMLNS) && name.length() > XMLNS.length()) { //$NON-NLS-1$
- prefix = name.substring(6);
- taglib = true;
- }
- else {
- prefix = null;
- taglib = false;
- }
- }
- else if (taglib && region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- prefix = StringUtils.strip(prefix);
- if (prefix != null && prefix.length() > 0) {
- enableForTaglib(prefix, taglibFlatNode);
- prefix = null;
- }
- }
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- // nothing to be done
- prefix = null;
- }
- }
-
- /**
- * Pulls the prefix from the given taglib directive
- * IStructuredDocumentRegion and makes sure the prefix is nestable.
- */
- protected void processTaglib(IStructuredDocumentRegion taglibFlatNode) {
- ITextRegionList regions = taglibFlatNode.getRegions();
- String prefix = null;
- boolean prefixname = false;
- try {
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- if (fCharSequenceSource != null && fCharSequenceSource instanceof IRegionComparible) {
- int offset = taglibFlatNode.getStartOffset(region);
- int length = region.getTextLength();
- prefixname = ((IRegionComparible) fCharSequenceSource).regionMatches(offset, length, JSP12TLDNames.PREFIX);
- }
- else {
- // old fashioned way
- prefixname = (getText(taglibFlatNode.getStartOffset(region), region.getTextLength()).equals(JSP12TLDNames.PREFIX));
- }
- }
- else if (prefixname && region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- prefix = getText(taglibFlatNode.getStartOffset(region), region.getTextLength());
- }
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- // nothing to be done
- prefix = null;
- }
- prefix = StringUtils.strip(prefix);
- if (prefix != null && prefix.length() > 0) {
- enableForTaglib(prefix, taglibFlatNode);
- }
- }
-
- public void resetNodes() {
- Iterator tagmarkers = ((JSPTokenizer) getTokenizer()).getNestablePrefixes().iterator();
- while (tagmarkers.hasNext()) {
- if (!((TagMarker) tagmarkers.next()).isGlobal())
- tagmarkers.remove();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.parser.StructuredDocumentRegionHandlerExtension#setStructuredDocument(com.ibm.sse.model.text.IStructuredDocument)
- */
- public void setStructuredDocument(IStructuredDocument newDocument) {
- resetNodes();
- getStructuredDocumentRegionHandlers().remove(this);
- if (newDocument != null && newDocument.getParser() instanceof StructuredDocumentRegionParser) {
- ((StructuredDocumentRegionParser) newDocument.getParser()).addStructuredDocumentRegionHandler(this);
- }
- }
- }
-
- /**
- * JSPSourceParser constructor comment.
- */
- public JSPSourceParser() {
- super();
- }
-
- public void addNestablePrefix(TagMarker marker) {
- ((JSPTokenizer) getTokenizer()).addNestablePrefix(marker);
- }
-
- public List getNestablePrefixes() {
- return ((JSPTokenizer) getTokenizer()).getNestablePrefixes();
- }
-
- protected BlockTokenizer getTokenizer() {
- if (fTokenizer == null) {
- fTokenizer = new JSPTokenizer();
- getStructuredDocumentRegionHandlers().add(new NestablePrefixHandler());
- }
- return fTokenizer;
- }
-
- /**
- * @see com.ibm.sed.parser.RegionParser#newInstance()
- */
- public RegionParser newInstance() {
- JSPSourceParser newInstance = new JSPSourceParser();
- newInstance.setTokenizer(getTokenizer().newInstance());
- return newInstance;
- }
-
- protected IStructuredDocumentRegion parseNodes() {
- // regions are initially reported as complete offsets within the
- // scanned input
- // they are adjusted here to be indexes from the currentNode's start
- // offset
- IStructuredDocumentRegion headNode = null;
- IStructuredDocumentRegion lastNode = null;
- ITextRegion region = null;
- // DMW: 2/12/03. Made current node local variable, since
- // we changed class to not require state
- IStructuredDocumentRegion currentNode = null;
- String type = null;
-
- while ((region = getNextRegion()) != null) {
- type = region.getType();
- // these types (might) demand a IStructuredDocumentRegion for each
- // of them
- if (type == XMLRegionContext.BLOCK_TEXT) {
- if (currentNode != null && currentNode.getLastRegion().getType() == XMLRegionContext.BLOCK_TEXT) {
- // multiple block texts indicated embedded containers; no
- // new IStructuredDocumentRegion
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
- // DW, 4/16/2003 token regions no longer have parents
- //region.setParent(currentNode);
- if (region instanceof ITextRegionContainer) {
- ((ITextRegionContainer) region).setParent(currentNode);
- }
- }
- else {
- // not continuing a IStructuredDocumentRegion
- if (currentNode != null) {
- // ensure that any existing node is at least
- // terminated
- if (!currentNode.isEnded()) {
- currentNode.setLength(region.getStart() - currentNode.getStart());
- // fCurrentNode.setTextLength(region.getStart() -
- // fCurrentNode.getStart());
- }
- lastNode = currentNode;
- }
- fireNodeParsed(currentNode);
- currentNode = createStructuredDocumentRegion(type);
- if (lastNode != null) {
- lastNode.setNext(currentNode);
- }
- currentNode.setPrevious(lastNode);
- currentNode.setStart(region.getStart());
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- currentNode.setEnded(true);
- region.adjustStart(-currentNode.getStart());
- currentNode.addRegion(region);
- // DW, 4/16/2003 token regions no longer have parents
- //region.setParent(currentNode);
- if (region instanceof ITextRegionContainer) {
- ((ITextRegionContainer) region).setParent(currentNode);
- }
-
- }
- }
- // the following contexts OPEN new StructuredDocumentRegions
- else if ((currentNode != null && currentNode.isEnded()) || (type == XMLRegionContext.XML_CONTENT) || (type == XMLRegionContext.XML_CHAR_REFERENCE) || (type == XMLRegionContext.XML_ENTITY_REFERENCE)
- || (type == XMLRegionContext.XML_PI_OPEN) || (type == XMLRegionContext.XML_TAG_OPEN) || (type == XMLRegionContext.XML_END_TAG_OPEN) || (type == XMLRegionContext.XML_COMMENT_OPEN) || (type == XMLRegionContext.XML_CDATA_OPEN)
- || (type == XMLRegionContext.XML_DECLARATION_OPEN) || (type == XMLJSPRegionContexts.JSP_COMMENT_OPEN) || (type == XMLJSPRegionContexts.JSP_DECLARATION_OPEN) || (type == XMLJSPRegionContexts.JSP_DIRECTIVE_OPEN)
- || (type == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN) || (type == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN) || (type == XMLJSPRegionContexts.JSP_CLOSE) || type == XMLJSPRegionContexts.JSP_EL_OPEN) {
- if (currentNode != null) {
- // ensure that any existing node is at least terminated
- if (!currentNode.isEnded()) {
- currentNode.setLength(region.getStart() - currentNode.getStart());
- // fCurrentNode.setTextLength(region.getStart() -
- // fCurrentNode.getStart());
- }
- lastNode = currentNode;
- }
- fireNodeParsed(currentNode);
- currentNode = createStructuredDocumentRegion(type);
- if (lastNode != null) {
- lastNode.setNext(currentNode);
- }
- currentNode.setPrevious(lastNode);
- currentNode.setStart(region.getStart());
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
- // DW, 4/16/2003 token regions no longer have parents
- //region.setParent(currentNode);
- if (region instanceof ITextRegionContainer) {
- ((ITextRegionContainer) region).setParent(currentNode);
- }
-
- }
- // the following contexts NEITHER open nor close
- // StructuredDocumentRegions; just add to them
- else if ((type == XMLRegionContext.XML_TAG_NAME) || (type == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME) || (type == XMLRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (type == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE)
- || (type == XMLRegionContext.XML_COMMENT_TEXT) || (type == XMLRegionContext.XML_PI_CONTENT) || (type == XMLRegionContext.XML_DOCTYPE_INTERNAL_SUBSET) || (type == XMLJSPRegionContexts.JSP_COMMENT_TEXT)
- || (type == XMLJSPRegionContexts.JSP_ROOT_TAG_NAME) || (type == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME) || type == XMLJSPRegionContexts.JSP_EL_CONTENT) {
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
- // DW, 4/16/2003 token regions no longer have parents
- //region.setParent(currentNode);
- if (region instanceof ITextRegionContainer) {
- ((ITextRegionContainer) region).setParent(currentNode);
- }
- }
- // the following contexts close off StructuredDocumentRegions
- // cleanly
- else if ((type == XMLRegionContext.XML_PI_CLOSE) || (type == XMLRegionContext.XML_TAG_CLOSE) || (type == XMLRegionContext.XML_EMPTY_TAG_CLOSE) || (type == XMLRegionContext.XML_COMMENT_CLOSE) || (type == XMLRegionContext.XML_CDATA_CLOSE)
- || (type == XMLJSPRegionContexts.JSP_CLOSE) || (type == XMLJSPRegionContexts.JSP_COMMENT_CLOSE) || (type == XMLJSPRegionContexts.JSP_DIRECTIVE_CLOSE) || (type == XMLRegionContext.XML_DECLARATION_CLOSE)
- || type == XMLJSPRegionContexts.JSP_EL_CLOSE) {
- currentNode.setEnded(true);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- currentNode.addRegion(region);
- region.adjustStart(-currentNode.getStart());
- // DW, 4/16/2003 token regions no longer have parents
- //region.setParent(currentNode);
- if (region instanceof ITextRegionContainer) {
- ((ITextRegionContainer) region).setParent(currentNode);
- }
- }
- // this is extremely rare, but valid
- else if (type == XMLRegionContext.WHITE_SPACE) {
- ITextRegion lastRegion = currentNode.getLastRegion();
- // pack the embedded container with this region
- if (lastRegion instanceof ITextRegionContainer) {
- ITextRegionContainer container = (ITextRegionContainer) lastRegion;
- container.getRegions().add(region);
- // DW, 4/16/2003 container regions have parent. Probably a
- // better place to set,
- // but for now, will (re)set each time through
- container.setParent(currentNode);
- // DW, 4/16/2003 token regions no longer have parents
- //region.setParent(container);
- region.adjustStart(container.getLength() - region.getStart());
- }
- currentNode.getLastRegion().adjustLengthWith(region.getLength());
- currentNode.adjustLengthWith(region.getLength());
- }
- else if (type == XMLRegionContext.UNDEFINED && currentNode != null) {
- // skip on a very-first region situation as the default
- // behavior is good enough
- // combine with previous if also undefined
- if (currentNode.getLastRegion() != null && currentNode.getLastRegion().getType() == XMLRegionContext.UNDEFINED) {
- currentNode.getLastRegion().adjustLengthWith(region.getLength());
- currentNode.adjustLengthWith(region.getLength());
- }
- // previous wasn't undefined
- else {
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
- }
- if (region instanceof ITextRegionContainer) {
- ((ITextRegionContainer) region).setParent(currentNode);
- }
- }
- else {
- // if an unknown type is the first region in the document,
- // ensure that a node exists
- if (currentNode == null) {
- currentNode = createStructuredDocumentRegion(type);
- currentNode.setStart(region.getStart());
- }
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
- // DW, 4/16/2003 token regions no longer have parents
- //region.setParent(currentNode);
- if (region instanceof ITextRegionContainer) {
- ((ITextRegionContainer) region).setParent(currentNode);
- }
-
- if (Debug.debugTokenizer)
- System.out.println(getClass().getName() + " found region of not specifically handled type " + region.getType() + " @ " + region.getStart() + "[" + region.getLength() + "]");//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-
- }
-
- // these regions also get their own node, so close them cleanly
- // NOTE: these regions have new StructuredDocumentRegions created
- // for them above; it may
- // be more readable if that is handled here as well, but the
- // current layout
- // ensures that they open StructuredDocumentRegions the same way
- if ((type == XMLRegionContext.XML_CONTENT) || (type == XMLRegionContext.XML_CHAR_REFERENCE) || (type == XMLRegionContext.XML_ENTITY_REFERENCE) || (type == XMLJSPRegionContexts.JSP_DECLARATION_OPEN)
- || (type == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN) || (type == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN) || (type == XMLJSPRegionContexts.JSP_CONTENT) || (type == XMLJSPRegionContexts.JSP_CLOSE)) {
- currentNode.setEnded(true);
- }
- if (headNode == null && currentNode != null) {
- headNode = currentNode;
- }
- }
- if (currentNode != null) {
- fireNodeParsed(currentNode);
- currentNode.setPrevious(lastNode);
- }
- primReset();
- return headNode;
- }
-
- public void removeNestablePrefix(String tagName) {
- ((JSPTokenizer) getTokenizer()).removeNestablePrefix(tagName);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPParserRegionFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPParserRegionFactory.java
deleted file mode 100644
index 14c27911e2..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPParserRegionFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.parser.internal;
-
-import org.eclipse.jst.jsp.core.internal.parser.JSPCodeRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.parser.regions.XMLParserRegionFactory;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-
-/**
- *
- * This region factory is very specific to the parser output,
- * and the specific implementation classes for various regions.
- */
-public class JSPParserRegionFactory extends XMLParserRegionFactory {
- public JSPParserRegionFactory() {
- super();
- }
-
- public ITextRegion createToken(String context, int start, int textLength, int length, String lang, String surroundingTag) {
- ITextRegion newRegion = null;
- if (context == XMLJSPRegionContexts.JSP_CONTENT) {
- newRegion = new JSPCodeRegion(context, start, textLength, length);
- }
- else
- newRegion = super.createToken(context, start, textLength, length, lang, surroundingTag);
- return newRegion;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPStructuredRegionFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPStructuredRegionFactory.java
deleted file mode 100644
index 8e0770ef13..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPStructuredRegionFactory.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.parser.internal;
-
-import org.eclipse.jst.jsp.core.internal.parser.JSPDirectiveStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.parser.XMLStructuredRegionFactory;
-
-/**
- * A simple class to generate instances of StructuredRegions.
- */
-public class JSPStructuredRegionFactory extends XMLStructuredRegionFactory {
-
- public static IStructuredDocumentRegion createRegion(int type) {
- IStructuredDocumentRegion instance = null;
- switch (type) {
- case JSP_DIRECTIVE :
- instance = new JSPDirectiveStructuredDocumentRegion();
- break;
- default :
- instance = XMLStructuredRegionFactory.createRegion(type);
- }
- return instance;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
deleted file mode 100644
index bed904d50b..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
+++ /dev/null
@@ -1,3599 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 1/27/05 4:49 PM */
-
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.jst.jsp.core.internal.parser.internal;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.wst.sse.core.parser.BlockMarker;
-import org.eclipse.wst.sse.core.parser.BlockTokenizer;
-import org.eclipse.wst.sse.core.parser.TagMarker;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-import org.eclipse.wst.sse.core.util.Debug;
-import org.eclipse.wst.sse.core.util.StringUtils;
-import org.eclipse.wst.xml.core.internal.parser.ContextRegionContainer;
-import org.eclipse.wst.xml.core.internal.parser.IntStack;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 1/27/05 4:49 PM from the specification file
- * <tt>file:/D:/eclipse.wtp/workspace/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex</tt>
- */
-public class JSPTokenizer implements BlockTokenizer, XMLJSPRegionContexts {
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
- final public static int ST_JSP_VBL_DQUOTES = 52;
- final public static int ST_JSP_VBL_SQUOTES = 51;
- final public static int ST_JSP_VBL_SQUOTES_END = 53;
- final public static int ST_XML_COMMENT_END = 4;
- final public static int ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE = 21;
- final public static int ST_JSP_EL_SQUOTES_END = 46;
- final public static int ST_JSP_EL_DQUOTES = 45;
- final public static int ST_JSP_EL = 43;
- final public static int ST_BLOCK_TAG_SCAN = 36;
- final public static int ST_JSP_EL_SQUOTES = 44;
- final public static int ST_DHTML_ATTRIBUTE_VALUE = 14;
- final public static int ST_XML_PI_ATTRIBUTE_NAME = 8;
- final public static int ST_DHTML_TAG_CLOSE = 15;
- final public static int ST_XML_ATTRIBUTE_VALUE_DQUOTED = 41;
- final public static int ST_DHTML_EQUALS = 13;
- final public static int ST_XML_PI_ATTRIBUTE_VALUE = 10;
- final public static int ST_XML_ATTRIBUTE_VALUE = 25;
- final public static int ST_JSP_VBL = 50;
- final public static int ST_JSP_SQUOTED_VBL = 56;
- final public static int ST_XML_ATTRIBUTE_VALUE_SQUOTED = 40;
- final public static int ST_XML_ATTRIBUTE_NAME = 23;
- final public static int ST_XML_EQUALS = 24;
- final public static int YYINITIAL = 0;
- final public static int ST_JSP_DIRECTIVE_ATTRIBUTE_NAME = 19;
- final public static int ST_JSP_CONTENT = 16;
- final public static int ST_XML_DOCTYPE_ID_SYSTEM = 31;
- final public static int ST_XML_ELEMENT_DECLARATION = 32;
- final public static int ST_XML_DECLARATION_CLOSE = 27;
- final public static int ST_JSP_DIRECTIVE_EQUALS = 20;
- final public static int ST_JSP_VBL_DQUOTES_END = 54;
- final public static int ST_JSP_DQUOTED_EL = 48;
- final public static int ST_XML_DOCTYPE_DECLARATION = 28;
- final public static int ST_CDATA_END = 2;
- final public static int ST_PI_WS = 6;
- final public static int ST_CDATA_TEXT = 1;
- final public static int ST_JSP_DIRECTIVE_NAME_WHITESPACE = 18;
- final public static int ST_XML_ELEMENT_DECLARATION_CONTENT = 33;
- final public static int ST_XML_ATTLIST_DECLARATION = 34;
- final public static int ST_JSP_EL_DQUOTES_END = 47;
- final public static int ST_JSP_SQUOTED_EL = 49;
- final public static int ST_JSP_COMMENT_END = 39;
- final public static int ST_XML_PI_EQUALS = 9;
- final public static int ST_XML_ATTLIST_DECLARATION_CONTENT = 35;
- final public static int ST_XML_DOCTYPE_ID_PUBLIC = 30;
- final public static int ST_JSP_DQUOTED_VBL = 55;
- final public static int ST_DHTML_ATTRIBUTE_NAME = 12;
- final public static int ST_ABORT_EMBEDDED = 42;
- final public static int ST_XML_DOCTYPE_EXTERNAL_ID = 29;
- final public static int ST_JSP_COMMENT = 38;
- final public static int ST_PI_CONTENT = 7;
- final public static int ST_BLOCK_TAG_INTERNAL_SCAN = 37;
- final public static int ST_PI = 5;
- final public static int ST_XML_DECLARATION = 26;
- final public static int ST_JSP_DIRECTIVE_NAME = 17;
- final public static int ST_XML_TAG_NAME = 22;
- final public static int ST_XML_PI_TAG_CLOSE = 11;
- final public static int ST_XML_COMMENT = 3;
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed =
- "\11\0\1\5\1\26\2\0\1\17\22\0\1\17\1\25\1\12\1\63"+
- "\1\15\1\22\1\13\1\14\1\24\1\24\1\24\1\24\1\24\1\7"+
- "\1\6\1\3\12\20\1\11\1\70\1\1\1\50\1\2\1\4\1\21"+
- "\1\37\1\71\1\35\1\36\1\54\1\66\1\60\1\60\1\61\1\60"+
- "\1\60\1\32\1\31\1\62\1\51\1\53\1\60\1\65\1\64\1\40"+
- "\1\67\2\60\1\27\1\52\1\60\1\34\1\102\1\23\1\0\1\10"+
- "\1\0\1\56\1\101\1\72\1\57\1\42\1\66\1\73\1\60\1\45"+
- "\1\76\1\60\1\33\1\31\1\47\1\46\1\77\1\60\1\43\1\44"+
- "\1\55\1\100\1\41\1\60\1\30\1\52\1\60\1\16\1\0\1\103"+
- "\71\0\1\75\10\0\27\74\1\0\37\74\1\0\72\74\2\0\13\74"+
- "\2\0\10\74\1\0\65\74\1\0\104\74\11\0\44\74\3\0\2\74"+
- "\4\0\36\74\70\0\131\74\22\0\7\74\16\0\2\75\56\0\106\75"+
- "\32\0\2\75\44\0\1\74\1\75\3\74\1\0\1\74\1\0\24\74"+
- "\1\0\54\74\1\0\7\74\3\0\1\74\1\0\1\74\1\0\1\74"+
- "\1\0\1\74\1\0\22\74\15\0\14\74\1\0\102\74\1\0\14\74"+
- "\1\0\44\74\1\0\4\75\11\0\65\74\2\0\2\74\2\0\2\74"+
- "\3\0\34\74\2\0\10\74\2\0\2\74\67\0\46\74\2\0\1\74"+
- "\7\0\46\74\12\0\21\75\1\0\27\75\1\0\3\75\1\0\1\75"+
- "\1\0\2\75\1\0\1\75\13\0\33\74\5\0\3\74\56\0\32\74"+
- "\5\0\1\75\12\74\10\75\15\0\12\75\6\0\1\75\107\74\2\0"+
- "\5\74\1\0\17\74\1\0\4\74\1\0\1\74\17\75\2\74\2\75"+
- "\1\0\4\75\2\0\12\75\u0207\0\3\75\1\0\65\74\2\0\1\75"+
- "\1\74\20\75\3\0\4\75\3\0\12\74\2\75\2\0\12\75\21\0"+
- "\3\75\1\0\10\74\2\0\2\74\2\0\26\74\1\0\7\74\1\0"+
- "\1\74\3\0\4\74\2\0\1\75\1\0\7\75\2\0\2\75\2\0"+
- "\3\75\11\0\1\75\4\0\2\74\1\0\3\74\2\75\2\0\12\75"+
- "\2\74\20\0\1\75\2\0\6\74\4\0\2\74\2\0\26\74\1\0"+
- "\7\74\1\0\2\74\1\0\2\74\1\0\2\74\2\0\1\75\1\0"+
- "\5\75\4\0\2\75\2\0\3\75\13\0\4\74\1\0\1\74\7\0"+
- "\12\75\2\75\3\74\14\0\3\75\1\0\7\74\1\0\1\74\1\0"+
- "\3\74\1\0\26\74\1\0\7\74\1\0\2\74\1\0\5\74\2\0"+
- "\1\75\1\74\10\75\1\0\3\75\1\0\3\75\22\0\1\74\5\0"+
- "\12\75\21\0\3\75\1\0\10\74\2\0\2\74\2\0\26\74\1\0"+
- "\7\74\1\0\2\74\2\0\4\74\2\0\1\75\1\74\6\75\3\0"+
- "\2\75\2\0\3\75\10\0\2\75\4\0\2\74\1\0\3\74\4\0"+
- "\12\75\22\0\2\75\1\0\6\74\3\0\3\74\1\0\4\74\3\0"+
- "\2\74\1\0\1\74\1\0\2\74\3\0\2\74\3\0\3\74\3\0"+
- "\10\74\1\0\3\74\4\0\5\75\3\0\3\75\1\0\4\75\11\0"+
- "\1\75\17\0\11\75\21\0\3\75\1\0\10\74\1\0\3\74\1\0"+
- "\27\74\1\0\12\74\1\0\5\74\4\0\7\75\1\0\3\75\1\0"+
- "\4\75\7\0\2\75\11\0\2\74\4\0\12\75\22\0\2\75\1\0"+
- "\10\74\1\0\3\74\1\0\27\74\1\0\12\74\1\0\5\74\4\0"+
- "\7\75\1\0\3\75\1\0\4\75\7\0\2\75\7\0\1\74\1\0"+
- "\2\74\4\0\12\75\22\0\2\75\1\0\10\74\1\0\3\74\1\0"+
- "\27\74\1\0\20\74\4\0\6\75\2\0\3\75\1\0\4\75\11\0"+
- "\1\75\10\0\2\74\4\0\12\75\221\0\56\74\1\0\1\74\1\75"+
- "\2\74\7\75\5\0\6\74\1\75\10\75\1\0\12\75\47\0\2\74"+
- "\1\0\1\74\2\0\2\74\1\0\1\74\2\0\1\74\6\0\4\74"+
- "\1\0\7\74\1\0\3\74\1\0\1\74\1\0\1\74\2\0\2\74"+
- "\1\0\2\74\1\0\1\74\1\75\2\74\6\75\1\0\2\75\1\74"+
- "\2\0\5\74\1\0\1\75\1\0\6\75\2\0\12\75\76\0\2\75"+
- "\6\0\12\75\13\0\1\75\1\0\1\75\1\0\1\75\4\0\2\75"+
- "\10\74\1\0\41\74\7\0\24\75\1\0\6\75\4\0\6\75\1\0"+
- "\1\75\1\0\25\75\3\0\7\75\1\0\1\75\346\0\46\74\12\0"+
- "\47\74\11\0\1\74\1\0\2\74\1\0\3\74\1\0\1\74\1\0"+
- "\2\74\1\0\5\74\51\0\1\74\1\0\1\74\1\0\1\74\13\0"+
- "\1\74\1\0\1\74\1\0\1\74\3\0\2\74\3\0\1\74\5\0"+
- "\3\74\1\0\1\74\1\0\1\74\1\0\1\74\1\0\1\74\3\0"+
- "\2\74\3\0\2\74\1\0\1\74\50\0\1\74\11\0\1\74\2\0"+
- "\1\74\2\0\2\74\7\0\2\74\1\0\1\74\1\0\7\74\50\0"+
- "\1\74\4\0\1\74\10\0\1\74\u0c06\0\234\74\4\0\132\74\6\0"+
- "\26\74\2\0\6\74\2\0\46\74\2\0\6\74\2\0\10\74\1\0"+
- "\1\74\1\0\1\74\1\0\1\74\1\0\37\74\2\0\65\74\1\0"+
- "\7\74\1\0\1\74\3\0\3\74\1\0\7\74\3\0\4\74\2\0"+
- "\6\74\4\0\15\74\5\0\3\74\1\0\7\74\323\0\15\75\4\0"+
- "\1\75\104\0\1\74\3\0\2\74\2\0\1\74\121\0\3\74\u0e82\0"+
- "\1\75\1\0\1\74\31\0\11\74\6\75\1\0\5\75\13\0\124\74"+
- "\4\0\2\75\2\0\2\75\2\0\132\74\1\0\3\75\6\0\50\74"+
- "\u1cd3\0\u51a6\74\u0c5a\0\u2ba4\74\134\0\u0800\0\u1ffe\0\2\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
- /**
- * Translates a state to a row index in the transition table
- */
- final private static int yy_rowMap [] = {
- 0, 68, 136, 204, 272, 340, 408, 476, 544, 612,
- 680, 748, 816, 884, 952, 1020, 1088, 1156, 1224, 1292,
- 1360, 1428, 1496, 1564, 1632, 1700, 1768, 1836, 1904, 1972,
- 2040, 2108, 2176, 2244, 2312, 2380, 2448, 2516, 2584, 2652,
- 2720, 2788, 2856, 2924, 2992, 3060, 3128, 3196, 3264, 3332,
- 3400, 3468, 3536, 3604, 3672, 3740, 3808, 3876, 3944, 4012,
- 4080, 4148, 4216, 4284, 4352, 4284, 4352, 4420, 4284, 4284,
- 4352, 4488, 4556, 4624, 4692, 4760, 4828, 4896, 4284, 4352,
- 4964, 5032, 5100, 4284, 5168, 5168, 5236, 5304, 5372, 4964,
- 4284, 5440, 5508, 4284, 5576, 5644, 5712, 5780, 4284, 4352,
- 5848, 5916, 5984, 6052, 6120, 6188, 4284, 6256, 6256, 6324,
- 6392, 6460, 6528, 6596, 4284, 6664, 6732, 6800, 6868, 6936,
- 7004, 4284, 7072, 7140, 7208, 7276, 7344, 7412, 7480, 7548,
- 4284, 7616, 7684, 7752, 7820, 7888, 7956, 8024, 8092, 8092,
- 8160, 8228, 8296, 8364, 8364, 8432, 8500, 8568, 8636, 8636,
- 8704, 8772, 8840, 8908, 4284, 8976, 8976, 9044, 9112, 9180,
- 9248, 4284, 4284, 4352, 9316, 4284, 4352, 9384, 9452, 9520,
- 9588, 4284, 9656, 9724, 9792, 9860, 4284, 9928, 9996, 10064,
- 10132, 4284, 4284, 10200, 4284, 10268, 10336, 10268, 10404, 10472,
- 10404, 4284, 4284, 10540, 10608, 10676, 4284, 10744, 10812, 10880,
- 10948, 11016, 4284, 4284, 11084, 4284, 11152, 11220, 11152, 11288,
- 11356, 11288, 4284, 4284, 11424, 11492, 11560, 4284, 11628, 11696,
- 11764, 4284, 4284, 11832, 11900, 11968, 12036, 12104, 4284, 12172,
- 12240, 12308, 12376, 12444, 12512, 12580, 12648, 12716, 4284, 12784,
- 12852, 4284, 4284, 5168, 5304, 4284, 12920, 5372, 12988, 5440,
- 5576, 5644, 13056, 5712, 4284, 13124, 13192, 5780, 13260, 4284,
- 11900, 4284, 6256, 6324, 4284, 13328, 6392, 13396, 4284, 13464,
- 13532, 7072, 13600, 7276, 4284, 13668, 7344, 13736, 13804, 13872,
- 13940, 14008, 14076, 7820, 4284, 14144, 14212, 8092, 8160, 4284,
- 14280, 14348, 14416, 14484, 14552, 8296, 8092, 8364, 8432, 4284,
- 8500, 8568, 8364, 8636, 8704, 4284, 14620, 14688, 14756, 14824,
- 14892, 14960, 15028, 8976, 9044, 4284, 15096, 15164, 15232, 15300,
- 15368, 15436, 15504, 15572, 15640, 15708, 4284, 4284, 4284, 15776,
- 4284, 4284, 15844, 15912, 15980, 16048, 10268, 4284, 16116, 16184,
- 10404, 4284, 16252, 16320, 16388, 16456, 16524, 16592, 16660, 16728,
- 16796, 10948, 11152, 4284, 16864, 16932, 11288, 4284, 17000, 17068,
- 17136, 17204, 17272, 17340, 17408, 17476, 17544, 4284, 4284, 4284,
- 17612, 17680, 17748, 17816, 17884, 4284, 17952, 18020, 4284, 4284,
- 4284, 4284, 4284, 4692, 18088, 18156, 18224, 18292, 18360, 18428,
- 18360, 18496, 18564, 18496, 18632, 18700, 18768, 18836, 18904, 18972,
- 19040, 19040, 19108, 19176, 19176, 8840, 8840, 19244, 19312, 19380,
- 19380, 9180, 9180, 19448, 19516, 19584, 15980, 10064, 10064, 19652,
- 10268, 10268, 19720, 10404, 10404, 19788, 10540, 10540, 16524, 19856,
- 10744, 10744, 16728, 19924, 10948, 10948, 11152, 11152, 19992, 11288,
- 11288, 20060, 11424, 11424, 17272, 20128, 11628, 11628, 17476, 20196,
- 4284, 4284, 20264, 20332, 4284, 20400, 20468, 20536, 7072, 4284,
- 4284, 20604, 20672, 20740, 20808, 20876, 14484, 14824, 20944, 15300,
- 21012, 4284, 4284, 21080, 21148, 21216, 4284, 21284, 21352, 21420,
- 21488, 4284, 21556, 21624, 21692, 21760, 21828, 21896, 21964, 22032,
- 22100, 22168, 22236, 22304, 22372, 22440, 22508, 22576, 22644, 22712,
- 22780, 22848, 22916, 4692, 22984, 23052, 23120, 23188, 23256, 4284,
- 4284, 23324, 23392, 23460, 23528, 16524, 16728, 23596, 23664, 17272,
- 17476, 23732, 23800, 23868, 4284, 4284, 4284, 23936, 24004, 24072,
- 24140, 24208, 24276, 24344, 6800, 24412, 24480, 24548, 24616, 24684,
- 24752, 24820, 4284, 24888, 8840, 9180, 10268, 10404, 11152, 11288,
- 24956, 25024, 25092, 25160, 25228, 25296, 25364, 25432, 25500, 25568,
- 25636, 25704, 25772, 25840, 25908, 25976, 26044, 26112, 26180, 26248,
- 26316, 26384, 26452, 26520, 26588, 26656, 26724, 26792, 26860, 26928,
- 26996, 27064, 27132, 27200, 27268, 27336, 27404, 27472, 27540, 27608,
- 4284, 27676, 27744, 27812, 27880, 6800, 27948, 28016, 28084, 28152,
- 28220, 28288, 28356, 28424, 28492, 28560, 28628, 28696, 28764, 28832
- };
-
- /**
- * The packed transition table of the DFA
- */
- final private static String yy_packed =
- "\1\72\1\73\11\72\1\74\1\72\1\75\4\72\1\76"+
- "\40\72\1\77\20\72\1\100\1\101\102\100\1\102\1\103"+
- "\21\102\1\104\2\102\1\105\55\102\1\106\1\107\102\106"+
- "\1\102\1\103\5\102\1\110\16\102\1\105\56\102\1\103"+
- "\2\102\1\111\1\112\2\102\2\113\5\102\1\112\6\102"+
- "\1\112\2\114\3\113\1\102\10\113\1\115\2\113\1\102"+
- "\10\113\1\115\1\113\1\102\4\113\1\102\4\113\1\102"+
- "\4\113\3\102\1\103\2\102\1\111\1\116\11\102\1\116"+
- "\6\102\1\116\55\102\1\117\1\120\2\117\1\121\21\117"+
- "\1\105\55\117\1\102\1\103\2\102\1\122\1\112\2\102"+
- "\2\123\5\102\1\112\6\102\1\112\5\123\1\102\13\123"+
- "\1\102\12\123\1\102\4\123\1\102\4\123\1\102\4\123"+
- "\3\102\1\103\2\102\1\122\1\112\2\102\2\123\5\102"+
- "\1\112\6\102\1\112\5\123\1\102\13\123\1\124\12\123"+
- "\1\102\4\123\1\102\4\123\1\102\4\123\2\102\1\125"+
- "\1\103\1\102\1\126\1\127\1\112\4\125\1\130\1\125"+
- "\1\131\2\125\1\112\6\125\1\112\55\125\1\102\1\103"+
- "\2\102\1\132\21\102\1\105\56\102\1\103\1\133\1\134"+
- "\1\102\1\112\2\102\2\135\5\102\1\112\6\102\1\112"+
- "\5\135\1\102\13\135\1\102\12\135\1\102\4\135\1\102"+
- "\4\135\1\102\4\135\3\102\1\103\1\133\1\134\1\102"+
- "\1\112\2\102\2\135\5\102\1\112\6\102\1\112\5\135"+
- "\1\102\13\135\1\136\12\135\1\102\4\135\1\102\4\135"+
- "\1\102\4\135\2\102\1\137\1\103\1\133\1\140\1\137"+
- "\1\112\4\137\1\141\1\137\1\142\2\137\1\112\6\137"+
- "\1\112\55\137\1\102\1\103\3\102\1\112\11\102\1\112"+
- "\6\102\1\112\55\102\1\143\1\144\20\143\1\145\3\143"+
- "\1\105\55\143\1\102\1\146\3\102\1\112\2\102\2\147"+
- "\5\102\1\112\2\102\1\150\3\102\1\112\5\147\1\102"+
- "\13\147\1\102\12\147\1\102\4\147\1\102\4\147\1\102"+
- "\4\147\3\102\1\146\3\102\1\151\11\102\1\151\2\102"+
- "\1\150\3\102\1\151\56\102\1\146\3\102\1\112\2\102"+
- "\2\152\5\102\1\112\2\102\1\150\3\102\1\112\5\152"+
- "\1\102\13\152\1\102\12\152\1\102\4\152\1\102\4\152"+
- "\1\102\4\152\3\102\1\146\3\102\1\112\2\102\2\152"+
- "\5\102\1\112\2\102\1\150\3\102\1\112\5\152\1\102"+
- "\13\152\1\153\12\152\1\102\4\152\1\102\4\152\1\102"+
- "\4\152\2\102\1\154\1\146\1\102\1\155\1\154\1\112"+
- "\4\154\1\156\1\154\1\157\2\154\1\112\2\154\1\160"+
- "\3\154\1\112\55\154\1\161\1\162\1\163\1\164\4\161"+
- "\2\165\15\161\5\166\1\161\13\166\1\161\12\166\1\161"+
- "\4\166\1\161\4\166\1\161\1\167\3\166\2\161\1\102"+
- "\1\170\1\163\1\164\1\102\1\112\2\102\2\171\5\102"+
- "\1\112\6\102\1\112\5\171\1\102\13\171\1\102\12\171"+
- "\1\102\4\171\1\102\4\171\1\102\4\171\3\102\1\170"+
- "\1\163\1\164\1\102\1\112\2\102\2\171\5\102\1\112"+
- "\6\102\1\112\5\171\1\102\13\171\1\172\12\171\1\102"+
- "\4\171\1\102\4\171\1\102\4\171\2\102\1\173\1\174"+
- "\1\163\1\175\1\173\1\112\4\173\1\176\1\173\1\177"+
- "\1\200\1\173\1\112\6\173\1\112\34\173\1\201\20\173"+
- "\1\102\1\202\1\203\2\102\1\112\11\102\1\112\6\102"+
- "\1\112\7\102\1\204\1\205\2\102\1\206\11\102\1\206"+
- "\1\102\1\205\1\204\25\102\1\103\1\203\2\102\1\112"+
- "\11\102\1\112\6\102\1\112\5\102\1\207\50\102\1\103"+
- "\1\203\2\102\1\112\2\102\2\210\5\102\1\112\6\102"+
- "\1\112\5\210\1\207\13\210\1\102\12\210\1\102\4\210"+
- "\1\102\4\210\1\102\4\210\3\102\1\103\1\203\2\102"+
- "\1\112\11\102\1\112\6\102\1\112\5\102\1\207\7\102"+
- "\1\211\6\102\1\212\10\102\1\211\12\102\1\212\4\102"+
- "\1\213\1\103\1\203\1\214\1\213\1\112\4\213\1\215"+
- "\1\213\1\216\2\213\1\112\6\213\1\112\5\213\1\217"+
- "\47\213\1\220\1\103\1\203\1\221\1\220\1\112\4\220"+
- "\1\222\1\220\1\223\2\220\1\112\6\220\1\112\5\220"+
- "\1\224\47\220\1\225\1\103\1\203\1\226\1\225\1\112"+
- "\4\225\1\227\1\225\1\230\2\225\1\112\6\225\1\112"+
- "\55\225\1\231\1\232\1\233\101\231\1\234\1\103\1\203"+
- "\1\235\1\234\1\112\4\234\1\236\1\234\1\237\2\234"+
- "\1\112\6\234\1\112\55\234\1\240\1\241\1\242\101\240"+
- "\1\243\1\244\102\243\1\102\1\245\24\102\1\105\55\102"+
- "\1\246\1\247\102\246\1\102\1\103\5\102\1\250\16\102"+
- "\1\105\55\102\1\251\1\252\3\251\1\253\6\251\1\254"+
- "\1\255\1\251\1\253\6\251\1\253\34\251\1\256\20\251"+
- "\1\257\1\252\3\257\1\260\4\257\1\261\2\257\1\262"+
- "\1\257\1\260\6\257\1\260\34\257\1\263\20\257\1\102"+
- "\1\103\24\102\1\105\55\102\1\264\1\265\10\264\1\266"+
- "\1\264\1\267\1\270\65\264\1\271\1\272\1\273\12\272"+
- "\1\102\11\272\1\274\55\272\1\275\1\276\10\275\1\102"+
- "\13\275\1\277\55\275\1\102\1\103\12\102\1\300\11\102"+
- "\1\105\56\102\1\103\10\102\1\301\13\102\1\105\55\102"+
- "\1\302\1\303\10\302\1\261\67\302\1\304\1\305\1\306"+
- "\1\307\12\306\1\254\65\306\1\310\1\305\1\311\1\312"+
- "\10\311\1\313\1\311\1\314\46\311\1\315\17\311\1\316"+
- "\1\317\1\320\12\317\1\102\11\317\1\321\55\317\1\322"+
- "\1\323\10\322\1\102\13\322\1\324\55\322\1\102\1\103"+
- "\12\102\1\325\11\102\1\105\56\102\1\103\10\102\1\326"+
- "\13\102\1\105\55\102\1\327\1\330\10\327\1\261\67\327"+
- "\1\331\1\332\1\333\1\334\12\333\1\254\65\333\1\335"+
- "\1\332\1\72\1\0\11\72\1\0\1\72\1\0\4\72"+
- "\1\0\40\72\1\0\20\72\3\0\1\336\1\337\15\0"+
- "\1\340\2\0\1\341\63\0\1\342\2\0\2\343\5\0"+
- "\1\342\6\0\1\342\5\343\1\0\13\343\1\0\12\343"+
- "\1\344\4\343\1\0\4\343\1\0\4\343\2\0\1\345"+
- "\1\0\11\345\1\0\1\345\1\346\1\347\3\345\1\0"+
- "\61\345\5\0\1\342\2\0\2\350\5\0\1\342\6\0"+
- "\1\342\5\350\1\0\13\350\1\0\12\350\1\0\4\350"+
- "\1\0\4\350\1\0\4\350\2\0\1\345\1\0\11\345"+
- "\1\0\2\345\1\351\3\345\1\0\40\345\1\352\20\345"+
- "\126\0\1\353\2\0\1\354\101\0\1\355\67\0\1\356"+
- "\76\0\1\357\106\0\1\112\11\0\1\112\6\0\1\112"+
- "\63\0\4\113\6\0\1\113\6\0\5\113\1\0\13\113"+
- "\1\0\12\113\1\0\4\113\1\0\11\113\10\0\4\113"+
- "\6\0\1\113\6\0\2\113\1\360\2\113\1\0\13\113"+
- "\1\0\12\113\1\0\4\113\1\0\11\113\10\0\4\113"+
- "\6\0\1\113\6\0\2\113\1\361\2\113\1\0\13\113"+
- "\1\0\12\113\1\0\4\113\1\0\11\113\7\0\1\116"+
- "\11\0\1\116\6\0\1\116\57\0\1\362\103\0\1\363"+
- "\107\0\4\123\6\0\1\123\6\0\5\123\1\0\13\123"+
- "\1\0\12\123\1\0\4\123\1\0\11\123\2\0\1\125"+
- "\2\0\1\364\1\125\1\0\4\125\1\0\1\125\1\0"+
- "\2\125\1\0\6\125\1\0\56\125\1\0\1\363\1\364"+
- "\1\125\1\0\4\125\1\0\1\125\1\0\2\125\1\0"+
- "\6\125\1\0\55\125\1\365\1\0\10\365\1\366\2\365"+
- "\1\367\45\365\1\367\20\365\1\370\1\0\12\370\1\366"+
- "\1\371\45\370\1\371\20\370\2\0\1\133\1\372\106\0"+
- "\4\135\6\0\1\135\6\0\5\135\1\0\13\135\1\0"+
- "\12\135\1\0\4\135\1\0\11\135\2\0\1\137\2\0"+
- "\1\373\1\137\1\0\4\137\1\0\1\137\1\0\2\137"+
- "\1\0\6\137\1\0\56\137\1\0\1\133\1\374\1\137"+
- "\1\0\4\137\1\0\1\137\1\0\2\137\1\0\6\137"+
- "\1\0\55\137\1\141\1\0\1\375\1\376\1\141\1\375"+
- "\4\141\1\377\1\141\1\375\1\u0100\1\141\1\375\6\141"+
- "\1\375\34\141\1\u0100\20\141\1\142\1\0\1\u0101\1\u0102"+
- "\1\142\1\u0101\4\142\1\u0101\1\142\1\377\1\u0103\1\142"+
- "\1\u0101\6\142\1\u0101\34\142\1\u0103\20\142\2\0\1\u0104"+
- "\123\0\1\353\2\0\1\u0105\64\0\4\147\6\0\1\147"+
- "\6\0\5\147\1\0\13\147\1\0\12\147\1\0\4\147"+
- "\1\0\11\147\4\0\1\u0106\106\0\1\151\11\0\1\151"+
- "\6\0\1\151\63\0\4\152\6\0\1\152\6\0\5\152"+
- "\1\0\13\152\1\0\12\152\1\0\4\152\1\0\11\152"+
- "\2\0\1\154\2\0\1\u0107\1\154\1\0\4\154\1\0"+
- "\1\154\1\0\2\154\1\0\6\154\1\0\55\154\1\u0108"+
- "\1\0\10\u0108\1\u0109\2\u0108\1\u010a\45\u0108\1\u010a\20\u0108"+
- "\1\u010b\1\0\12\u010b\1\u0109\1\u010c\45\u010b\1\u010c\20\u010b"+
- "\1\154\1\0\1\u0106\1\u0107\1\154\1\0\4\154\1\0"+
- "\1\154\1\0\2\154\1\0\6\154\1\0\55\154\1\161"+
- "\3\0\23\161\5\0\1\161\13\0\1\161\12\0\1\161"+
- "\4\0\1\161\4\0\1\161\4\0\2\161\3\0\1\336"+
- "\16\0\1\353\2\0\1\341\60\0\1\u010d\101\0\1\161"+
- "\3\0\2\161\4\165\6\161\1\165\6\161\5\166\1\161"+
- "\13\166\1\161\12\166\1\161\4\166\1\161\4\166\1\165"+
- "\4\166\2\161\6\0\4\166\6\0\1\166\6\0\5\166"+
- "\1\0\13\166\1\0\12\166\1\0\4\166\1\0\11\166"+
- "\10\0\4\166\6\0\1\166\6\0\5\166\1\0\7\166"+
- "\1\u010e\3\166\1\0\12\166\1\0\4\166\1\0\11\166"+
- "\5\0\1\336\4\0\2\u010f\10\0\1\353\2\0\1\341"+
- "\1\0\5\u010f\1\0\13\u010f\1\0\12\u010f\1\0\4\u010f"+
- "\1\0\4\u010f\1\0\4\u010f\10\0\4\171\6\0\1\171"+
- "\6\0\5\171\1\0\13\171\1\0\12\171\1\0\4\171"+
- "\1\0\11\171\2\0\1\173\2\0\1\u0110\1\173\1\0"+
- "\4\173\1\0\1\173\1\0\2\173\1\0\6\173\1\0"+
- "\55\173\3\0\1\336\4\0\2\u0111\10\0\1\353\2\0"+
- "\1\341\1\0\5\u0111\1\0\13\u0111\1\0\12\u0111\1\0"+
- "\4\u0111\1\0\4\u0111\1\0\4\u0111\2\0\1\173\1\0"+
- "\1\u010d\1\u0110\1\173\1\0\4\173\1\0\1\173\1\0"+
- "\2\173\1\0\6\173\1\0\55\173\1\u0112\1\0\10\u0112"+
- "\1\u0113\2\u0112\1\u0114\45\u0112\1\u0114\20\u0112\1\u0115\1\0"+
- "\12\u0115\1\u0113\1\u0116\45\u0115\1\u0116\20\u0115\1\173\2\0"+
- "\1\u0110\1\173\1\0\4\173\1\0\1\173\1\0\1\173"+
- "\1\u0117\1\0\6\173\1\0\56\173\2\0\1\u0110\1\173"+
- "\1\0\4\173\1\0\1\173\1\0\1\173\1\u0118\1\0"+
- "\6\173\1\0\55\173\3\0\1\336\16\0\1\353\2\0"+
- "\1\u0105\124\0\1\u0119\2\0\1\u0119\72\0\1\u011a\14\0"+
- "\1\u011a\60\0\2\u011b\50\0\23\u011c\1\u011d\60\u011c\6\0"+
- "\4\210\6\0\1\210\6\0\5\210\1\0\13\210\1\0"+
- "\12\210\1\0\4\210\1\0\11\210\54\0\1\u011e\120\0"+
- "\1\u011f\10\0\1\u011f\3\0\1\213\2\0\1\u0120\1\213"+
- "\1\0\4\213\1\0\1\213\1\0\2\213\1\0\6\213"+
- "\1\0\55\213\1\u0121\1\0\10\u0121\1\u0122\2\u0121\1\u0123"+
- "\45\u0121\1\u0123\20\u0121\1\u0124\1\0\1\u0124\2\u0125\1\u0124"+
- "\4\u0125\2\u0124\1\u0126\1\u0127\1\u0124\4\u0125\1\u0124\10\u0125"+
- "\1\u0124\26\u0125\1\u0127\10\u0125\2\u0124\4\u0125\2\u0124\1\217"+
- "\2\u011c\1\u0128\1\217\1\u011c\4\217\1\u011c\1\217\1\u011c"+
- "\2\217\1\u011c\3\217\1\u0129\2\217\1\u011c\55\217\1\220"+
- "\2\0\1\u012a\1\220\1\0\4\220\1\0\1\220\1\0"+
- "\2\220\1\0\6\220\1\0\55\220\12\u012b\1\u012c\71\u012b"+
- "\14\u012d\1\u012c\67\u012d\1\224\2\u011c\1\u012e\1\224\1\u011c"+
- "\4\224\1\u011c\1\224\1\u011c\2\224\1\u011c\3\224\1\u012f"+
- "\2\224\1\u011c\55\224\1\225\2\0\1\u0130\1\225\1\0"+
- "\4\225\1\0\1\225\1\0\2\225\1\0\6\225\1\0"+
- "\55\225\1\u0131\1\0\10\u0131\1\u0132\2\u0131\1\u0133\45\u0131"+
- "\1\u0133\20\u0131\1\u0134\1\0\1\u0134\2\u0135\1\u0134\4\u0135"+
- "\2\u0134\1\u0136\1\u0137\1\u0134\4\u0135\1\u0134\10\u0135\1\u0134"+
- "\26\u0135\1\u0137\10\u0135\2\u0134\4\u0135\2\u0134\2\231\1\0"+
- "\103\231\1\0\17\231\1\u0138\2\231\1\u0139\56\231\1\234"+
- "\2\0\1\u013a\1\234\1\0\4\234\1\0\1\234\1\0"+
- "\2\234\1\0\6\234\1\0\55\234\1\u013b\1\0\10\u013b"+
- "\1\u013c\2\u013b\1\u013d\45\u013b\1\u013d\20\u013b\1\u013e\1\0"+
- "\1\u013e\2\u013f\1\u013e\4\u013f\2\u013e\1\u0140\1\u0141\1\u013e"+
- "\4\u013f\1\u013e\10\u013f\1\u013e\26\u013f\1\u0141\10\u013f\2\u013e"+
- "\4\u013f\2\u013e\2\240\1\0\103\240\1\0\17\240\1\u0142"+
- "\2\240\1\u0143\56\240\22\0\1\u0144\2\0\1\354\65\0"+
- "\1\u0145\74\0\1\251\1\0\12\251\1\0\1\u0146\45\251"+
- "\1\u0146\20\251\3\0\1\u0147\16\0\1\353\2\0\1\354"+
- "\56\0\1\251\1\0\3\251\1\253\6\251\1\0\1\u0146"+
- "\1\251\1\253\6\251\1\253\34\251\1\u0146\36\251\1\u0148"+
- "\103\251\1\u0149\65\251\1\257\1\0\10\257\1\0\2\257"+
- "\1\u014a\45\257\1\u014a\21\257\1\0\3\257\1\260\4\257"+
- "\1\0\2\257\1\u014a\1\257\1\260\6\257\1\260\34\257"+
- "\1\u014a\36\257\1\u014b\103\257\1\u014c\65\257\12\264\1\0"+
- "\1\264\1\0\1\u014d\65\264\1\0\12\264\1\0\1\264"+
- "\1\0\1\u014d\4\264\1\u014e\60\264\1\0\12\264\1\0"+
- "\1\264\1\0\1\264\1\u014f\64\264\1\u0150\14\u0151\1\u0152"+
- "\103\u0151\1\u0152\5\u0151\1\u0153\2\u0151\1\u0154\56\u0151\12\u0155"+
- "\1\u0156\103\u0155\1\u0156\7\u0155\1\u0157\2\u0155\1\u0158\56\u0155"+
- "\12\302\1\0\67\302\1\u0159\1\0\12\302\1\0\7\302"+
- "\1\u015a\57\302\1\u0159\1\0\12\302\1\u015b\71\302\14\306"+
- "\1\0\65\306\1\u015c\1\0\14\306\1\0\5\306\1\u015d"+
- "\57\306\1\u015c\1\0\14\306\1\u015e\67\306\12\311\1\0"+
- "\1\311\1\0\66\311\1\0\12\311\1\0\1\311\1\0"+
- "\5\311\1\u015f\60\311\1\0\12\311\1\0\1\311\1\0"+
- "\1\311\1\u0160\64\311\1\0\14\u0161\1\u0162\103\u0161\1\u0162"+
- "\5\u0161\1\u0163\2\u0161\1\u0164\56\u0161\12\u0165\1\u0166\103\u0165"+
- "\1\u0166\7\u0165\1\u0167\2\u0165\1\u0168\56\u0165\12\327\1\0"+
- "\67\327\1\u0169\1\0\12\327\1\0\7\327\1\u016a\57\327"+
- "\1\u0169\1\0\12\327\1\u016b\71\327\14\333\1\0\65\333"+
- "\1\u016c\1\0\14\333\1\0\5\333\1\u016d\57\333\1\u016c"+
- "\1\0\14\333\1\u016e\67\333\7\0\1\u016f\11\0\1\u0170"+
- "\3\0\1\u0171\22\0\1\u0172\42\0\1\u0173\24\0\1\u0174"+
- "\54\0\1\342\2\0\2\u0175\5\0\1\342\6\0\1\342"+
- "\5\u0175\1\0\13\u0175\1\0\12\u0175\1\0\4\u0175\1\0"+
- "\4\u0175\1\0\4\u0175\2\0\1\u0176\1\0\3\u0176\1\u0177"+
- "\4\343\1\u0176\1\0\3\u0176\1\u0177\1\343\1\u0176\1\0"+
- "\3\u0176\1\u0177\5\343\1\u0176\13\343\1\u0176\12\343\1\u0176"+
- "\4\343\1\u0178\11\343\2\u0176\20\0\1\u0179\7\0\1\u017a"+
- "\70\0\1\346\66\0\103\347\1\u017b\1\u0176\1\0\3\u0176"+
- "\1\u0177\4\350\1\u0176\1\0\3\u0176\1\u0177\1\350\1\u0176"+
- "\1\0\3\u0176\1\u0177\5\350\1\u0176\13\350\1\u0176\12\350"+
- "\1\u0176\4\350\1\u017c\11\350\2\u0176\103\351\1\u017d\63\0"+
- "\1\352\45\0\1\u0171\22\0\1\u0172\67\0\1\u0174\51\0"+
- "\1\u017e\103\0\1\u017f\107\0\4\113\6\0\1\113\6\0"+
- "\3\113\2\u0180\1\0\13\113\1\0\12\113\1\0\4\113"+
- "\1\0\11\113\10\0\4\113\6\0\1\113\6\0\5\113"+
- "\1\0\13\113\1\0\2\113\1\u0181\7\113\1\0\4\113"+
- "\1\0\6\113\1\u0181\2\113\2\0\12\365\1\366\3\365"+
- "\1\0\65\365\14\370\1\366\1\370\1\0\65\370\1\375"+
- "\1\0\10\375\1\377\2\375\1\u0182\45\375\1\u0182\20\375"+
- "\1\141\2\375\1\376\1\141\1\375\4\141\1\377\1\141"+
- "\1\375\1\141\1\137\1\375\6\141\1\375\55\141\1\u0101"+
- "\1\0\12\u0101\1\377\1\u0183\45\u0101\1\u0183\20\u0101\1\142"+
- "\2\u0101\1\u0102\1\142\1\u0101\4\142\1\u0101\1\142\1\377"+
- "\1\142\1\137\1\u0101\6\142\1\u0101\55\142\12\u0108\1\u0109"+
- "\3\u0108\1\0\65\u0108\14\u010b\1\u0109\1\u010b\1\0\65\u010b"+
- "\6\0\4\166\6\0\1\166\6\0\5\166\1\0\13\166"+
- "\1\0\12\166\1\0\4\166\1\0\6\166\1\u0184\2\166"+
- "\10\0\4\u010f\6\0\1\u010f\6\0\5\u010f\1\0\13\u010f"+
- "\1\0\12\u010f\1\0\4\u010f\1\0\11\u010f\10\0\4\u0111"+
- "\6\0\1\u0111\6\0\5\u0111\1\0\13\u0111\1\0\12\u0111"+
- "\1\0\4\u0111\1\0\11\u0111\2\0\12\u0112\1\u0113\3\u0112"+
- "\1\0\65\u0112\14\u0115\1\u0113\1\u0115\1\0\65\u0115\1\u0185"+
- "\2\u0186\1\u0187\1\u0185\1\u0186\4\u0185\1\u0186\1\u0185\1\u0186"+
- "\2\u0185\1\u0186\6\u0185\1\u0186\54\u0185\1\173\1\u0188\2\u0189"+
- "\1\u018a\1\u0188\1\u0189\4\u0188\1\u0189\1\u0188\1\u0189\2\u0188"+
- "\1\u0189\6\u0188\1\u0189\54\u0188\1\173\35\0\1\u018b\34\0"+
- "\1\u018b\51\0\1\u018c\14\0\1\u018c\70\0\1\u018d\11\0"+
- "\1\u018d\73\0\1\u018e\17\0\1\u018e\110\0\1\u018f\7\0"+
- "\1\u018f\2\0\12\u0121\1\u0122\3\u0121\1\0\65\u0121\1\u0124"+
- "\1\0\12\u0124\1\u0122\1\u0190\45\u0124\1\u0190\21\u0124\1\0"+
- "\12\u0124\1\u0191\1\u0190\45\u0124\1\u0190\20\u0124\14\0\1\u0192"+
- "\67\0\14\u0124\1\u0191\1\u0124\1\0\65\u0124\12\u0131\1\u0132"+
- "\3\u0131\1\0\65\u0131\1\u0134\1\0\12\u0134\1\u0132\1\u0193"+
- "\45\u0134\1\u0193\21\u0134\1\0\12\u0134\1\u0194\1\u0193\45\u0134"+
- "\1\u0193\20\u0134\14\0\1\u0195\67\0\14\u0134\1\u0194\1\u0134"+
- "\1\0\65\u0134\2\231\1\0\22\231\1\u0196\22\231\1\u0197"+
- "\35\231\1\0\31\231\1\u0198\47\231\12\u013b\1\u013c\3\u013b"+
- "\1\0\65\u013b\1\u013e\1\0\12\u013e\1\u013c\1\u0199\45\u013e"+
- "\1\u0199\21\u013e\1\0\12\u013e\1\u019a\1\u0199\45\u013e\1\u0199"+
- "\20\u013e\14\0\1\u019b\67\0\14\u013e\1\u019a\1\u013e\1\0"+
- "\65\u013e\2\240\1\0\22\240\1\u019c\22\240\1\u019d\35\240"+
- "\1\0\31\240\1\u019e\47\240\7\0\1\u019f\11\0\1\u0170"+
- "\3\0\1\u0171\22\0\1\u0172\55\0\1\u01a0\61\0\16\251"+
- "\1\0\65\251\16\257\1\0\65\257\12\264\1\0\1\264"+
- "\1\0\1\264\1\u01a1\64\264\1\u0150\12\264\1\0\1\264"+
- "\1\0\1\u014d\7\264\1\u01a2\22\264\1\u01a3\32\264\1\0"+
- "\12\u01a1\1\0\1\u01a1\1\0\66\u01a1\1\0\12\u0150\1\0"+
- "\1\u0150\1\0\1\u01a4\65\u0150\1\0\14\u0151\1\u0152\10\u0151"+
- "\1\u01a5\22\u0151\1\u01a6\47\u0151\1\u0152\17\u0151\1\u01a7\47\u0151"+
- "\12\u0155\1\u0156\12\u0155\1\u01a8\22\u0155\1\u01a9\45\u0155\1\u0156"+
- "\21\u0155\1\u01aa\47\u0155\12\302\1\0\103\302\1\0\12\302"+
- "\1\u01ab\22\302\1\u01ac\31\302\1\u0159\1\0\102\u01ad\1\u01ae"+
- "\1\u01ad\14\306\1\0\103\306\1\0\10\306\1\u01af\22\306"+
- "\1\u01b0\31\306\1\u015c\1\0\102\u01b1\1\u01b2\1\u01b1\12\311"+
- "\1\0\1\311\1\0\10\311\1\u01b3\22\311\1\u01b4\32\311"+
- "\1\0\14\u0161\1\u0162\10\u0161\1\u01b5\22\u0161\1\u01b6\47\u0161"+
- "\1\u0162\17\u0161\1\u01b7\47\u0161\12\u0165\1\u0166\12\u0165\1\u01b8"+
- "\22\u0165\1\u01b9\45\u0165\1\u0166\21\u0165\1\u01ba\47\u0165\12\327"+
- "\1\0\103\327\1\0\12\327\1\u01bb\22\327\1\u01bc\31\327"+
- "\1\u0169\1\0\102\u01bd\1\u01be\1\u01bd\14\333\1\0\103\333"+
- "\1\0\10\333\1\u01bf\22\333\1\u01c0\31\333\1\u016c\1\0"+
- "\102\u01c1\1\u01c2\1\u01c1\7\0\1\u01c3\103\0\1\u01c4\131\0"+
- "\1\u01c5\46\0\1\u0175\1\0\11\u0175\1\0\6\u0175\1\0"+
- "\61\u0175\1\u0176\1\0\11\u0176\1\0\6\u0176\1\0\45\u0176"+
- "\1\0\14\u0176\1\0\3\u0176\1\u0177\5\u0176\1\0\3\u0176"+
- "\1\u0177\2\u0176\1\0\3\u0176\1\u0177\41\u0176\1\u01c6\13\u0176"+
- "\20\0\1\u0179\47\0\1\u01c7\33\0\1\u01c8\14\0\3\u01c8"+
- "\2\0\1\u01c8\11\0\1\u01c8\1\0\2\u01c8\6\0\1\u01c8"+
- "\2\0\2\u01c8\6\0\1\u01c8\10\0\4\113\6\0\1\113"+
- "\6\0\5\113\1\0\11\113\1\u01c9\1\113\1\0\1\u01c9"+
- "\11\113\1\0\4\113\1\0\11\113\2\0\12\375\1\377"+
- "\3\375\1\0\65\375\14\u0101\1\377\1\u0101\1\0\65\u0101"+
- "\6\0\3\166\1\u01ca\6\0\1\166\6\0\5\166\1\0"+
- "\13\166\1\0\12\166\1\0\4\166\1\0\11\166\2\0"+
- "\1\u0185\2\u0186\1\u0187\1\u0185\1\u0186\4\u0185\1\u0186\1\u0185"+
- "\1\u0186\2\u0185\1\u0186\6\u0185\1\u0186\54\u0185\1\u01cb\103\u0186"+
- "\1\u01cc\1\u0188\2\u0189\1\u018a\1\u0188\1\u0189\4\u0188\1\u0189"+
- "\1\u0188\1\u0189\2\u0188\1\u0189\6\u0188\1\u0189\54\u0188\1\u01cb"+
- "\103\u0189\1\u01cd\40\0\1\u01ce\14\0\1\u01ce\60\0\2\u01cf"+
- "\101\0\1\u01d0\112\0\1\u01d1\14\0\1\u01d1\60\0\2\u01d2"+
- "\50\0\14\u0124\1\u0122\1\u0124\1\0\65\u0124\3\0\2\u01d3"+
- "\1\0\4\u01d3\2\0\1\u0126\1\u01d3\1\0\4\u01d3\1\0"+
- "\10\u01d3\1\0\37\u01d3\2\0\4\u01d3\2\0\14\u0134\1\u0132"+
- "\1\u0134\1\0\65\u0134\3\0\2\u01d4\1\0\4\u01d4\2\0"+
- "\1\u0136\1\u01d4\1\0\4\u01d4\1\0\10\u01d4\1\0\37\u01d4"+
- "\2\0\4\u01d4\2\0\2\231\1\0\32\231\1\u01d5\46\231"+
- "\14\u013e\1\u013c\1\u013e\1\0\65\u013e\3\0\2\u01d6\1\0"+
- "\4\u01d6\2\0\1\u0140\1\u01d6\1\0\4\u01d6\1\0\10\u01d6"+
- "\1\0\37\u01d6\2\0\4\u01d6\2\0\2\240\1\0\32\240"+
- "\1\u01d7\46\240\7\0\1\u01d8\76\0\1\u01d9\101\0\12\u0150"+
- "\1\0\1\u0150\1\0\1\u0150\1\0\65\u0150\14\u0151\1\u0152"+
- "\20\u0151\1\u01da\46\u0151\12\u0155\1\u0156\22\u0155\1\u01db\46\u0155"+
- "\12\u01dc\1\u01dd\70\u01dc\1\0\14\u01de\1\u01dd\66\u01de\1\0"+
- "\14\u0161\1\u0162\20\u0161\1\u01df\46\u0161\12\u0165\1\u0166\22\u0165"+
- "\1\u01e0\46\u0165\12\u01e1\1\u01e2\70\u01e1\1\0\14\u01e3\1\u01e2"+
- "\66\u01e3\37\0\1\u01e4\135\0\1\u01c6\33\0\1\u01c8\14\0"+
- "\3\u01c8\2\0\1\u01c8\11\0\1\u01c8\1\0\2\u01c8\6\0"+
- "\1\u01c8\1\0\1\u01c7\2\u01c8\6\0\1\u01c8\10\0\4\113"+
- "\6\0\1\113\6\0\5\113\1\0\6\113\1\u01e5\4\113"+
- "\1\0\12\113\1\0\1\113\1\u01e5\2\113\1\0\11\113"+
- "\10\0\4\166\6\0\1\166\6\0\5\166\1\0\6\166"+
- "\1\u01e6\4\166\1\0\6\166\1\u01e7\3\166\1\0\4\166"+
- "\1\0\11\166\54\0\1\u01e8\76\0\1\u01e9\13\0\1\u01e9"+
- "\64\0\1\u01ea\11\0\1\u01ea\71\0\1\u01eb\11\0\1\u01eb"+
- "\74\0\1\u01ec\13\0\1\u01ec\22\0\2\231\1\0\33\231"+
- "\1\u01ed\45\231\2\240\1\0\33\240\1\u01ee\45\240\14\u0151"+
- "\1\u0152\21\u0151\1\u01ef\45\u0151\12\u0155\1\u0156\23\u0155\1\u01f0"+
- "\45\u0155\12\u01dc\1\u01ad\67\u01dc\1\u01f1\1\u01ad\14\u01de\1\u01b1"+
- "\65\u01de\1\u01f2\1\u01b1\14\u0161\1\u0162\21\u0161\1\u01f3\45\u0161"+
- "\12\u0165\1\u0166\23\u0165\1\u01f4\45\u0165\12\u01e1\1\u01bd\67\u01e1"+
- "\1\u01f5\1\u01bd\14\u01e3\1\u01c1\65\u01e3\1\u01f6\1\u01c1\37\0"+
- "\1\u01f7\52\0\4\113\6\0\1\113\6\0\5\113\1\0"+
- "\3\113\1\u01f8\7\113\1\0\4\113\1\u01f8\5\113\1\0"+
- "\4\113\1\0\11\113\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\11\166\1\u01f9\1\166\1\0\12\166\1\0"+
- "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\10\166\1\u01fa\2\166\1\0\12\166\1\0"+
- "\4\166\1\0\11\166\55\0\1\u01fb\23\0\1\u01fb\50\0"+
- "\1\u01fc\17\0\1\u01fc\66\0\1\u01fd\12\0\1\u01fd\52\0"+
- "\1\u01fe\107\0\1\u01ff\34\0\1\u01ff\11\0\2\231\1\0"+
- "\34\231\1\u0200\44\231\2\240\1\0\34\240\1\u0201\44\240"+
- "\14\u0151\1\u0152\22\u0151\1\u0202\44\u0151\12\u0155\1\u0156\24\u0155"+
- "\1\u0203\44\u0155\12\u01dc\1\u0204\67\u01dc\1\u01f1\1\u01ad\14\u01de"+
- "\1\u0205\65\u01de\1\u01f2\1\u01b1\14\u0161\1\u0162\22\u0161\1\u0206"+
- "\44\u0161\12\u0165\1\u0166\24\u0165\1\u0207\44\u0165\12\u01e1\1\u0208"+
- "\67\u01e1\1\u01f5\1\u01bd\14\u01e3\1\u0209\65\u01e3\1\u01f6\1\u01c1"+
- "\40\0\1\u020a\51\0\4\166\6\0\1\166\6\0\5\166"+
- "\1\0\11\166\1\u020b\1\166\1\0\12\166\1\0\4\166"+
- "\1\0\11\166\10\0\4\166\6\0\1\166\6\0\5\166"+
- "\1\0\6\166\1\u020c\4\166\1\0\12\166\1\0\4\166"+
- "\1\0\11\166\44\0\1\u020d\11\0\1\u020d\67\0\1\u020e"+
- "\14\0\1\u020e\66\0\1\u020f\14\0\1\u020f\26\0\2\231"+
- "\1\0\35\231\1\u0210\43\231\2\240\1\0\35\240\1\u0211"+
- "\43\240\14\u0151\1\u0152\23\u0151\1\u0212\43\u0151\12\u0155\1\u0156"+
- "\25\u0155\1\u0213\43\u0155\14\u0161\1\u0162\23\u0161\1\u0214\43\u0161"+
- "\12\u0165\1\u0166\25\u0165\1\u0215\43\u0165\37\0\1\u0216\52\0"+
- "\4\166\6\0\1\166\6\0\5\166\1\0\13\166\1\0"+
- "\4\166\1\u0217\5\166\1\0\4\166\1\0\11\166\10\0"+
- "\4\166\6\0\1\166\6\0\5\166\1\0\5\166\1\u0218"+
- "\5\166\1\0\12\166\1\0\4\166\1\0\11\166\2\0"+
- "\2\231\1\0\34\231\1\u0219\44\231\2\240\1\0\34\240"+
- "\1\u021a\44\240\14\u0151\1\u0152\22\u0151\1\u021b\44\u0151\12\u0155"+
- "\1\u0156\24\u0155\1\u021c\44\u0155\14\u0161\1\u0162\22\u0161\1\u021d"+
- "\44\u0161\12\u0165\1\u0166\24\u0165\1\u021e\44\u0165\34\0\1\u021f"+
- "\55\0\4\166\6\0\1\166\6\0\5\166\1\0\13\166"+
- "\1\0\12\166\1\0\4\166\1\0\1\166\1\u0220\7\166"+
- "\2\0\2\231\1\0\31\231\1\u0221\47\231\2\240\1\0"+
- "\31\240\1\u0222\47\240\14\u0151\1\u0152\17\u0151\1\u0223\47\u0151"+
- "\12\u0155\1\u0156\21\u0155\1\u0224\47\u0155\14\u0161\1\u0162\17\u0161"+
- "\1\u0225\47\u0161\12\u0165\1\u0166\21\u0165\1\u0226\47\u0165\6\0"+
- "\4\166\6\0\1\166\6\0\5\166\1\0\13\166\1\0"+
- "\4\166\1\u0227\5\166\1\0\4\166\1\0\11\166\10\0"+
- "\4\166\6\0\1\166\6\0\5\166\1\0\10\166\1\u0228"+
- "\2\166\1\0\12\166\1\0\4\166\1\0\11\166\10\0"+
- "\4\166\6\0\1\166\6\0\5\166\1\0\4\166\1\u0229"+
- "\6\166\1\0\12\166\1\0\4\166\1\0\11\166\10\0"+
- "\4\166\6\0\1\166\6\0\5\166\1\0\5\166\1\u022a"+
- "\5\166\1\0\12\166\1\0\4\166\1\0\11\166\2\0"+
- "\6\u022b\4\u022c\6\u022b\1\u022c\5\u022b\1\0\5\u022c\1\u022b"+
- "\13\u022c\1\u022b\12\u022c\1\u022b\4\u022c\1\u022b\11\u022c\2\u022b"+
- "\41\0\1\u022d\3\0\1\u022e\7\0\1\u022f\1\u0230\20\0"+
- "\1\u0231\12\0\4\166\6\0\1\166\6\0\5\166\1\0"+
- "\4\166\1\u0232\3\166\1\u0233\2\166\1\0\4\166\1\u0234"+
- "\1\u0235\4\166\1\0\4\166\1\0\6\166\1\u0236\2\166"+
- "\60\0\1\u0237\74\0\1\u0238\112\0\1\u0239\102\0\1\u023a"+
- "\104\0\1\u023b\33\0\4\166\6\0\1\166\6\0\5\166"+
- "\1\0\13\166\1\0\5\166\1\u023c\4\166\1\0\4\166"+
- "\1\0\11\166\10\0\4\166\6\0\1\166\6\0\5\166"+
- "\1\0\12\166\1\u023d\1\0\12\166\1\0\4\166\1\0"+
- "\11\166\10\0\4\166\6\0\1\166\6\0\5\166\1\0"+
- "\13\166\1\0\5\166\1\u023e\4\166\1\0\4\166\1\0"+
- "\11\166\10\0\4\166\6\0\1\166\6\0\5\166\1\0"+
- "\13\166\1\0\4\166\1\u023f\5\166\1\0\4\166\1\0"+
- "\11\166\10\0\4\166\6\0\1\166\6\0\5\166\1\0"+
- "\13\166\1\0\5\166\1\u0240\4\166\1\0\4\166\1\0"+
- "\11\166\45\0\1\u0241\132\0\1\u0242\104\0\1\u0243\65\0"+
- "\1\u0244\121\0\1\u0245\16\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\6\166\1\u0246\4\166\1\0\12\166\1\0"+
- "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
- "\1\166\1\u0247\7\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
- "\2\166\1\u0248\6\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\13\166\1\0\4\166\1\u0249\5\166\1\0"+
- "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
- "\2\166\1\u024a\6\166\47\0\1\u024b\71\0\1\u024c\103\0"+
- "\1\u024d\113\0\1\u024e\102\0\1\u024f\47\0\4\166\6\0"+
- "\1\166\6\0\5\166\1\0\10\166\1\u0250\2\166\1\0"+
- "\12\166\1\0\4\166\1\0\11\166\10\0\4\166\6\0"+
- "\1\166\6\0\4\166\1\u0251\1\0\13\166\1\0\12\166"+
- "\1\0\4\166\1\0\11\166\10\0\4\166\6\0\1\166"+
- "\6\0\4\166\1\u0252\1\0\13\166\1\0\12\166\1\0"+
- "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\6\166\1\u0253\4\166\1\0\12\166\1\0"+
- "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\5\166\1\u0254\5\166\1\0\12\166\1\0"+
- "\4\166\1\0\11\166\60\0\1\u0255\125\0\1\u0256\50\0"+
- "\1\u0257\103\0\1\u0258\44\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\13\166\1\0\5\166\1\u0259\4\166\1\0"+
- "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
- "\7\166\1\u025a\1\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\10\166\1\u025b\2\166\1\0\12\166\1\0"+
- "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\10\166\1\u025c\2\166\1\0\12\166\1\0"+
- "\4\166\1\0\11\166\103\0\1\u025d\61\0\1\u0245\125\0"+
- "\1\u024f\103\0\1\u025e\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
- "\10\166\1\u025f\10\0\4\166\6\0\1\166\6\0\5\166"+
- "\1\0\13\166\1\0\6\166\1\u024a\3\166\1\0\4\166"+
- "\1\0\11\166\10\0\4\166\6\0\1\166\6\0\5\166"+
- "\1\0\13\166\1\0\12\166\1\0\4\166\1\0\10\166"+
- "\1\u0254\10\0\4\166\6\0\1\166\6\0\5\166\1\0"+
- "\13\166\1\0\12\166\1\0\4\166\1\0\10\166\1\u0260"+
- "\35\0\1\u0245\150\0\1\u0261\11\0\4\166\6\0\1\166"+
- "\6\0\4\166\1\u024a\1\0\13\166\1\0\12\166\1\0"+
- "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
- "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
- "\7\166\1\u0262\1\166\57\0\1\u0245\34\0\4\166\6\0"+
- "\1\166\6\0\5\166\1\0\13\166\1\0\4\166\1\u024a"+
- "\5\166\1\0\4\166\1\0\11\166\2\0";
-
- /**
- * The transition table of the DFA
- */
- final private static int yytrans [] = yy_unpack(yy_packed);
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- // final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error", //$NON-NLS-1$
- "Internal error: unknown state", //$NON-NLS-1$
- "Error: could not match input", //$NON-NLS-1$
- "Error: pushback value was too large" //$NON-NLS-1$
- };
-
- /**
- * YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
- */
- private final static byte YY_ATTRIBUTE[] = {
- 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 9,
- 1, 9, 1, 1, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1,
- 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 1, 1, 9, 1, 1,
- 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1,
- 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1,
- 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1,
- 1, 9, 9, 1, 1, 9, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1,
- 9, 1, 1, 1, 1, 9, 9, 1, 9, 3, 3, 3, 3, 3, 3, 9,
- 9, 1, 1, 1, 9, 1, 1, 1, 1, 1, 9, 9, 1, 9, 3, 3,
- 3, 3, 3, 3, 9, 9, 1, 1, 1, 9, 1, 1, 1, 9, 9, 1,
- 1, 0, 1, 0, 9, 1, 2, 1, 2, 1, 1, 0, 0, 0, 9, 1,
- 1, 9, 9, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1,
- 0, 0, 1, 9, 0, 9, 0, 0, 9, 0, 0, 0, 9, 1, 1, 0,
- 1, 0, 9, 0, 0, 0, 1, 1, 0, 0, 0, 0, 9, 0, 0, 0,
- 0, 9, 0, 0, 0, 1, 0, 0, 1, 0, 0, 9, 0, 0, 1, 0,
- 0, 9, 0, 0, 0, 1, 0, 1, 1, 0, 0, 9, 0, 0, 0, 1,
- 0, 1, 1, 1, 0, 0, 9, 9, 9, 0, 9, 9, 1, 1, 1, 1,
- 2, 13, 3, 2, 2, 13, 3, 2, 0, 1, 1, 0, 1, 1, 1, 1,
- 2, 13, 3, 2, 2, 13, 3, 2, 0, 1, 1, 0, 1, 1, 0, 9,
- 9, 9, 0, 0, 1, 1, 1, 9, 0, 0, 13, 9, 13, 9, 9, 1,
- 1, 0, 0, 1, 3, 2, 2, 3, 2, 2, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0,
- 1, 1, 1, 0, 3, 3, 2, 3, 3, 2, 1, 1, 0, 0, 1, 1,
- 0, 0, 1, 1, 3, 3, 2, 3, 3, 2, 1, 1, 0, 0, 1, 1,
- 0, 0, 9, 9, 0, 1, 9, 0, 1, 1, 5, 13, 13, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 9, 9, 2, 2, 0, 9, 0, 2, 2,
- 0, 9, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 2, 2,
- 0, 0, 2, 2, 0, 0, 0, 1, 1, 1, 0, 0, 0, 9, 9, 1,
- 1, 2, 2, 1, 1, 2, 2, 1, 1, 0, 1, 1, 9, 9, 9, 1,
- 1, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 9, 1,
- 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
- 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 9, 1,
- 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1,
- 0, 1
- };
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[16384];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** number of newlines encountered up to the start of the matched text */
- private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
- // private int yycolumn;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning of a line
- */
- // private boolean yy_atBOL;
-
- /** yy_atEOF == true <=> the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean yy_eof_done;
-
- /* user code: */
- private int fTokenCount = 0;
-
- // required holders for white-space compacting
- private boolean fShouldLoadBuffered = false;
- private String fBufferedContext = null;
- private int fBufferedStart = 1;
- private int fBufferedLength = 0;
- private ContextRegionContainer fBufferedEmbeddedContainer = null;
- private String f_context = null;
-
- // state stack for handling embedded regions
- private IntStack fStateStack = new IntStack();
- // a "hint" as to what an embedded region should be evaluated
- private String fEmbeddedHint = UNDEFINED;
- // a "hint" as to what state to enter once an embedded region has
- // been completed
- private int fEmbeddedPostState = YYINITIAL;
- // the container used to create embedded regions
- private ContextRegionContainer fEmbeddedContainer = null;
- private static final String PROXY_CONTEXT = "PROXY_CONTEXT";
-
- private String context = null;
- private int start = 0;
- private int textLength = 0;
- private int length = 0;
-
- // offset for tracking position specific block tags
- private int fOffset = 0;
-
- // the name of the current tag being opened
- private String fCurrentTagName = null;
-
- // the name of the current tag inside of an embedded region
- private String internalTagName = null;
- private String internalContext = null;
-
- // the list of tag name BlockMarkers
- private List fBlockMarkers = new ArrayList(0);
- private List fNestablePrefixes = new ArrayList(1);
-
- // where the last internal container block was found
- private int fLastInternalBlockStart = -1;
-
- // required to not seek text blocks on an end tag
- private boolean fIsBlockingEnabled = false;
- private boolean fIsCaseSensitiveBlocking = true;
-
- private static final boolean fForbidJSP = false;
-
- private int fELlevel = 0;
-
- private JSPParserRegionFactory fRegionFactory = new JSPParserRegionFactory();
-
- private static final String rcsver = "$Id: JSPTokenizer.java,v 1.4 2005/01/27 21:53:57 nitind Exp $";//$NON-NLS-1$
-
- /**
- * user method
- */
- public final void addBlockMarker(BlockMarker marker) {
- if(containsTagName(marker.getTagName()))
- return;
- fBlockMarkers.add(marker);
- }
- /**
- * user method
- */
- public final void addNestablePrefix(TagMarker marker) {
- fNestablePrefixes.add(marker);
- }
- /* user method */
- public List getNestablePrefixes() {
- return fNestablePrefixes;
- }
- /**
- * user method
- */
- private boolean isNestable(String tagName) {
- //Iterator blocks = fNestablePrefixes.iterator();
- //while(blocks.hasNext()) {
- // TagMarker marker = (TagMarker)blocks.next();
- // String markerName = marker.getTagName();
- // if(tagName.length() > markerName.length() + 1 && tagName.startsWith(markerName) && tagName.charAt(markerName.length()) == ':') {
- // return marker.isGlobal() || getOffset() >= marker.getMarker().getStart();
- // }
- //}
- //return false;
- return true;
- }
- /**
- * user method
- */
- public final void removeNestablePrefix(String name) {
- if (fNestablePrefixes != null) {
- Iterator nestables = fNestablePrefixes.iterator();
- while (nestables.hasNext()) {
- if (((TagMarker) nestables.next()).getTagName().equalsIgnoreCase(name))
- nestables.remove();
- }
- }
- }
- /**
- * user method
- */
- public final void removeBlockMarker(BlockMarker marker) {
- fBlockMarkers.remove(marker);
- }
- /**
- * user method
- */
- public final void removeBlockMarker(String tagname) {
- if (fBlockMarkers != null) {
- Iterator blocks = fBlockMarkers.iterator();
- while (blocks.hasNext()) {
- if (((BlockMarker) blocks.next()).getTagName().equals(tagname))
- blocks.remove();
- }
- }
- }
- /* user method */
- private final void assembleEmbeddedTagSequence(String startType, String endTagName) {
- assembleEmbeddedContainer(startType, null, endTagName);
- }
- /* user method */
- private final void assembleEmbeddedContainer(String startType, String[] endTypes) {
- assembleEmbeddedContainer(startType, endTypes, null);
- }
- /* user method */
- private final void assembleEmbeddedContainer(String startType, String endType) {
- assembleEmbeddedContainer(startType, new String[]{endType}, null);
- }
- /**
- * user method
- *
- * Assembles an embedded container beginning with the given startType as
- * the first ContextRegion within it and of the type fEmbeddedHint. The
- * endTypes[] array contains the context types that will cause a successful
- * exit. Use of the endTagName parameter alters this behavior to force an
- * exit on an XML_TAG_CLOSE after seeing an XML_TAG_NAME whose significant
- * text matches the endTagName String. All contents in between are
- * insignificant, and yes, this means comments are allowed inside.
- **/
- private final void assembleEmbeddedContainer(String startType, String[] endTypes, String endTagName) {
- // the context of the region being added to the embedded container
- internalContext = startType;
- // keep track of where this container began; to provide relative indeces for the regions
- int containerStart = yychar;
- boolean notFinished = true;
- // keep track of where we seem to be so that the endTagName can be checked
- boolean isInEndTag = false;
- boolean isInFirstTag = true;
- // create the embedded container and setup its "type"
- if (fEmbeddedContainer == null) {
- fEmbeddedContainer = new ContextRegionContainer();
- fEmbeddedContainer.setType(fEmbeddedHint);
- fEmbeddedContainer.setStart(containerStart);
- // TODO: parent region needs to be set .... but not sure where to get it from
- // fEmbeddedContainer.setParent(parentRegion);
- }
- containerStart = fEmbeddedContainer.getStart();
- while (notFinished) {
- // add the region to the container
- if (internalContext != null && internalContext != PROXY_CONTEXT) {
- ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
- fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
- // DW, 4/16/2003 token regions no longer have parents
- //newToken.setParent(fEmbeddedContainer);
- }
- try {
- // longscan determines whether to attempt a blockTagScan within the embedded container
- boolean longscan = false;
- // save the tokenizer state in case of a block tag scan
- int previousState = yystate();
- String previousCurrentTagName = fCurrentTagName;
- int previousPostState = fEmbeddedPostState;
- String previousEmbeddedHint = fEmbeddedHint;
- // determine if a block tag scan is necessary
- if (internalContext == XML_TAG_NAME) {
- internalTagName = yytext();
- if(!isNestable(internalTagName)) {
- internalTagName = null;
- // snagged a tag name we shouldn't have
- fEmbeddedPostState = ST_ABORT_EMBEDDED;
- notFinished = false;
- }
- }
- else if (internalContext == XML_TAG_OPEN || internalContext == XML_END_TAG_OPEN) {
- internalTagName = null;
- }
- // do upkeep for endTagName usage; must be here since the next token could be the close
- if (internalContext == XML_END_TAG_OPEN) {
- isInEndTag = true;
- } else if (internalContext == XML_TAG_CLOSE) {
- isInFirstTag = isInEndTag = false;
- } else {
- ITextRegionList embeddedRegions = fEmbeddedContainer.getRegions();
- if (embeddedRegions.size() > 2 && (embeddedRegions.get(embeddedRegions.size()-1)).getType() == XML_TAG_CLOSE && (embeddedRegions.get(embeddedRegions.size() - 3)).getType() == XML_TAG_OPEN && internalTagName != null) {
- if (containsTagName(internalTagName)) {
- longscan = true;
- yybegin(ST_BLOCK_TAG_SCAN);
- }
- }
- }
- if (longscan)
- fCurrentTagName = internalTagName;
- // read the next region and context
- internalContext = primGetNextToken();
- if (longscan) {
- // Returning from a block tag scan requires restoring some state variables
- // as well as handling the block region and setting up for normal scanning
- // inside the embedded container
- ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
- fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
- // DW, 4/16/2003 token regions no longer have parents
- // newToken.setParent(fEmbeddedContainer);
- longscan = false;
- fEmbeddedPostState = previousPostState;
- fEmbeddedHint = previousEmbeddedHint;
- fCurrentTagName = previousCurrentTagName;
- yybegin(previousState);
- internalContext = primGetNextToken();
- }
- } catch (IOException e) {
- // primGetNextToken() calls may throw an IOException
- // catch and do nothing since the isEOF check below
- // will properly exit if the input was too short
- } catch (Exception f) {
- // some other exception happened; never should
- Logger.logException(f);
- }
- boolean isEndingType = yystate() == ST_ABORT_EMBEDDED;
- if(!isEndingType) {
- // check for ending context
- if (endTagName == null) {
- for (int i = 0; i < endTypes.length; i++) {
- isEndingType = isEndingType || (internalContext == endTypes[i]);
- }
- }
- else {
- isEndingType = ((isInEndTag && internalContext == XML_TAG_CLOSE) || (isInFirstTag && internalContext == XML_EMPTY_TAG_CLOSE)) && internalTagName != null && internalTagName.equals(endTagName);
- }
- }
- ITextRegionList embeddedList = fEmbeddedContainer.getRegions();
- notFinished = notFinished && ((!isEndingType) && !isEOF() && (endTagName != null || internalContext != UNDEFINED) && !(internalContext == PROXY_CONTEXT && (embeddedList.get(embeddedList.size()-1)).getType() == UNDEFINED));
- }
- // finish adding the last context
- if (internalContext != null && internalContext != PROXY_CONTEXT) {
- ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- // DW, 4/16/2003 token regions no longer have parents
- //newToken.setParent(fEmbeddedContainer);
- fEmbeddedContainer.setLength(yychar - containerStart + yylength());
- fEmbeddedContainer.setTextLength(yychar - containerStart + yylength());
- }
- yybegin(fEmbeddedPostState);
- }
- /* user method */
- public final boolean isCaseSensitiveBlocking() {
- return fIsCaseSensitiveBlocking;
- }
- /* user method */
- public final void setCaseSensitiveBlocking(boolean newValue) {
- fIsCaseSensitiveBlocking = newValue;
- }
- /* user method */
- public boolean getBlockMarkerAllowsJSP() {
- return getBlockMarkerAllowsJSP(fCurrentTagName);
- }
- /* user method */
- public boolean getBlockMarkerAllowsJSP(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- boolean casesensitive = marker.isCaseSensitive();
- if(casesensitive && marker.getTagName().equals(name))
- return marker.allowsJSP();
- else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
- return marker.allowsJSP();
- }
- return true;
- }
- /* user method */
- public boolean getBlockMarkerCaseSensitivity() {
- return getBlockMarkerCaseSensitivity(fCurrentTagName);
- }
- public boolean getBlockMarkerCaseSensitivity(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- boolean casesensitive = marker.isCaseSensitive();
- if(casesensitive && marker.getTagName().equals(name))
- return casesensitive;
- else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
- return casesensitive;
- }
- return true;
- }
- /* user method */
- public String getBlockMarkerContext() {
- return getBlockMarkerContext(fCurrentTagName);
- }
- /* user method */
- public String getBlockMarkerContext(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- if(marker.getTagName().equals(name))
- return marker.getContext();
- }
- return BLOCK_TEXT;
- }
- /* user method */
- public List getBlockMarkers() {
- return fBlockMarkers;
- }
- /* user method */
- public final int getOffset() {
- return fOffset + yychar;
- }
- private final boolean isBlockMarker() {
- return isBlockMarker(fCurrentTagName);
- }
- private final boolean isBlockMarker(String tagName) {
- if (!fIsBlockingEnabled)
- return false;
- return containsTagName(tagName);
- }
- /**
- * user method
- */
- public final void beginBlockTagScan(String newTagName) {
- beginBlockMarkerScan(newTagName, BLOCK_TEXT);
- }
- /**
- * user method
- *
- * Special tokenizer setup. Allows tokenization to be initiated at the
- * start of a text block within a "newTagName" tag.
- *
- * Example:
- * Tokenizer toker = new Tokenizer();
- * toker.setCaseSensitiveBlocking(false);
- * toker.reset(new java.io.StringReader("afiuhqwkejhtasihgalkwhtq</scripter></scr></script>asgdasga"));
- * toker.beginBlockMarkerScan("script", BLOCK_TEXT);
- * toker.getRegions();
- *
- * Returns:
- * BLOCK_TEXT: 0-40
- * XML_END_TAG_OPEN: 41-42
- * XML_TAG_NAME: 43-48
- * XML_TAG_CLOSE: 49-49
- * XML_CONTENT: 50-57
- *
- */
- public final void beginBlockMarkerScan(String newTagName, String blockcontext) {
- yybegin(ST_BLOCK_TAG_SCAN);
- fCurrentTagName = newTagName;
- }
-
-/**
- * Method doScan.
- *
- * Returns a context region for all of the text from the current position upto the end of input or
- * to right *before* the first occurence of searchString
- *
- * @param searchString - target string to search for ex.: "-->", "</tagname"
- * @param requireTailSeparator - whether the target must be immediately followed by whitespace or '>'
- * @param allowJSP - check for and allow for JSP markup <%%>
- * @param context - the context of the scanned region if non-zero length
- * @param exitState - the state to go to if the region was of non-zero length
- * @param abortState - the state to go to if the searchString was found immediately
- * @return String - the context found: the desired context on a non-zero length match, the abortContext on immediate success
- * @throws IOException
- */
-private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {
- boolean stillSearching = true;
- // Disable further block (probably)
- fIsBlockingEnabled = false;
- int searchStringLength = searchString.length();
- int n = 0;
- char lastCheckChar;
- int i;
- boolean same = false;
- // Check for JSP starts ("<%") if the tag is global like SCRIPT or STYLE
- boolean checkJSPs = allowJSP && !fForbidJSP;
- boolean checkedForJSPsOnce = !checkJSPs;
- boolean checkedJSPsAtStartOnce = false;
-
- while (stillSearching) {
- n = 0;
- // Ensure that enough data from the input exists to compare against the search String.
- n = yy_advance();
- while(n != YYEOF && yy_currentPos < searchStringLength)
- n = yy_advance();
-// c = (char) n;
- // If the input was too short or we've exhausted the input, stop immediately.
- if (n == YYEOF && checkedForJSPsOnce) {
- stillSearching = false;
- }
- else {
- /**
- * Look for starting JSPs "<%"
- */
- checkedForJSPsOnce = true;
- // 1) yy_currentPos - searchStringLength : There's at least searchStringLength of input available; once that's read, check for JSPs
- // ---
- // Look for a JSP beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.
- // Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and
- // thus found twice at current-targetLength [since the first scan would have come out this far anyway].
- if(checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart &&
- yy_buffer[yy_currentPos - searchStringLength] == '<' && yy_buffer[yy_currentPos - searchStringLength + 1] == '%') {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
- // 2) yy_currentPos - jspstarter.length : There's not searchStringLength of input available; check for a JSP 2 spots back in what we could read
- // ---
- // Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section
- // since it relies upon *having* closeTagStringLength amount of input to work as designed. Must be sure we don't
- // spill over the end of the buffer while checking.
- else if(checkJSPs && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&
- yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
- // 3) yy_currentPos..(yy_currentPos+jspStartlength-1) : Check at the start of the block one time
- // ---
- // Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section
- // since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.
- else if(checkJSPs && !checkedJSPsAtStartOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&
- yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {
- checkedJSPsAtStartOnce = true;
- fLastInternalBlockStart = yy_markedPos = yy_startRead;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
-
-
- /**
- * Look for starting CDATA "<![CDATA["
- */
- // 1) yy_currentPos - searchStringLength: There's at least searchStringLength of input available; once that's read, check for CDATA
- // ---
- // Look for a CDATA beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.
- // Ensure that we've not encountered a complete block (<[!CDATA[]]>) that was *shorter* than the closeTagString and
- // thus found twice at current-targetLength [since the first scan would have come out this far anyway].
-/* if(checkCDATA && yy_currentPos > searchStringLength && yy_currentPos + searchStringLength < yy_buffer.length && yy_currentPos - searchStringLength != fLastInternalBlockStart &&
- charsMatch(cdataStarter, yy_buffer, 0, yy_currentPos - searchStringLength)) {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- // go to a state where CDATA can be found
- if (fEmbeddedContainer == null) {
- fEmbeddedContainer = new ContextRegionContainer();
- fEmbeddedContainer.setType(searchContext);
- fEmbeddedContainer.setStart(yychar);
- }
- ITextRegion newToken = fRegionFactory.createToken(searchContext, yychar, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
- fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
- yybegin(YYINITIAL);
- String context = primGetNextToken();
- if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {
- assembleEmbeddedContainer(XMLRegionContexts.XML_CDATA_OPEN, XMLRegionContexts.XML_CDATA_CLOSE);
- }
- yybegin(resumeState);
- return searchContext;
- }
-*//*
- // 2) yy_currentPos - cdataStarter.length: There's not searchStringLength of input available; check for a CDATA right here spots back in what we could read
- // ---
- // Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section
- // since it relies upon *having* closeTagStringLength amount of input to work as designed. Must be sure we don't
- // spill over the end of the buffer while checking.
- else if(checkCDATA && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&
- yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
- // 3) yy_currentPos : Check at the start of the block one time
- // ---
- // Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section
- // since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.
- else if(checkCDATA && !checkedForCDATAOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&
- yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {
- checkedForCDATAOnce = true;
- fLastInternalBlockStart = yy_markedPos = yy_startRead;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
-*/
- // Check the characters in the target versus the last targetLength characters read from the buffer
- // and see if it matches
- if (n == YYEOF) {
- stillSearching = false;
- }
- else {
- same = true;
- // safety check for array accesses
- if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {
- for(i = 0; i < searchStringLength; i++) {
- if(same && fIsCaseSensitiveBlocking)
- same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);
- else if(same && !fIsCaseSensitiveBlocking)
- same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));
- }
- }
- // safety check failed; no match is possible right now
- else {
- same = false;
- }
- }
- if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {
- // Additional check for close tags to ensure that targetString="</script" doesn't match
- // "</scriptS"
- lastCheckChar = yy_buffer[yy_currentPos];
- // Succeed on "</script>" and "</script "
- if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))
- stillSearching = false;
- }
- else {
- stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);
- }
- }
- }
- if (n != YYEOF || same) {
- // We've stopped short of the end or definitely found a match
- yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- // If the searchString occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if (yy_markedPos == yy_startRead) {
- yybegin(immediateFallbackState);
- return primGetNextToken();
- }
- }
- else {
- // We ran through the rest of the input
- yy_markedPos = yy_currentPos;
- yy_currentPos++;
- }
- yybegin(exitState);
- // If the ending occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if(yy_markedPos == yy_startRead)
- return primGetNextToken();
- return searchContext;
-}
-/**
- * user method
- * does a lookahead for the current tag name
- */
-private final String doBlockTagScan() throws IOException {
- fIsCaseSensitiveBlocking = getBlockMarkerCaseSensitivity();
- return doScan("</" + fCurrentTagName, true, getBlockMarkerAllowsJSP(), true, getBlockMarkerContext(fCurrentTagName), YYINITIAL, YYINITIAL);
-}
- /**
- * user method
- *
- * Converts the raw context String returned by the primGetNextToken()
- * method into a full ITextRegion by pulling in values for the
- * current offset within the scanning text.
- *
- * Returns null when EOF is encountered and attaches intermittently
- * discovered whitespace onto the end of useful regions.
- *
- * Note that this algorithm caches the token following the one being returned
- * so that whitespace can be collapsed.
- */
- public final ITextRegion getNextToken() throws IOException {
- fEmbeddedContainer = null;
- // load the starting non-whitespace token (assume that it is so)
- if (fShouldLoadBuffered) {
- if (fBufferedEmbeddedContainer != null) {
- ITextRegion container = fBufferedEmbeddedContainer;
- fBufferedEmbeddedContainer = null;
- fShouldLoadBuffered = false;
- return container;
- }
- context = fBufferedContext;
- start = fBufferedStart;
- textLength = length = fBufferedLength;
- fShouldLoadBuffered = false;
- } else {
- context = primGetNextToken();
- if (context == PROXY_CONTEXT) {
- return fEmbeddedContainer;
- } else if (context == XML_TAG_NAME || f_context == JSP_ROOT_TAG_NAME || f_context == JSP_DIRECTIVE_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- } else if (context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- } else if (context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- start = yychar;
- textLength = length = yylength();
- if (yy_atEOF) {
- fTokenCount++;
- return null;
- }
- }
- // store the next token
- f_context = primGetNextToken();
- if (f_context == PROXY_CONTEXT) {
- fBufferedEmbeddedContainer = fEmbeddedContainer;
- fShouldLoadBuffered = true;
- } else if (f_context == XML_TAG_NAME || f_context == JSP_ROOT_TAG_NAME || f_context == JSP_DIRECTIVE_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- } else if (f_context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- } else if (f_context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- fBufferedContext = f_context;
- fBufferedStart = yychar;
- fBufferedLength = yylength();
- fShouldLoadBuffered = true;
- if (fBufferedContext == WHITE_SPACE) {
- fShouldLoadBuffered = false;
- length += fBufferedLength;
- }
- if (context == null) {
- // EOF
- if (Debug.debugTokenizer) {
- System.out.println(getClass().getName() + " discovered " + fTokenCount + " tokens."); //$NON-NLS-2$//$NON-NLS-1$
- }
- return null;
- }
- fTokenCount++;
- return fRegionFactory.createToken(context, start, textLength, length, null, fCurrentTagName);
- }
- /* user method */
- public JSPTokenizer(){
- super();
- }
- /* user method */
- public JSPTokenizer(char[] charArray){
- this(new CharArrayReader(charArray));
- }
- /* user method */
- public void reset(char[] charArray) {
- reset(new CharArrayReader(charArray), 0);
- }
- /* user method */
- public void reset(char[] charArray, int newOffset) {
- reset(new CharArrayReader(charArray), newOffset);
- }
- /* user method */
- public void reset(java.io.InputStream in) {
- reset(new java.io.InputStreamReader(in), 0);
- }
- /* user method */
- public void reset(java.io.InputStream in, int newOffset) {
- reset(new java.io.InputStreamReader(in), newOffset);
- }
- /* user method */
- public void reset(java.io.Reader in) {
- reset(in, 0);
- }
- /**
- * user method *
- *
- * Reset internal counters and vars to "newly created" values, in the hopes
- * that resetting a pre-existing tokenizer is faster than creating a new one.
- *
- * This method contains code blocks that were essentially duplicated from the
- * <em>generated</em> output of this specification before this method was
- * added. Those code blocks were under the above copyright.
- */
- public void reset(java.io.Reader in, int newOffset) {
- if (Debug.debugTokenizer) {
- System.out.println("resetting tokenizer");//$NON-NLS-1$
- }
- fOffset = newOffset;
-
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
- yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- /* user vars: */
- fTokenCount = 0;
-
- fShouldLoadBuffered = false;
- fBufferedContext = null;
- fBufferedStart = 1;
- fBufferedLength = 0;
- fStateStack = new IntStack();
-
- fLastInternalBlockStart = -1;
-
- context = null;
- start = 0;
- textLength = 0;
- length = 0;
-
- fEmbeddedContainer = null;
-
- fELlevel = 0;
- }
- /**
- * user method
- *
- * @see com.ibm.sed.parser.BlockTokenizer#newInstance()
- */
- public BlockTokenizer newInstance() {
- JSPTokenizer newInstance = new JSPTokenizer();
- // global tagmarkers can be shared; they have no state and
- // are never destroyed (e.g. 'release')
- for(int i = 0; i < fBlockMarkers.size(); i++) {
- BlockMarker blockMarker = (BlockMarker) fBlockMarkers.get(i);
- if(blockMarker.isGlobal())
- newInstance.addBlockMarker(blockMarker);
- }
- for(int i = 0; i < fNestablePrefixes.size(); i++) {
- TagMarker marker = (TagMarker) fNestablePrefixes.get(i);
- if(marker.isGlobal())
- newInstance.addNestablePrefix(marker);
- }
- return newInstance;
- }
- /* user method */
- private final String scanXMLCommentText() throws IOException {
- // Scan for '-->' and return the text up to that point as
- // XML_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
- // case change to the ST_XML_COMMENT_END state and return the next
- // context as usual.
- return doScan("-->", false, true, true, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
- }
- /* user method */
- private final String scanJSPCommentText() throws IOException {
- // Scan for '--%>' and return the text up to that point as
- // JSP_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
- // case change to the ST_JSP_COMMENT_END state and return the next
- // context as usual.
- return doScan("--%>", false, false, true, JSP_COMMENT_TEXT, ST_JSP_COMMENT_END, ST_JSP_COMMENT_END);
- }
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- public JSPTokenizer(java.io.Reader in) {
- this.yy_reader = in;
- }
-
- /**
- * Creates a new scanner.
- * There is also java.io.Reader version of this constructor.
- *
- * @param in the java.io.Inputstream to read input from.
- */
- public JSPTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the compressed DFA transition table.
- *
- * @param packed the packed transition table
- * @return the unpacked transition table
- */
- private static int [] yy_unpack(String packed) {
- int [] trans = new int[28900];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 7180) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- value--;
- do trans[j++] = value; while (--count > 0);
- }
- return trans;
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed the packed character translation table
- * @return the unpacked character translation table
- */
- private static char [] yy_unpack_cmap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 1376) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do map[j++] = value; while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Gets the next input character.
- *
- * @return the next character of the input stream, EOF if the
- * end of the stream is reached.
- * @exception IOException if any I/O-Error occurs
- */
- private int yy_advance() throws java.io.IOException {
-
- /* standard case */
- if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
- /* if the eof is reached, we don't need to work hard */
- if (yy_atEOF) return YYEOF;
-
- /* otherwise: need to refill the buffer */
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if ( numRead == -1 ) return YYEOF;
-
- yy_endRead+= numRead;
-
- return yy_buffer[yy_currentPos++];
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
- yy_reader.close();
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning - from the SED JFlex skeleton
- *
- * @param errorCode the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- try {
- Logger.log(Logger.ERROR, YY_ERROR_MSG[errorCode]);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- Logger.log(Logger.ERROR, YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- }
- // DO NOT EXIT the VM on an error
- // System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
- /**
- * user method - skeleton.sed
- */
- protected final boolean containsTagName(char[] markerTagName, int offset, int tagnameLength) {
- for(int j = 0; j < fBlockMarkers.size(); j++) {
- BlockMarker marker = (BlockMarker)fBlockMarkers.get(j);
- if(marker.getTagName().length() == tagnameLength) {
- boolean matchesSoFar = true;
- for(int i = 0; i < tagnameLength && matchesSoFar; i++) {
- if(marker.isCaseSensitive()) {
- if(marker.getTagName().charAt(i) != markerTagName[i + offset])
- matchesSoFar = false;
- }
- else {
- if(Character.toLowerCase(marker.getTagName().charAt(i)) != Character.toLowerCase(markerTagName[i + offset]))
- matchesSoFar = false;
- }
- }
- if(matchesSoFar)
- return true;
- }
- }
- return false;
- }
-
- /**
- * user method - skeleton.sed
- *
- * Return ALL of the regions scannable within the remaining text
- * Note: for verification use
- */
- public final List getRegions() {
- List tokens = new ArrayList();
- ITextRegion region = null;
- try {
- region = getNextToken();
- while(region != null) {
- if (region != null) {
- tokens.add(region);
- }
- region = getNextToken();
- }
- }
- catch (StackOverflowError e) {
- Logger.logException(getClass().getName()+": input could not be tokenized correctly at position " + getOffset(), e);//$NON-NLS-1$
- throw e;
- }
- catch (Exception e) {
- // Since this is convenience method and NOT the recommended
- // way of getting tokens, many errors are simply hidden
- Logger.logException("Exception not handled retrieving regions: " + e.getLocalizedMessage(), e);//$NON-NLS-1$
- }
- return tokens;
- }
- /**
- * user method - skeleton.sed
- */
- private final void dump(String s) {
- if (Debug.debugTokenizer) {
- System.out.println(s + " (" + yychar + "-" + //$NON-NLS-2$//$NON-NLS-1$
- (yylength() + yychar) + "):\'" +//$NON-NLS-1$
- StringUtils.escape(yytext()) + "\'");//$NON-NLS-1$
- }
- }
- /* user method - skeleton.sed */
- public final boolean isEOF() {
- return yy_atEOF;
- }
-/* user method - skeleton.sed */
-protected final boolean containsTagName(String markerTagName) {
- Iterator blocks = fBlockMarkers.iterator();
- while(blocks.hasNext()) {
- BlockMarker marker = (BlockMarker)blocks.next();
- if(marker.isCaseSensitive()) {
- if(marker.getTagName().equals(markerTagName))
- return true;
- }
- else {
- if(marker.getTagName().equalsIgnoreCase(markerTagName))
- return true;
- }
- }
- return false;
-}
-
- /**
- * Contains user EOF-code, which will be executed exactly once,
- * when the end of file is reached
- */
- private void yy_do_eof() {
- if (!yy_eof_done) {
- yy_eof_done = true;
- // do nothing, this is the downstream parser's job
-
- }
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception IOException if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
- yy_pushbackPos = -1;
- boolean yy_was_pushback;
-
- while (true) {
-
- yychar+= yylength();
-
- boolean yy_counted = false;
- for (yy_currentPos = yy_startRead; yy_currentPos < yy_markedPos;
- yy_currentPos++) {
- switch (yy_buffer[yy_currentPos]) {
- case '\r':
- yyline++;
- yy_counted = true;
- break;
- case '\n':
- if (yy_counted)
- yy_counted = false;
- else {
- yyline++;
- }
- break;
- default:
- yy_counted = false;
- }
- }
-
- if (yy_counted) {
- if ( yy_advance() == '\n' ) yyline--;
- if ( !yy_atEOF ) yy_currentPos--;
- }
-
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
- yy_state = yy_lexical_state;
-
- yy_was_pushback = false;
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
- int yy_next = yytrans[ yy_rowMap[yy_state] + yycmap[yy_input] ];
- if (yy_next == -1) break yy_forAction;
- yy_state = yy_next;
-
- int yy_attributes = YY_ATTRIBUTE[yy_state];
- if ( (yy_attributes & 2) > 0 )
- yy_pushbackPos = yy_currentPos;
-
- if ( (yy_attributes & 1) > 0 ) {
- yy_was_pushback = (yy_attributes & 4) > 0;
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
- if ( (yy_attributes & 8) > 0 ) break yy_forAction;
- }
-
- }
- }
-
- if (yy_was_pushback)
- yy_markedPos = yy_pushbackPos;
-
- switch (yy_action) {
-
- case 578:
- case 583:
- case 590:
- case 595:
- {
- if(Debug.debugTokenizer)
- dump("jsp directive tag name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return JSP_DIRECTIVE_NAME;
- }
- case 611: break;
- case 542:
- case 544:
- case 545:
- case 546:
- case 547:
- case 548:
- case 549:
- {
- if(Debug.debugTokenizer)
- dump("\nCDATA start");//$NON-NLS-1$
- fStateStack.push(yystate());
- yybegin(ST_CDATA_TEXT);
- return XML_CDATA_OPEN;
- }
- case 612: break;
- case 534:
- {
- if(Debug.debugTokenizer)
- dump("jsp:root tag name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return JSP_ROOT_TAG_NAME;
- }
- case 613: break;
- case 526:
- {
- if(Debug.debugTokenizer)
- dump("element");//$NON-NLS-1$
- yybegin(ST_XML_ELEMENT_DECLARATION);
- return XML_ELEMENT_DECLARATION;
- }
- case 614: break;
- case 525:
- {
- if(Debug.debugTokenizer)
- dump("attlist");//$NON-NLS-1$
- yybegin(ST_XML_ATTLIST_DECLARATION);
- return XML_ATTLIST_DECLARATION;
- }
- case 615: break;
- case 524:
- {
- if(Debug.debugTokenizer)
- dump("doctype");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_DECLARATION);
- return XML_DOCTYPE_DECLARATION;
- }
- case 616: break;
- case 510:
- {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- fEmbeddedHint = XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
- return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
- }
- case 617: break;
- case 509:
- {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- fEmbeddedHint = XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
- }
- case 618: break;
- case 503:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction target");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 619: break;
- case 481:
- case 519:
- case 520:
- {
- return JSP_VBL_QUOTED_CONTENT;
- }
- case 620: break;
- case 476:
- case 515:
- case 516:
- {
- return JSP_EL_QUOTED_CONTENT;
- }
- case 621: break;
- case 472:
- {
- if(Debug.debugTokenizer)
- dump("\nJSP comment close");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return JSP_COMMENT_CLOSE;
- }
- case 622: break;
- case 471:
- {
- yybegin(ST_JSP_COMMENT);
- assembleEmbeddedContainer(JSP_COMMENT_OPEN, JSP_COMMENT_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN)
- yybegin(ST_BLOCK_TAG_SCAN);
- return PROXY_CONTEXT;
- }
- case 623: break;
- case 460:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- if(yylength() > 2)
- yypushback(yylength() -2);
- if(Debug.debugTokenizer)
- dump("VBL in attr value");//$NON-NLS-1$
- yybegin(ST_JSP_VBL);
- fELlevel++;
- assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE});
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- return PROXY_CONTEXT;
- }
- case 624: break;
- case 459:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- if(yylength() > 2)
- yypushback(yylength() -2);
- if(Debug.debugTokenizer)
- dump("EL in attr value");//$NON-NLS-1$
- yybegin(ST_JSP_EL);
- fELlevel++;
- assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE});
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- return PROXY_CONTEXT;
- }
- case 625: break;
- case 454:
- {
- if(Debug.debugTokenizer)
- dump("\nCharRef");//$NON-NLS-1$
- return XML_CHAR_REFERENCE;
- }
- case 626: break;
- case 451:
- {
- if(Debug.debugTokenizer)
- dump("\ncomment start");//$NON-NLS-1$
- fEmbeddedHint = XML_COMMENT_TEXT;
- fEmbeddedPostState = ST_XML_COMMENT;
- yybegin(ST_XML_COMMENT);
- return XML_COMMENT_OPEN;
- }
- case 627: break;
- case 450:
- {
- if(Debug.debugTokenizer)
- dump("\nJSP comment start");//$NON-NLS-1$
- yybegin(ST_JSP_COMMENT);
- return JSP_COMMENT_OPEN;
- }
- case 628: break;
- case 383:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction target");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 629: break;
- case 382:
- {
- if(Debug.debugTokenizer)
- dump("comment end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_COMMENT_CLOSE;
- }
- case 630: break;
- case 381:
- {
- if(Debug.debugTokenizer)
- dump("CDATA end");//$NON-NLS-1$
- yybegin(fStateStack.pop());
- return XML_CDATA_CLOSE;
- }
- case 631: break;
- case 380:
- {
- yybegin(ST_JSP_VBL);
- if(yylength() > 2)
- yypushback(yylength() - 2);
- fELlevel++;
- fEmbeddedHint = XML_CONTENT;
- fEmbeddedPostState = YYINITIAL;
- assembleEmbeddedContainer(JSP_VBL_OPEN, JSP_VBL_CLOSE);
- fEmbeddedHint = XML_CONTENT;
- yybegin(YYINITIAL);
- return PROXY_CONTEXT;
- }
- case 632: break;
- case 379:
- {
- if(Debug.debugTokenizer)
- dump("\nPEReference");//$NON-NLS-1$
- return XML_PE_REFERENCE;
- }
- case 633: break;
- case 378:
- {
- yybegin(ST_JSP_EL);
- if(yylength() > 2)
- yypushback(yylength() - 2);
- fELlevel++;
- fEmbeddedHint = XML_CONTENT;
- fEmbeddedPostState = YYINITIAL;
- assembleEmbeddedContainer(JSP_EL_OPEN, JSP_EL_CLOSE);
- fEmbeddedHint = XML_CONTENT;
- yybegin(YYINITIAL);
- return PROXY_CONTEXT;
- }
- case 634: break;
- case 375:
- {
- if(Debug.debugTokenizer)
- dump("\nEntityRef");//$NON-NLS-1$
- return XML_ENTITY_REFERENCE;
- }
- case 635: break;
- case 369:
- case 406:
- case 412:
- case 418:
- case 421:
- case 424:
- case 427:
- case 431:
- case 435:
- case 437:
- case 440:
- case 443:
- case 447:
- {
- /* JSP expression begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(2);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(3);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(3);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(3);
- return scanJSPCommentText();
- }
- // end sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just an expression out in content
- if(Debug.debugTokenizer)
- dump("\nJSP expression start");//$NON-NLS-1$
- yybegin(ST_JSP_CONTENT);
- return JSP_EXPRESSION_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP expression start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_CONTENT);
- assembleEmbeddedContainer(JSP_EXPRESSION_OPEN, JSP_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
- }
- case 636: break;
- case 368:
- case 405:
- case 411:
- case 417:
- case 420:
- case 423:
- case 426:
- case 430:
- case 434:
- case 436:
- case 439:
- case 442:
- case 446:
- {
- /* JSP declaration begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(2);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(3);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(3);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(3);
- return scanJSPCommentText();
- }
- // end sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just a declaration out in content
- if(Debug.debugTokenizer)
- dump("\nJSP declaration start");//$NON-NLS-1$
- yybegin(ST_JSP_CONTENT);
- return JSP_DECLARATION_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP declaration start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_CONTENT);
- assembleEmbeddedContainer(JSP_DECLARATION_OPEN, JSP_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
- }
- case 637: break;
- case 367:
- {
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- if(Debug.debugTokenizer)
- dump("\nJSP directive start");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_NAME);
- return JSP_DIRECTIVE_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP directive start");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_NAME);
- assembleEmbeddedContainer(JSP_DIRECTIVE_OPEN, new String[]{JSP_DIRECTIVE_CLOSE, JSP_CLOSE});
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- return PROXY_CONTEXT;
- }
- }
- case 638: break;
- case 357:
- {
- yybegin(ST_JSP_VBL_DQUOTES_END);
- return JSP_VBL_QUOTED_CONTENT;
- }
- case 639: break;
- case 353:
- {
- yybegin(ST_JSP_VBL_SQUOTES_END);
- return JSP_VBL_QUOTED_CONTENT;
- }
- case 640: break;
- case 351:
- {
- fELlevel++;
- if(fELlevel == 1) {
- return JSP_VBL_OPEN;
- }
- }
- case 641: break;
- case 341:
- {
- yybegin(ST_JSP_EL_DQUOTES_END);
- return JSP_EL_QUOTED_CONTENT;
- }
- case 642: break;
- case 337:
- {
- yybegin(ST_JSP_EL_SQUOTES_END);
- return JSP_EL_QUOTED_CONTENT;
- }
- case 643: break;
- case 335:
- {
- //System.out.println(JSP_EL_CONTENT+ ":[" + yytext() + "]");
- return JSP_EL_CONTENT;
- }
- case 644: break;
- case 334:
- {
- fELlevel++;
- if(fELlevel == 1) {
- return JSP_EL_OPEN;
- }
- }
- case 645: break;
- case 331:
- {
- int enterState = yystate();
- yybegin(ST_JSP_DQUOTED_VBL);
- assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE});
- // abort early when an unescaped double quote is found in the VBL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
- }
- case 646: break;
- case 330:
- {
- int enterState = yystate();
- yybegin(ST_JSP_DQUOTED_EL);
- assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE});
- // abort early when an unescaped double quote is found in the EL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
- }
- case 647: break;
- case 328:
- {
- int enterState = yystate();
- yybegin(ST_JSP_SQUOTED_VBL);
- assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE});
- // abort early when an unescaped single quote is found in the VBL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
- }
- case 648: break;
- case 327:
- {
- int enterState = yystate();
- yybegin(ST_JSP_SQUOTED_EL);
- assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE});
- // abort early when an unescaped single quote is found in the EL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
- }
- case 649: break;
- case 326:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- int incomingState = yystate();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- if(Debug.debugTokenizer)
- dump("JSP attribute value start - end tag");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedContainer(XML_END_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
- if(yystate() != ST_ABORT_EMBEDDED)
- yybegin(incomingState);
- return PROXY_CONTEXT;
- }
- case 650: break;
- case 284:
- case 296:
- case 302:
- {
- return XML_DOCTYPE_INTERNAL_SUBSET;
- }
- case 651: break;
- case 272:
- {
- String tagName = yytext().substring(1);
- // pushback to just after the opening bracket
- yypushback(yylength() - 1);
- if(!isNestable(tagName)) {
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
- }
- if(Debug.debugTokenizer)
- dump("tag in place of attr value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- // embedded container should be looking for the name (again) next
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return PROXY_CONTEXT;
- }
- case 652: break;
- case 270:
- {
- String tagName = yytext().substring(1);
- // pushback to just after the opening bracket
- yypushback(yylength() - 1);
- if(!isNestable(tagName)) {
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
- }
- if(Debug.debugTokenizer)
- dump("tag in place of attr name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- // embedded container should be looking for the name (again) next
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
- fStateStack.pop();
- yybegin(ST_XML_EQUALS);
- return PROXY_CONTEXT;
- }
- case 653: break;
- case 268:
- {
- yybegin(YYINITIAL);
- fEmbeddedHint = UNDEFINED;
- if(Debug.debugTokenizer)
- dump("empty tag close");//$NON-NLS-1$
- return XML_EMPTY_TAG_CLOSE;
- }
- case 654: break;
- case 125:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- yybegin(ST_XML_ATTRIBUTE_VALUE_DQUOTED);
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("JSP attribute value start - complex double quoted");//$NON-NLS-1$
- assembleEmbeddedContainer(XML_TAG_ATTRIBUTE_VALUE_DQUOTE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE);
- fStateStack.pop();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return PROXY_CONTEXT;
- }
- case 655: break;
- case 123:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("JSP tag embedded name start - start tag");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedContainer(XML_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- return PROXY_CONTEXT;
- }
- case 656: break;
- case 122:
- case 127:
- case 128:
- case 274:
- case 278:
- case 279:
- case 388:
- case 391:
- case 458:
- {
- if(Debug.debugTokenizer)
- dump("attr value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 657: break;
- case 121:
- {
- if(Debug.debugTokenizer)
- dump("equals");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 658: break;
- case 120:
- {
- if(Debug.debugTokenizer)
- dump("attr name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 659: break;
- case 116:
- case 117:
- case 118:
- case 269:
- case 387:
- case 457:
- case 485:
- case 486:
- case 504:
- case 505:
- case 522:
- case 523:
- case 535:
- case 543:
- case 550:
- case 551:
- case 552:
- case 553:
- case 555:
- case 561:
- case 562:
- case 563:
- case 564:
- case 565:
- case 571:
- case 572:
- case 573:
- case 574:
- case 575:
- case 581:
- case 582:
- case 584:
- case 585:
- case 591:
- case 592:
- case 593:
- case 594:
- case 600:
- case 601:
- case 602:
- case 603:
- case 606:
- case 607:
- case 609:
- {
- if(Debug.debugTokenizer)
- dump("tag name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 660: break;
- case 114:
- {
- if(Debug.debugTokenizer)
- dump("tag close");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- if(isBlockMarker()) {
- fEmbeddedHint = getBlockMarkerContext();
- fEmbeddedPostState = ST_BLOCK_TAG_SCAN;
- yybegin(ST_BLOCK_TAG_SCAN);
- }
- else
- yybegin(YYINITIAL);
- return XML_TAG_CLOSE;
- }
- case 661: break;
- case 107:
- case 111:
- case 264:
- {
- if(Debug.debugTokenizer)
- dump("attr value");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 662: break;
- case 106:
- {
- if(Debug.debugTokenizer)
- dump("equals");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 663: break;
- case 105:
- {
- if(Debug.debugTokenizer)
- dump("attr name");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 664: break;
- case 102:
- {
- if(Debug.debugTokenizer)
- dump("JSP directive name");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_NAME_WHITESPACE);
- return JSP_DIRECTIVE_NAME;
- }
- case 665: break;
- case 98:
- case 99:
- case 100:
- {
- if(Debug.debugTokenizer)
- dump("JSP code content");//$NON-NLS-1$
- return doScan("%>", false, false, false, JSP_CONTENT, ST_JSP_CONTENT, ST_JSP_CONTENT);
- }
- case 666: break;
- case 94:
- case 96:
- case 97:
- case 254:
- case 255:
- case 258:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 667: break;
- case 93:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction '='");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_DHTML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 668: break;
- case 92:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_DHTML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 669: break;
- case 90:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 670: break;
- case 84:
- case 86:
- case 245:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 671: break;
- case 83:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction '='");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 672: break;
- case 50:
- case 200:
- case 201:
- case 204:
- case 214:
- case 215:
- case 218:
- case 219:
- case 362:
- case 365:
- {
- return JSP_VBL_CONTENT;
- }
- case 673: break;
- case 43:
- case 179:
- case 180:
- case 183:
- case 193:
- case 194:
- case 197:
- case 198:
- case 332:
- case 346:
- case 349:
- case 416:
- {
- return JSP_EL_CONTENT;
- }
- case 674: break;
- case 35:
- case 159:
- case 160:
- case 322:
- case 413:
- case 470:
- case 493:
- case 512:
- case 528:
- case 537:
- {
- if(Debug.debugTokenizer)
- dump("attlist contentspec");//$NON-NLS-1$
- return XML_ATTLIST_DECL_CONTENT;
- }
- case 675: break;
- case 33:
- case 152:
- case 153:
- case 312:
- case 407:
- case 468:
- case 492:
- case 511:
- case 527:
- case 536:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl contentspec");//$NON-NLS-1$
- return XML_ELEMENT_DECL_CONTENT;
- }
- case 676: break;
- case 22:
- case 112:
- {
- if(Debug.debugTokenizer)
- dump("inappropriate tag name");//$NON-NLS-1$
- if(!fStateStack.empty() && (fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_SQUOTED||fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_DQUOTED)) {
- yybegin(ST_ABORT_EMBEDDED);
- yypushback(yylength()-1);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- yybegin(YYINITIAL);
- return XML_CONTENT;
- }
- case 677: break;
- case 18:
- case 104:
- {
- if(Debug.debugTokenizer)
- dump("white space");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
- return WHITE_SPACE;
- }
- case 678: break;
- case 5:
- case 8:
- case 9:
- case 10:
- case 12:
- case 13:
- case 14:
- case 15:
- case 17:
- case 19:
- case 20:
- case 21:
- case 23:
- case 24:
- case 25:
- case 26:
- case 27:
- case 28:
- case 29:
- case 30:
- case 31:
- case 32:
- case 34:
- case 40:
- case 41:
- case 73:
- case 170:
- case 175:
- {
- if(Debug.debugTokenizer)
- dump("white space");//$NON-NLS-1$
- return WHITE_SPACE;
- }
- case 679: break;
- case 0:
- case 57:
- case 60:
- case 62:
- case 226:
- case 228:
- case 229:
- case 231:
- case 233:
- case 372:
- case 373:
- case 374:
- case 453:
- {
- if(Debug.debugTokenizer)
- dump("\nXML content");//$NON-NLS-1$
- return XML_CONTENT;
- }
- case 680: break;
- case 58:
- case 101:
- case 113:
- case 119:
- case 129:
- {
- if(Debug.debugTokenizer)
- dump("\nstart tag open");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
- }
- case 681: break;
- case 59:
- case 61:
- case 65:
- case 66:
- case 67:
- case 71:
- case 72:
- case 81:
- case 85:
- case 87:
- case 88:
- case 89:
- case 91:
- case 95:
- case 103:
- case 108:
- case 109:
- case 110:
- case 115:
- case 124:
- case 131:
- case 132:
- case 133:
- case 134:
- case 136:
- case 137:
- case 139:
- case 140:
- case 141:
- case 144:
- case 145:
- case 146:
- case 149:
- case 150:
- case 151:
- case 156:
- case 157:
- case 158:
- case 164:
- case 167:
- case 172:
- case 173:
- case 177:
- case 178:
- case 185:
- case 186:
- case 188:
- case 189:
- case 195:
- case 199:
- case 206:
- case 207:
- case 209:
- case 210:
- case 216:
- case 220:
- {
- if (Debug.debugTokenizer)
- System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
- yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
- return UNDEFINED;
- }
- case 682: break;
- case 63:
- case 64:
- {
- if(Debug.debugTokenizer)
- dump("CDATA text");//$NON-NLS-1$
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- String returnedContext = doScan("]]>", false, true, true, XML_CDATA_TEXT, ST_CDATA_END, ST_CDATA_END);//$NON-NLS-1$
- if(returnedContext == XML_CDATA_TEXT)
- yybegin(ST_CDATA_END);
- return returnedContext;
- }
- case 683: break;
- case 68:
- case 187:
- case 190:
- case 208:
- case 211:
- {
- if(Debug.debugTokenizer)
- dump("LINE FEED");//$NON-NLS-1$
- return WHITE_SPACE;
- }
- case 684: break;
- case 69:
- case 70:
- {
- if(Debug.debugTokenizer)
- dump("comment content");//$NON-NLS-1$
- return scanXMLCommentText();
- }
- case 685: break;
- case 74:
- case 75:
- case 76:
- case 239:
- case 240:
- case 384:
- case 456:
- case 484:
- {
- if(Debug.debugTokenizer)
- dump("processing instruction target");//$NON-NLS-1$
- fEmbeddedHint = XML_CONTENT;
- yybegin(ST_PI_WS);
- return XML_TAG_NAME;
- }
- case 686: break;
- case 77:
- {
- yybegin(ST_PI_CONTENT);
- return WHITE_SPACE;
- }
- case 687: break;
- case 78:
- case 79:
- case 80:
- {
- // block scan until close is found
- return doScan("?>", false, false, false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
- }
- case 688: break;
- case 82:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_XML_PI_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 689: break;
- case 126:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- yybegin(ST_XML_ATTRIBUTE_VALUE_SQUOTED);
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("JSP attribute value start - complex single quoted");//$NON-NLS-1$
- assembleEmbeddedContainer(XML_TAG_ATTRIBUTE_VALUE_SQUOTE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE);
- fStateStack.pop();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return PROXY_CONTEXT;
- }
- case 690: break;
- case 130:
- {
- if(Debug.debugTokenizer)
- dump("declaration end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 691: break;
- case 135:
- {
- if(Debug.debugTokenizer)
- dump("doctype type");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
- return XML_DOCTYPE_NAME;
- }
- case 692: break;
- case 138:
- case 142:
- case 289:
- case 293:
- case 400:
- {
- if(Debug.debugTokenizer)
- dump("doctype public reference");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- }
- case 693: break;
- case 143:
- case 147:
- case 299:
- {
- if(Debug.debugTokenizer)
- dump("doctype system reference");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_DECLARATION_CLOSE);
- return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- }
- case 694: break;
- case 148:
- case 305:
- case 309:
- case 403:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl name");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
- return XML_ELEMENT_DECL_NAME;
- }
- case 695: break;
- case 154:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 696: break;
- case 155:
- case 315:
- case 319:
- case 409:
- {
- if(Debug.debugTokenizer)
- dump("attlist name");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
- return XML_ATTLIST_DECL_NAME;
- }
- case 697: break;
- case 161:
- {
- if(Debug.debugTokenizer)
- dump("attlist close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 698: break;
- case 165:
- case 166:
- {
- if(Debug.debugTokenizer)
- dump("\nJSP comment text");//$NON-NLS-1$
- return scanJSPCommentText();
- }
- case 699: break;
- case 168:
- case 174:
- {
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 700: break;
- case 169:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- int incomingState = yystate();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- if(Debug.debugTokenizer)
- dump("tag inside of JSP attribute value start");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedContainer(XML_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
- if(yystate() != ST_ABORT_EMBEDDED)
- yybegin(incomingState);
- return PROXY_CONTEXT;
- }
- case 701: break;
- case 171:
- {
- return XML_TAG_ATTRIBUTE_VALUE_SQUOTE;
- }
- case 702: break;
- case 176:
- {
- return XML_TAG_ATTRIBUTE_VALUE_DQUOTE;
- }
- case 703: break;
- case 181:
- {
- yybegin(ST_JSP_EL_DQUOTES);
- return JSP_EL_DQUOTE;
- }
- case 704: break;
- case 182:
- {
- yybegin(ST_JSP_EL_SQUOTES);
- return JSP_EL_SQUOTE;
- }
- case 705: break;
- case 184:
- {
- fELlevel--;
- if(fELlevel == 0) {
- yybegin(YYINITIAL);
- return JSP_EL_CLOSE;
- }
- return JSP_EL_CONTENT;
- }
- case 706: break;
- case 191:
- {
- yybegin(ST_JSP_EL);
- return JSP_EL_SQUOTE;
- }
- case 707: break;
- case 192:
- {
- yybegin(ST_JSP_EL);
- return JSP_EL_DQUOTE;
- }
- case 708: break;
- case 196:
- {
- return JSP_EL_CLOSE;
- }
- case 709: break;
- case 202:
- {
- yybegin(ST_JSP_VBL_DQUOTES);
- return JSP_VBL_DQUOTE;
- }
- case 710: break;
- case 203:
- {
- yybegin(ST_JSP_VBL_SQUOTES);
- return JSP_VBL_SQUOTE;
- }
- case 711: break;
- case 205:
- {
- fELlevel--;
- if(fELlevel == 0) {
- yybegin(YYINITIAL);
- return JSP_VBL_CLOSE;
- }
- return JSP_VBL_CONTENT;
- }
- case 712: break;
- case 212:
- {
- yybegin(ST_JSP_VBL);
- return JSP_VBL_SQUOTE;
- }
- case 713: break;
- case 213:
- {
- yybegin(ST_JSP_VBL);
- return JSP_VBL_DQUOTE;
- }
- case 714: break;
- case 217:
- {
- return JSP_VBL_CLOSE;
- }
- case 715: break;
- case 221:
- {
- if(Debug.debugTokenizer)
- dump("\nend tag open");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_TAG_NAME);
- return XML_END_TAG_OPEN;
- }
- case 716: break;
- case 222:
- {
- if(Debug.debugTokenizer)
- dump("\nprocessing instruction start");//$NON-NLS-1$
- yybegin(ST_PI);
- return XML_PI_OPEN;
- }
- case 717: break;
- case 223:
- case 234:
- case 311:
- case 321:
- case 323:
- case 333:
- case 338:
- case 342:
- case 345:
- case 348:
- case 350:
- case 354:
- case 358:
- case 361:
- case 364:
- {
- /* JSP scriptlet begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(1);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(2);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(2);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(2);
- return scanJSPCommentText();
- }
- // finished sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just a regular scriptlet out in content
- if(Debug.debugTokenizer)
- dump("\nJSP scriptlet start");//$NON-NLS-1$
- yybegin(ST_JSP_CONTENT);
- return JSP_SCRIPTLET_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP scriptlet start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_CONTENT);
- assembleEmbeddedContainer(JSP_SCRIPTLET_OPEN, JSP_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
- }
- case 718: break;
- case 224:
- {
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("\ndeclaration start");//$NON-NLS-1$
- yybegin(ST_XML_DECLARATION);
- return XML_DECLARATION_OPEN;
- }
- case 719: break;
- case 238:
- {
- if(Debug.debugTokenizer)
- dump("processing instruction end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 720: break;
- case 241:
- {
- // ended with nothing inside
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 721: break;
- case 242:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 722: break;
- case 259:
- {
- if(Debug.debugTokenizer)
- dump("JSP end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return JSP_CLOSE;
- }
- case 723: break;
- case 261:
- {
- if(Debug.debugTokenizer)
- dump("JSP end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return JSP_DIRECTIVE_CLOSE;
- }
- case 724: break;
- case 162:
- case 163:
- {
- return doBlockTagScan();
- }
- case 725: break;
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
- yy_do_eof();
- return null;
- }
- else {
- yy_ScanError(YY_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/tasks/JSPTaskTagSeeker.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/tasks/JSPTaskTagSeeker.java
deleted file mode 100644
index 146e6e54ba..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/tasks/JSPTaskTagSeeker.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.tasks;
-
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.xml.core.builder.delegates.XMLTaskTagSeeker;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-
-public class JSPTaskTagSeeker extends XMLTaskTagSeeker {
- protected boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion) {
- return super.isCommentRegion(region, textRegion) || textRegion.getType().equals(XMLJSPRegionContexts.JSP_COMMENT_TEXT);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/NullStructuredDocumentPartitioner.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/NullStructuredDocumentPartitioner.java
deleted file mode 100644
index 022ae4cad0..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/NullStructuredDocumentPartitioner.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.text.rules;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredTextPartitioner;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.StructuredTypedRegion;
-
-/**
- * To be used when no known partitioner is available.
- * Always returns the unknown type.
- */
-public class NullStructuredDocumentPartitioner implements IStructuredTextPartitioner {
-
- public class NullStructuredTypedRegion implements StructuredTypedRegion {
-
- private int fOffset;
-
- private int fLength;
-
- private String fType;
-
- public void setType(String type) {
- fType = type;
- }
-
- public void setLength(int length) {
- fLength = length;
-
- }
-
- public void setOffset(int offset) {
- fOffset = offset;
- }
-
- public String getType() {
- return fType;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getOffset() {
- return fOffset;
- }
-
- }
-
- public final static String ST_UNKNOWN_PARTITION = "com.ibm.sse.UNKNOWN_PARTITION_TYPE"; //$NON-NLS-1$
- private final String[] legalTypes = new String[]{ST_UNKNOWN_PARTITION};
-
- public NullStructuredDocumentPartitioner() {
- super();
- }
-
- public void connect(IDocument document) {
- // nothing to do
- }
-
- public StructuredTypedRegion createPartition(int offset, int length, String type) {
- StructuredTypedRegion result = new NullStructuredTypedRegion();
- result.setOffset(offset);
- result.setLength(length);
- result.setType(type);
- return result;
- }
-
- public void disconnect() {
- // nothing to do
- }
-
- public String getDefault() {
- return ST_UNKNOWN_PARTITION;
- }
-
- public String[] getLegalContentTypes() {
- return legalTypes;
- }
-
- public String getPartitionType(ITextRegion region, int offset) {
- return ST_UNKNOWN_PARTITION;
- }
-
- public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, ITextRegion previousStartTagNameRegion, IStructuredDocumentRegion nextNode, ITextRegion nextEndTagNameRegion) {
- return ST_UNKNOWN_PARTITION;
- }
-
- public ITypedRegion[] computePartitioning(int offset, int length) {
- ITypedRegion[] alwaysOne = new ITypedRegion[]{createPartition(offset, length, ST_UNKNOWN_PARTITION)};
- return alwaysOne;
- }
-
- public void documentAboutToBeChanged(DocumentEvent event) {
- }
-
- public boolean documentChanged(DocumentEvent event) {
- return false;
- }
-
- public String getContentType(int offset) {
- return getDefault();
- }
-
- public ITypedRegion getPartition(int offset) {
- return createPartition(offset, 1, getDefault());
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/StructuredTextPartitionerForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/StructuredTextPartitionerForJSP.java
deleted file mode 100644
index 0d31501315..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/StructuredTextPartitionerForJSP.java
+++ /dev/null
@@ -1,543 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.text.rules;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jst.jsp.core.JSP11Namespace;
-import org.eclipse.jst.jsp.core.JSP12Namespace;
-import org.eclipse.jst.jsp.core.contentmodel.tld.JSP12TLDNames;
-import org.eclipse.jst.jsp.core.encoding.JSPDocumentHeadContentDetector;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionHandler;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionHandlerExtension;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionParser;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredTextPartitioner;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.core.util.StringUtils;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML;
-
-public class StructuredTextPartitionerForJSP extends StructuredTextPartitioner {
-
- private class PrefixListener implements StructuredDocumentRegionHandler, StructuredDocumentRegionHandlerExtension {
- // track the list of prefixes introduced by taglib directives
- private List fCustomActionPrefixes = null;
- private String fLastTrue = null;
-
- public PrefixListener() {
- super();
- fCustomActionPrefixes = new ArrayList(1);
- resetNodes();
- }
-
- private JSPSourceParser getTextSource() {
- return (JSPSourceParser) structuredDocument.getParser();
- }
-
- public void nodeParsed(IStructuredDocumentRegion sdRegion) {
- // Largely taken from the TLDCMDocumentManager
- // could test > 1, but since we only care if there are 8 (<%@,
- // taglib, uri, =, where, prefix, =, what) [or 4 for includes]
- if (sdRegion.getNumberOfRegions() > 4 && sdRegion.getRegions().get(1).getType() == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME) {
- ITextRegion nameRegion = sdRegion.getRegions().get(1);
- try {
- boolean tablibdetected = false;
- boolean directiveTaglibdetected;
- int startOffset = sdRegion.getStartOffset(nameRegion);
- int textLength = nameRegion.getTextLength();
-
- if (getTextSource() != null) {
- tablibdetected = getTextSource().regionMatches(startOffset, textLength, JSP12TLDNames.TAGLIB);
- directiveTaglibdetected = getTextSource().regionMatches(startOffset, textLength, JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
- }
- else {
- // old fashioned way
- String directiveName = getTextSource().getText(startOffset, textLength);
- tablibdetected = directiveName.equals(JSP12TLDNames.TAGLIB);
- directiveTaglibdetected = directiveName.equals(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
- }
- if (tablibdetected || directiveTaglibdetected) {
- processTaglib(sdRegion);
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- // ISSUE: why is this "normal" here?
- //do nothing
- }
- }
- }
-
-
- private void processTaglib(IStructuredDocumentRegion taglibStructuredDocumentRegion) {
- ITextRegionList regions = taglibStructuredDocumentRegion.getRegions();
- String prefixValue = null;
- boolean prefixnameDetected = false;
- try {
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- int startOffset = taglibStructuredDocumentRegion.getStartOffset(region);
- int textLength = region.getTextLength();
- if (region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- prefixnameDetected = getTextSource().regionMatches(startOffset, textLength, JSP12TLDNames.PREFIX);
- //String regionText =
- // fTextSource.getText(startOffset, textLength);
- //prefixname =
- // regionText.equals(JSP12TLDNames.PREFIX);
- }
- else if (prefixnameDetected && region.getType() == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- prefixValue = getTextSource().getText(startOffset, textLength);
- }
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- // nothing to be done
- prefixValue = null;
- }
- if (prefixValue != null) {
- String prefixText = StringUtils.strip(prefixValue) + ":"; //$NON-NLS-1$
- if (!fCustomActionPrefixes.contains(prefixText)) {
- if(debugPrefixListener == true) {
- System.out.println("StructuredTextPartitionerForJSP.PrefixListener learning prefix: " + prefixText);
- }
- fCustomActionPrefixes.add(prefixText);
- }
- }
- }
-
- public void resetNodes() {
- fLastTrue = null;
- fCustomActionPrefixes.clear();
- fCustomActionPrefixes.add(JSP11Namespace.JSP_TAG_PREFIX + ":"); //$NON-NLS-1$
- if(debugPrefixListener == true) {
- System.out.println("StructuredTextPartitionerForJSP.PrefixListener forgetting learned prefixes");
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.parser.StructuredDocumentRegionHandlerExtension#setStructuredDocument(com.ibm.sse.model.text.IStructuredDocument)
- */
- public void setStructuredDocument(IStructuredDocument newDocument) {
- resetNodes();
- ((StructuredDocumentRegionParser) structuredDocument.getParser()).removeStructuredDocumentRegionHandler(this);
- if(newDocument != null) {
- ((StructuredDocumentRegionParser) newDocument.getParser()).addStructuredDocumentRegionHandler(this);
- }
- }
-
- public boolean startsWithCustomActionPrefix(String tagname) {
- if (tagname.equals(fLastTrue))
- return true;
- for (int i = 0; i < fCustomActionPrefixes.size(); i++)
- if (tagname.startsWith((String) fCustomActionPrefixes.get(i))) {
- fLastTrue = tagname;
- return true;
- }
- return false;
- }
- }
-
- static final boolean debugPrefixListener = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/partitioner/prefixlistener"));
-
-
- // for compatibility with v5.1.0, we'll reuse ST_JSP_DIRECTIVE for action
- // tags
- private final static boolean fEnableJSPActionPartitions = true;
- // list of valid JSP 1.2 tag and action names
- private static List fJSPActionTagNames = null;
- private static final String HTML_CONTENT_TYPE = "text/html"; //$NON-NLS-1$
-
- public final static String ST_DEFAULT_JSP = "org.eclipse.jst.jsp.DEFAULT_JSP"; //$NON-NLS-1$
- public final static String ST_JSP_COMMENT = "org.eclipse.jst.jsp.JSP_COMMENT"; //$NON-NLS-1$
- private final static String ST_JSP_SCRIPT = "org.eclipse.jst.jsp.SCRIPT."; //$NON-NLS-1$
- public final static String ST_JSP_CONTENT_DELIMITER = ST_JSP_SCRIPT + "DELIMITER"; //$NON-NLS-1$
- public final static String ST_JSP_CONTENT_JAVA = ST_JSP_SCRIPT + "JAVA"; //$NON-NLS-1$
- public final static String ST_JSP_CONTENT_JAVASCRIPT = ST_JSP_SCRIPT + "JAVASCRIPT"; //$NON-NLS-1$
- public final static String ST_JSP_DEFAULT_EL = ST_JSP_SCRIPT + "JSP_EL"; //$NON-NLS-1$
- public final static String ST_JSP_DIRECTIVE = "org.eclipse.jst.jsp.JSP_DIRECTIVE"; //$NON-NLS-1$
- private static final String XHTML_CONTENT_TYPE = "text/xhtml"; //$NON-NLS-1$
- private static final String XML_CONTENT_TYPE = "text/xml"; //$NON-NLS-1$
-
- private final static String[] fConfiguredContentTypes = new String[]{ST_DEFAULT_JSP, ST_JSP_DEFAULT_EL, ST_JSP_DIRECTIVE, ST_JSP_CONTENT_DELIMITER, ST_JSP_CONTENT_JAVA, ST_JSP_CONTENT_JAVASCRIPT, ST_JSP_COMMENT};
-
- /**
- * @return
- */
- public static String[] getConfiguredContentTypes() {
- return fConfiguredContentTypes;
- }
-
- private IStructuredTextPartitioner fEmbeddedPartitioner = null;
-
-
- /**
- * Assume language=java by default ... client, such as
- * PageDirectiveAdapter, must set language of document partitioner,
- * if/when it changes.
- */
- private String fLanguage = "java"; //$NON-NLS-1$
- private PrefixListener fPrefixParseListener;
-
- /**
- * Constructor for JSPDocumentPartioner.
- */
- public StructuredTextPartitionerForJSP() {
- super();
- if (fJSPActionTagNames == null) {
- fJSPActionTagNames = new ArrayList(); // uses .equals() for
- // contains()
- fJSPActionTagNames.add(JSP12Namespace.ElementName.DECLARATION);
- // fJSPActionTagNames.add(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
- // fJSPActionTagNames.add(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
- // fJSPActionTagNames.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.EXPRESSION);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.FALLBACK);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.FORWARD);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.GETPROPERTY);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.INCLUDE);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.PARAM);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.PARAMS);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.PLUGIN);
- // fJSPActionTagNames.add(JSP12Namespace.ElementName.ROOT);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.SCRIPTLET);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.SETPROPERTY);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.TEXT);
- fJSPActionTagNames.add(JSP12Namespace.ElementName.USEBEAN);
- }
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#connect(org.eclipse.jface.text.IDocument)
- */
- public void connect(IDocument document) {
- super.connect(document);
- fSupportedTypes = null;
-
- // be extra paranoid
- if (fEnableJSPActionPartitions && structuredDocument.getParser() instanceof JSPSourceParser) {
- StructuredDocumentRegionParser parser = (StructuredDocumentRegionParser) structuredDocument.getParser();
- parser.removeStructuredDocumentRegionHandler(fPrefixParseListener);
- fPrefixParseListener = new PrefixListener();
- parser.addStructuredDocumentRegionHandler(fPrefixParseListener);
- }
- }
-
- private IStructuredTextPartitioner createStructuredTextPartitioner(IStructuredDocument structuredDocument) {
- IStructuredTextPartitioner result = new NullStructuredDocumentPartitioner();
- JSPDocumentHeadContentDetector jspHeadContentDetector = new JSPDocumentHeadContentDetector();
- jspHeadContentDetector.set(structuredDocument);
- String contentType;
- try {
- contentType = jspHeadContentDetector.getContentType();
- }
- catch (IOException e) {
- // should be impossible in this context
- throw new Error(e);
- }
- if (contentType == null) {
- contentType = "text/html"; //$NON-NLS-1$
- }
- // we currently only have two ... eventually should
- // make or tie-in to existing registry.
- if (contentType.equalsIgnoreCase(HTML_CONTENT_TYPE)) {
- result = new StructuredTextPartitionerForHTML();
- result.connect(structuredDocument);
- }
- else if (contentType.equalsIgnoreCase(XHTML_CONTENT_TYPE)) {
- result = new StructuredTextPartitionerForHTML();
- result.connect(structuredDocument);
- }
- else if (contentType.equalsIgnoreCase(XML_CONTENT_TYPE)) {
- result = new StructuredTextPartitionerForXML();
- result.connect(structuredDocument);
- }
- return result;
-
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#disconnect()
- */
- public void disconnect() {
- // we'll check for null document, just for bullet proofing (incase
- // disconnnect is called without corresponding connect.
- if (structuredDocument != null) {
- StructuredDocumentRegionParser parser = (StructuredDocumentRegionParser) structuredDocument.getParser();
- if (fPrefixParseListener != null)
- parser.removeStructuredDocumentRegionHandler(fPrefixParseListener);
- fPrefixParseListener = null;
- }
-
- if (fEmbeddedPartitioner != null) {
- fEmbeddedPartitioner.disconnect();
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4909
- /**
- * force recreation when reconnected
- */
- fEmbeddedPartitioner = null;
- }
- // super.disconnect should come at end, since it (may) set
- // structuredDocument to null
- super.disconnect();
- }
-
- public String getDefault() {
- return getEmbeddedPartitioner().getDefault();
- }
-
- /**
- * Returns the embeddedPartitioner.
- *
- * @return IStructuredTextPartitioner
- */
- public IStructuredTextPartitioner getEmbeddedPartitioner() {
- if (fEmbeddedPartitioner == null) {
- fEmbeddedPartitioner = createStructuredTextPartitioner(structuredDocument);
- fEmbeddedPartitioner.connect(structuredDocument);
- }
-
- return fEmbeddedPartitioner;
- }
-
- /**
- * Returns the language.
- *
- * @return String
- */
- public String getLanguage() {
- return fLanguage;
- }
-
- private List getLocalLegalContentTypes() {
- List types = new ArrayList();
- Object[] configuredTypes = getConfiguredContentTypes();
- for (int i = 0; i < configuredTypes.length; i++)
- types.add(configuredTypes[i]);
- return types;
- }
-
- private String getParentName(IStructuredDocumentRegion sdRegion) {
- String result = "UNKNOWN"; //$NON-NLS-1$
- while (sdRegion != null && isValidJspActionRegionType(sdRegion.getType()))
- sdRegion = sdRegion.getPrevious();
-
- if (sdRegion != null) {
- ITextRegionList regions = sdRegion.getRegions();
- // only find parent names from a start tag
- if (regions.size() > 1) {
- ITextRegion r = regions.get(1);
- if (regions.get(0).getType().equals(XMLRegionContext.XML_TAG_OPEN) && r.getType().equals(XMLRegionContext.XML_TAG_NAME)) {
- result = sdRegion.getText(r);
- }
- }
- }
- return result;
- }
-
- protected String getPartitionType(ForeignRegion region, int offset) {
- return getEmbeddedPartitioner().getPartitionType(region, offset);
- }
-
- /**
- * @see com.ibm.sed.model.StructuredTextPartitioner#getPartitionType(com.ibm.sed.structuredDocument.ITextRegion)
- */
- public String getPartitionType(ITextRegion region, int offset) {
- String result = null;
- final String region_type = region.getType();
- if (region_type == XMLJSPRegionContexts.JSP_CONTENT) {
- result = getPartitionTypeForDocumentLanguage();
- }
- else if (region_type == XMLJSPRegionContexts.JSP_COMMENT_TEXT || region_type == XMLJSPRegionContexts.JSP_COMMENT_OPEN || region_type == XMLJSPRegionContexts.JSP_COMMENT_CLOSE)
- result = ST_JSP_COMMENT;
- else if (region_type == XMLJSPRegionContexts.JSP_DIRECTIVE_NAME || region_type == XMLJSPRegionContexts.JSP_DIRECTIVE_OPEN || region_type == XMLJSPRegionContexts.JSP_DIRECTIVE_CLOSE)
- result = ST_JSP_DIRECTIVE;
- else if (region_type == XMLJSPRegionContexts.JSP_CLOSE || region_type == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN || region_type == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN || region_type == XMLJSPRegionContexts.JSP_DECLARATION_OPEN)
- result = ST_JSP_CONTENT_DELIMITER;
- else if (region_type == XMLJSPRegionContexts.JSP_ROOT_TAG_NAME)
- result = ST_DEFAULT_JSP;
- else if (region_type == XMLJSPRegionContexts.JSP_EL_OPEN || region_type == XMLJSPRegionContexts.JSP_EL_CONTENT || region_type == XMLJSPRegionContexts.JSP_EL_CLOSE || region_type == XMLJSPRegionContexts.JSP_EL_DQUOTE
- || region_type == XMLJSPRegionContexts.JSP_EL_SQUOTE || region_type == XMLJSPRegionContexts.JSP_EL_QUOTED_CONTENT)
- result = ST_JSP_DEFAULT_EL;
- else if (region_type == XMLRegionContext.XML_CONTENT) {
- // possibly between <jsp:scriptlet>, <jsp:expression>,
- // <jsp:declration>
- IStructuredDocumentRegion sdRegion = this.structuredDocument.getRegionAtCharacterOffset(offset);
- if (isJspJavaActionName(getParentName(sdRegion)))
- result = getPartitionTypeForDocumentLanguage();
- else
- result = getDefault();
- }
- else {
- result = getEmbeddedPartitioner().getPartitionType(region, offset);
- }
- return result;
- }
-
- /**
- * @see com.ibm.sed.structuredDocument.partition.StructuredTextPartitioner#getPartitionType(com.ibm.sed.structuredDocument.ITextRegion,
- * com.ibm.sed.structuredDocument.ITextRegion)
- */
- public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, ITextRegion previousStartTagNameRegion, IStructuredDocumentRegion nextNode, ITextRegion nextEndTagNameRegion) {
- return getEmbeddedPartitioner().getPartitionTypeBetween(previousNode, previousStartTagNameRegion, nextNode, nextEndTagNameRegion);
- }
-
- /**
- * @return
- */
- private String getPartitionTypeForDocumentLanguage() {
- String result;
- if (fLanguage == null || fLanguage.equalsIgnoreCase("java")) { //$NON-NLS-1$
- result = ST_JSP_CONTENT_JAVA;
- }
- else if (fLanguage.equalsIgnoreCase("javascript")) { //$NON-NLS-1$
- result = ST_JSP_CONTENT_JAVASCRIPT;
- }
- else {
- result = ST_JSP_SCRIPT + getLanguage().toUpperCase(Locale.ENGLISH);
- }
- return result;
- }
-
- protected void initLegalContentTypes() {
- List combinedTypes = getLocalLegalContentTypes();
- if (getEmbeddedPartitioner() != null) {
- String[] moreTypes = getEmbeddedPartitioner().getLegalContentTypes();
- for (int i = 0; i < moreTypes.length; i++)
- combinedTypes.add(moreTypes[i]);
- }
- fSupportedTypes = new String[0];
- combinedTypes.toArray(fSupportedTypes);
- }
-
- /**
- * @param sdRegion
- * @param offset
- * @return
- */
- private boolean isAction(IStructuredDocumentRegion sdRegion, int offset) {
- if (!sdRegion.getType().equals(XMLRegionContext.XML_TAG_NAME))
- return false;
- // shouldn't get a tag name region type unless a tag name region
- // exists
- // at [1]
- ITextRegion tagNameRegion = sdRegion.getRegions().get(1);
- String tagName = sdRegion.getText(tagNameRegion);
- // TODO: support custom JSP actions
- // the jsp: prefix is already loaded in the prefix listener
- // if (fJSPActionTagNames.contains(tagName))
- // return true;
- return fPrefixParseListener.startsWithCustomActionPrefix(tagName);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sed.structuredDocument.partition.StructuredTextPartitioner#getOverrideDocumentPartitionType(com.ibm.sed.structured.text.IStructuredDocumentRegion,
- * com.ibm.sed.structured.text.ITextRegion)
- */
- protected boolean isDocumentRegionBasedPartition(IStructuredDocumentRegion sdRegion, ITextRegion containedChildRegion, int offset) {
- String documentRegionContext = sdRegion.getType();
- if (containedChildRegion != null) {
- if (documentRegionContext.equals(XMLJSPRegionContexts.JSP_DIRECTIVE_NAME) || documentRegionContext.equals(XMLJSPRegionContexts.JSP_ROOT_TAG_NAME)) {
- setInternalPartition(offset, containedChildRegion.getLength(), ST_JSP_DIRECTIVE);
- return true;
- }
- if (fEnableJSPActionPartitions && isAction(sdRegion, offset)) {
- setInternalPartition(offset, containedChildRegion.getLength(), ST_JSP_DIRECTIVE);
- return true;
- }
- }
- return super.isDocumentRegionBasedPartition(sdRegion, containedChildRegion, offset);
- }
-
- /**
- * @param possibleJspJavaAction
- * @return
- */
- private boolean isJspJavaActionName(String possibleJspJavaAction) {
- return possibleJspJavaAction.equals(JSP11Namespace.ElementName.SCRIPTLET) || possibleJspJavaAction.equals(JSP11Namespace.ElementName.EXPRESSION) || possibleJspJavaAction.equals(JSP11Namespace.ElementName.DECLARATION);
- }
-
- private boolean isValidJspActionRegionType(String type) {
- // true for anything that can be within <jsp:scriptlet>,
- // <jsp:expression>, <jsp:declaration>
- return type == XMLRegionContext.XML_CONTENT || type == XMLRegionContext.BLOCK_TEXT || type == XMLRegionContext.XML_CDATA_OPEN || type == XMLRegionContext.XML_CDATA_TEXT || type == XMLRegionContext.XML_CDATA_CLOSE;
- }
-
- public IDocumentPartitioner newInstance() {
- StructuredTextPartitionerForJSP instance = new StructuredTextPartitionerForJSP();
- instance.setEmbeddedPartitioner(createStructuredTextPartitioner(structuredDocument));
- instance.setLanguage(fLanguage);
- return instance;
- }
-
- /**
- * Sets the embeddedPartitioner.
- *
- * @param embeddedPartitioner
- * The embeddedPartitioner to set
- */
- public void setEmbeddedPartitioner(IStructuredTextPartitioner embeddedPartitioner) {
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4909
- /**
- * manage connected state of embedded partitioner
- */
- if(fEmbeddedPartitioner != null && structuredDocument != null) {
- fEmbeddedPartitioner.disconnect();
- }
-
- this.fEmbeddedPartitioner = embeddedPartitioner;
-
- if(fEmbeddedPartitioner != null && structuredDocument != null) {
- fEmbeddedPartitioner.connect(structuredDocument);
- }
- }
-
- /**
- * @see com.ibm.sed.structuredDocument.partition.StructuredTextPartitioner#createPartition(int,
- * int, java.lang.String)
- */
- protected void setInternalPartition(int offset, int length, String type) {
- //TODO: need to carry this single instance idea further to be
- // complete,
- // but hopefully this will be less garbage than before (especially for
- // HTML, XML,
- // naturally!)
- internalReusedTempInstance = getEmbeddedPartitioner().createPartition(offset, length, type);
-
- }
-
- /**
- * Sets the language.
- *
- * @param language
- * The language to set
- */
- public void setLanguage(String language) {
- this.fLanguage = language;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/CommonXML.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/CommonXML.java
deleted file mode 100644
index 26b2068e39..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/CommonXML.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.util;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.w3c.dom.Document;
-
-public class CommonXML {
-
- public synchronized static DocumentBuilder getDocumentBuilder() {
- DocumentBuilder result = null;
- try {
- result = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- }
- catch (ParserConfigurationException e) {
- Logger.logException(e);
- }
- return result;
- }
-
- public synchronized static DocumentBuilder getDocumentBuilder(boolean validating) {
- DocumentBuilder result = null;
- try {
- DocumentBuilderFactory instance = DocumentBuilderFactory.newInstance();
- instance.setValidating(validating);
- result = instance.newDocumentBuilder();
- }
- catch (ParserConfigurationException e) {
- Logger.logException(e);
- }
- return result;
- }
-
- public static void serialize(Document document, OutputStream ostream) throws IOException {
- Source domSource = new DOMSource(document);
- try {
- Transformer serializer = TransformerFactory.newInstance().newTransformer();
- try {
- serializer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); //$NON-NLS-1$ //$NON-NLS-2$
- serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-16"); //$NON-NLS-1$
- }
- catch (IllegalArgumentException e) {
- // unsupported properties
- }
- serializer.transform(domSource, new StreamResult(ostream));
- }
- catch (TransformerConfigurationException e) {
- throw new IOException(e.getMessage());
- }
- catch (TransformerFactoryConfigurationError e) {
- throw new IOException(e.getMessage());
- }
- catch (TransformerException e) {
- throw new IOException(e.getMessage());
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java
deleted file mode 100644
index 1b0fbac125..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java
+++ /dev/null
@@ -1,492 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.util;
-
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.StringReader;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.StringTokenizer;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException;
-import org.eclipse.wst.sse.core.util.JarUtilities;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * An XML Creator/Reader/Writer that 1) Ignores any DocumentType Nodes found
- * within the document (as well as any entities) 2) Ignores any
- * errors/exceptions from Xerces when loading a document 3) Can load Documents
- * from within a .JAR file (***read-only***)
- */
-
-public class DocumentProvider {
- protected Document document = null;
- protected ErrorHandler errorHandler = null;
- private String fBaseReference;
- protected String fileName = null;
- protected boolean fValidating = true;
- protected InputStream inputStream = null;
- protected String jarFileName = null;
- protected EntityResolver resolver = null;
-
- protected Node rootElement = null;
- protected String rootElementName = null;
-
- public DocumentProvider() {
- }
-
- protected Document _getParsedDocumentDOM2() {
- Document result = null;
-
- InputStream is = null;
- try {
- DocumentBuilder builder = getDocumentBuilder();
- // DOMParser parser = new DOMParser();
- // parser.setFeature("http://apache.org/xml/features/continue-after-fatal-error",
- // false);//$NON-NLS-1$
- // parser.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar",
- // false);//$NON-NLS-1$
- // parser.setErrorHandler(getNullErrorHandler());
- // parser.setEntityResolver(getNullEntityResolver());
- // is = getInputStream();
- builder.setEntityResolver(getEntityResolver());
- builder.setErrorHandler(getNullErrorHandler());
- is = getInputStream();
- if (is != null)
- result = builder.parse(is, getBaseReference());
- }
- catch (SAXException e) {
- result = null;
- // parsing exception, notify the user?
- Logger.log(Logger.WARNING, "SAXException while reading descriptor: " + e); //$NON-NLS-1$
- }
- catch (FileNotFoundException e) {
- // NOT an "exceptional case"; do not Log
- }
- catch (IOException e) {
- Logger.log(Logger.WARNING, "IOException while reading descriptor" + e); //$NON-NLS-1$
- }
- finally {
- if (is != null) {
- try {
- is.close();
- }
- catch (Exception e) {
- // what can be done?
- }
- }
- }
- return result;
- }
-
- /**
- * @return
- */
- public String getBaseReference() {
- return fBaseReference;
- }
-
- /**
- *
- * @return Document
- */
- public Document getDocument() {
- if (document == null)
- load();
- return document;
- }
-
- protected DocumentBuilder getDocumentBuilder() {
- return CommonXML.getDocumentBuilder(isValidating());
- }
-
- protected DOMImplementation getDomImplementation() {
- DocumentBuilder builder = null;
- try {
- builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- }
- catch (ParserConfigurationException e1) {
- Logger.logException(e1);
- }
- catch (FactoryConfigurationError e1) {
- Logger.logException(e1);
- }
- DOMImplementation impl = builder.getDOMImplementation();
- return impl;
- }
-
- /*************************************************************************
- * Takes a single string of the form "a/b/c" and ensures that that
- * structure exists below the head element, down through 'c', and returns
- * a <em>single</em> element 'c'. For multiple elements (such as
- * multiple &lt;macro&gt; elements contained within a single
- * &lt;macros&gt; element, full DOM access is required for searching and
- * child element manipulation.
- ************************************************************************/
- public Element getElement(String name) {
- if (document == null)
- load();
- if (document != null)
- return (Element) getNode(getRootElement(), name);
- else
- return null;
- }
-
- /**
- * Returns an EntityResolver that won't try to load and resolve ANY
- * entities
- */
- private EntityResolver getEntityResolver() {
- if (resolver == null) {
- resolver = new EntityResolver() {
- public InputSource resolveEntity(String publicID, String systemID) throws SAXException, IOException {
- InputSource result = null;
- if (getBaseReference() != null) {
- try {
- URL spec = new URL("file://" + getBaseReference()); //$NON-NLS-1$
- URL url = new URL(spec, systemID);
- if (url.getProtocol().startsWith("file:")) { //$NON-NLS-1$
- URLConnection connection = url.openConnection();
- result = new InputSource(systemID != null ? systemID : "/_" + toString()); //$NON-NLS-1$
- result.setPublicId(publicID);
- result.setByteStream(connection.getInputStream());
- }
- }
- catch (Exception e) {
- result = null;
- }
- }
- if (result == null) {
- result = new InputSource(new StringReader("")); //$NON-NLS-1$
- result.setPublicId(publicID);
- result.setSystemId(systemID != null ? systemID : "/_" + getClass().getName()); //$NON-NLS-1$
- }
- return result;
- }
- };
- }
- return resolver;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getFileName() {
- return fileName;
- }
-
- /**
- * Returns and input stream to use as the source of the Document 1) from
- * an InputStream set on this instance 2) from a JAR file with the given
- * entry name 3) from a normal file
- *
- * @return InputStream
- */
- public InputStream getInputStream() throws FileNotFoundException {
- if (inputStream != null)
- return inputStream;
- else if (isJAR()) {
- return JarUtilities.getInputStream(getJarFileName(), getFileName());
- }
- else {
- return new FileInputStream(getFileName());
- }
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String getJarFileName() {
- return jarFileName;
- }
-
- protected Node getNamedChild(Node parent, String childName) {
- if (parent == null) {
- return null;
- }
- NodeList childList = parent.getChildNodes();
- for (int i = 0; i < childList.getLength(); i++) {
- if (childList.item(i).getNodeName().equals(childName))
- return childList.item(i);
- }
- return null;
- }
-
- protected Document getNewDocument() {
- Document result = null;
- try {
- result = getDomImplementation().createDocument("", getRootElementName(), null); //$NON-NLS-1$
- NodeList children = result.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- result.removeChild(children.item(i));
- }
- // we're going through this effort to avoid a NS element
- Element settings = result.createElement(getRootElementName());
- result.appendChild(settings);
- return result;
- }
- catch (DOMException e) {
- Logger.logException(e);
- }
- return null;
- }
-
- /*************************************************************************
- * Takes a single string of the form "a/b/c" and ensures that that
- * structure exists below the head element, down through 'c', and returns
- * the element 'c'.
- ************************************************************************/
- protected Node getNode(Node node, String name) {
- StringTokenizer tokenizer = new StringTokenizer(name, "/"); //$NON-NLS-1$
- String token = null;
- while (tokenizer.hasMoreTokens()) {
- token = tokenizer.nextToken();
- if (getNamedChild(node, token) == null)
- node.appendChild(document.createElement(token));
- node = getNamedChild(node, token);
- }
- return node;
- }
-
- /**
- * Returns an ErrorHandler that will not stop the parser on reported
- * errors
- */
- private ErrorHandler getNullErrorHandler() {
- if (errorHandler == null) {
- errorHandler = new ErrorHandler() {
- public void error(SAXParseException exception) throws SAXException {
- Logger.log(Logger.WARNING, "SAXParseException with " + getJarFileName() + "/" + getFileName() + " (error) while reading descriptor: " + exception.getMessage()); //$NON-NLS-1$
- }
-
- public void fatalError(SAXParseException exception) throws SAXException {
- Logger.log(Logger.WARNING, "SAXParseException with " + getJarFileName() + "/" + getFileName() + " (fatalError) while reading descriptor: " + exception.getMessage()); //$NON-NLS-1$
- }
-
- public void warning(SAXParseException exception) throws SAXException {
- Logger.log(Logger.WARNING, "SAXParseException with " + getJarFileName() + "/" + getFileName() + " (warning) while reading descriptor: " + exception.getMessage()); //$NON-NLS-1$
- }
- };
- }
- return errorHandler;
- }
-
- protected Document getParsedDocument() {
- Document result = null;
- if (inputStream == null) {
- File existenceTester = null;
- if (isJAR())
- existenceTester = new File(getJarFileName());
- else
- existenceTester = new File(getFileName());
- if (!existenceTester.exists())
- return null;
- }
-
- result = _getParsedDocumentDOM2();
-
- return result;
-
- }
-
- /**
- * Returns the root Element of the current document
- *
- * @return org.w3c.dom.Element
- */
- public Node getRootElement() {
- return getRootElement(getDocument());
- }
-
- /**
- * Returns the/a root Element for the current document
- *
- * @return org.w3c.dom.Element
- */
- protected Node getRootElement(Document doc) {
- if (doc == null)
- return null;
- if (doc.getDocumentElement() != null)
- return doc.getDocumentElement();
- try {
- Element newRootElement = doc.createElement(getRootElementName());
- doc.appendChild(newRootElement);
- return newRootElement;
- }
- catch (DOMException e) {
- Logger.logException(e);
- }
- return null;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public java.lang.String getRootElementName() {
- return rootElementName;
- }
-
- protected boolean isJAR() {
- return getJarFileName() != null;
- }
-
- /**
- * @return
- */
- public boolean isValidating() {
- return fValidating;
- }
-
- public void load() {
- // rootElementName and fileName are expected to be defined at this
- // point
- document = getParsedDocument();
- if (document != null) {
- if (rootElementName != null)
- rootElement = getRootElement(document);
- else
- rootElement = document.getDocumentElement();
- }
-
- if (document == null || rootElement == null) {
- document = getNewDocument();
- if (document != null) {
- NodeList children = document.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- if (children.item(i).getNodeType() == Node.ELEMENT_NODE && children.item(i).getNodeName().equals(getRootElementName()))
- rootElement = (Element) children.item(i);
- }
- if (rootElement == null) {
- for (int i = 0; i < children.getLength(); i++) {
- if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
- rootElement = (Element) children.item(i);
- break;
- }
- }
- }
- }
- }
- }
-
- protected void saveDocument(Document odocument, OutputStream stream) throws IOException {
- CommonXML.serialize(odocument, stream);
- }
-
- /**
- * @param string
- */
- public void setBaseReference(String string) {
- fBaseReference = string;
- }
-
- /**
- *
- * @param newFileName
- * java.lang.String
- */
- public void setFileName(java.lang.String newFileName) {
- fileName = newFileName;
- }
-
- /**
- * Sets the inputStream for which to provide a Document.
- *
- * @param inputStream
- * The inputStream to set
- */
- public void setInputStream(InputStream inputStream) {
- this.inputStream = inputStream;
- }
-
- /**
- *
- * @param newJarFileName
- * java.lang.String
- */
- public void setJarFileName(java.lang.String newJarFileName) {
- jarFileName = newJarFileName;
- }
-
- /**
- *
- * @param newRootElementName
- * java.lang.String
- */
- public void setRootElementName(java.lang.String newRootElementName) {
- rootElementName = newRootElementName;
- }
-
- /**
- * @param b
- */
- public void setValidating(boolean b) {
- fValidating = b;
- }
-
- public void store() {
- if (isJAR())
- return;
-
- if (rootElement == null) {
- document = getNewDocument();
- rootElement = document.getDocumentElement();
- }
-
- try {
- OutputStream ostream = new FileOutputStream(getFileName());
-
- storeDocument(document, ostream);
-
- ostream.flush();
- ostream.close();
- }
- catch (IOException e) {
- Logger.logException("Exception saving document " + getFileName(), e); //$NON-NLS-1$
- throw new SourceEditingRuntimeException(e);
- }
- }
-
- protected void storeDocument(Document odocument, OutputStream ostream) {
- try {
- saveDocument(odocument, ostream);
- }
- catch (IOException e) {
- Logger.logException(e);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/EmbeddedTypeStateData.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/EmbeddedTypeStateData.java
deleted file mode 100644
index e197116be4..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/EmbeddedTypeStateData.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.modelhandler;
-
-
-
-import org.eclipse.wst.sse.core.modelhandler.EmbeddedTypeHandler;
-
-/**
- * This class is only for remembering old and new embedded handlers,
- * in the event a re-init is needed.
- */
-public class EmbeddedTypeStateData {
-
-
- EmbeddedTypeHandler oldHandler;
- EmbeddedTypeHandler newHandler;
-
- public EmbeddedTypeStateData(EmbeddedTypeHandler oldHandler, EmbeddedTypeHandler newHandler) {
- this.oldHandler = oldHandler;
- this.newHandler = newHandler;
- }
-
- public EmbeddedTypeHandler getNewHandler() {
- return newHandler;
- }
-
- public EmbeddedTypeHandler getOldHandler() {
- return oldHandler;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/JSPModelLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/JSPModelLoader.java
deleted file mode 100644
index 0b30a09810..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/JSPModelLoader.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.modelhandler;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jst.jsp.core.PageDirectiveAdapter;
-import org.eclipse.jst.jsp.core.encoding.IJSPHeadContentDetector;
-import org.eclipse.jst.jsp.core.encoding.JSPDocumentHeadContentDetector;
-import org.eclipse.jst.jsp.core.encoding.JSPDocumentLoader;
-import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterFactory;
-import org.eclipse.jst.jsp.core.internal.document.PageDirectiveWatcherFactory;
-import org.eclipse.jst.jsp.core.internal.parser.JSPReParser;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP;
-import org.eclipse.jst.jsp.core.modelquery.ModelQueryAdapterFactoryForJSP;
-import org.eclipse.wst.html.core.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.core.document.XMLStyleModelImpl;
-import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.sse.core.AbstractModelLoader;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.ModelLoader;
-import org.eclipse.wst.sse.core.PropagatingAdapter;
-import org.eclipse.wst.sse.core.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.document.StructuredDocumentFactory;
-import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistry;
-import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistryImpl;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.sse.core.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.modelquery.ModelQueryAdapter;
-import org.eclipse.wst.sse.core.parser.JSPCapableParser;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.util.Assert;
-import org.eclipse.wst.sse.core.util.Debug;
-import org.eclipse.wst.xml.core.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.document.XMLDocument;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.eclipse.wst.xml.core.internal.DebugAdapterFactory;
-import org.eclipse.wst.xml.core.internal.propagate.PropagatingAdapterFactoryImpl;
-import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML;
-import org.w3c.dom.Document;
-
-public class JSPModelLoader extends AbstractModelLoader {
- protected final int MAX_BUFFERED_SIZE_FOR_RESET_MARK = 200000;
-
- /**
- * DMW - Note: I think the embeddedTypeRegistry in IModelManager can be
- * removed
- */
- private EmbeddedTypeRegistry embeddedContentTypeRegistry;
- private final static String DEFAULT_MIME_TYPE = "text/html"; //$NON-NLS-1$
- private final static String SPEC_DEFAULT_ENCODING = "ISO-8859-1"; //$NON-NLS-1$
- private final static String DEFAULT_LANGUAGE = "java"; //$NON-NLS-1$
-
- public JSPModelLoader() {
- super();
- }
-
- /**
- * Gets the embeddedContentTypeRegistry.
- *
- * @return Returns a EmbeddedContentTypeRegistry
- */
- private EmbeddedTypeRegistry getEmbeddedContentTypeRegistry() {
- if (embeddedContentTypeRegistry == null) {
- embeddedContentTypeRegistry = EmbeddedTypeRegistryImpl.getInstance();
- }
- return embeddedContentTypeRegistry;
- }
-
- public IStructuredModel newModel() {
- // future_TODO: this is similar to "hard coding"
- // that HTML will be in JSP file ... should make more
- // flexible in future.
- XMLStyleModelImpl model = new XMLStyleModelImpl();
- return model;
- }
-
- /**
- * Specification cites ISO-8859-1/Latin-1 as the default charset.
- */
- protected String getDefaultEncoding() {
- return SPEC_DEFAULT_ENCODING;
- }
-
- /**
- * For JSP files, text/html is the default content type. This may want
- * this different for types like jsv (jsp for voice xml) For now, hard
- * code to new instance. In future, should get instance from registry.
- *
- * Specification cites HTML as the default contentType.
- */
- private EmbeddedTypeHandler getJSPDefaultEmbeddedType() {
- EmbeddedTypeRegistry reg = getEmbeddedContentTypeRegistry();
- return reg.getTypeFor(getDefaultMimeType());
- }
-
- /**
- * Method getDefaultMimeType.
- *
- * @return String
- */
- private String getDefaultMimeType() {
- return DEFAULT_MIME_TYPE;
- }
-
- /**
- * This method should retrieve the model from the file system (or what
- * ever the loader is prepared to do). If the resource can not be found
- * (and therefore a model can not be created), then it should return null.
- */
- // public void load(Reader reader, IStructuredModel model, EncodingRule
- // encodingRule) throws java.io.IOException {
- // initializeEmbeddedTypeFromStream(reader, model);
- // setLanguageInPageDirective(model);
- // super.load(reader, model, encodingRule);
- // }
- /**
- * This method must return a new instance of IStructuredDocument, that has
- * been initialized with appropriate parser. For many loaders, the
- * (default) parser used is known for any input. For others, the correct
- * parser (and its initialization) is normall dependent on the content of
- * the file. This no-argument method should assume "empty input" and would
- * therefore return the default parser for the default contentType.
- *
- * If the parser is to handle tag libraries, it must have a TaglibSupport
- * object with a valid URIResolver and this IStructuredDocument attached
- * to it before the contents are set on the IStructuredDocument.
- */
- public IStructuredDocument newStructuredDocument() {
- IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
- ((BasicStructuredDocument) structuredDocument).setReParser(new JSPReParser());
- // structuredDocument.setDocumentPartitioner(new
- // JSPJavaDocumentPartioner());
- // even though this is an "empty model" ... we want it to have at
- // least the
- // default embeddeded content type handler
- EmbeddedTypeHandler embeddedType = getJSPDefaultEmbeddedType();
- embeddedType.initializeParser((JSPCapableParser) structuredDocument.getParser());
- return structuredDocument;
- }
-
- public RegionParser getParser() {
- // remember, the Loader
- // will need to finish initialization of parser
- // based on "embedded content"
- return new JSPSourceParser();
- }
-
- protected void preLoadAdapt(IStructuredModel structuredModel) {
- super.preLoadAdapt(structuredModel);
- XMLModel domModel = (XMLModel) structuredModel;
- //
- // document must have already been set for this to
- // work.
- Document document = domModel.getDocument();
- Assert.isNotNull(document);
- // if there is a model in the adapter, this will adapt it to
- // first node. After that the PropagatingAdater spreads over the
- // children being
- // created. Each time that happends, a side effect is to
- // also "spread" sprecific registered adapters,
- // they two can propigate is needed.
- // This 'get' causes first to be be attached.
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
- // may make this easier to use in futue
- propagatingAdapter.addAdaptOnCreateFactory(new PageDirectiveWatcherFactory());
- if (Debug.debugNotificationAndEvents) {
- propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory());
- }
- // For JSPs, the ModelQueryAdapter must be "attached" to the document
- // before content is set in the model, so taglib initization can
- // take place.
- ((INodeNotifier) document).getAdapterFor(ModelQueryAdapter.class);
- //
-
- }
-
- /**
- * This method must return those factories which must be attached to the
- * structuredModel before content is applied.
- */
- public List getAdapterFactories() {
- List result = new ArrayList();
- AdapterFactory factory = null;
- //
- factory = new ModelQueryAdapterFactoryForJSP();
- result.add(factory);
- factory = new PropagatingAdapterFactoryImpl();
- result.add(factory);
- factory = new PageDirectiveAdapterFactory();
- result.add(factory);
-
-
-
- return result;
- }
-
- /**
- * @see com.ibm.sed.model.AbstractDumper#getDocumentEncodingDetector()
- */
- public IJSPHeadContentDetector getHeadParser() {
- return new JSPDocumentHeadContentDetector();
- }
-
- /**
- * This init method is for the case where we are getting the embedded type
- * from the input stream specifically.
- */
- // private void initializeEmbeddedTypeFromStream(Reader reader,
- // IStructuredModel model) throws IOException {
- // IFile file = ResourceUtil.getFileFor(model);
- // JSPDocumentLoader jspDocumentLoader =(JSPDocumentLoader)
- // getDocumentLoader();
- // EmbeddedTypeHandler inputEmbeddedContentType =
- // jspDocumentLoader.getEmbeddedType(file);
- // EmbeddedTypeHandler existingEmbeddedType = getEmbeddedType(model);
- // // we don't expect the existing type to be null, but if it is, then
- // // this is a simply init case, not re-init
- // if (existingEmbeddedType == null) {
- // initializeEmbeddedType(model, inputEmbeddedContentType);
- // }
- // else {
- // if (existingEmbeddedType != inputEmbeddedContentType) {
- // // only need to reinitialize if truely different
- // reInitializeEmbeddedType(model, existingEmbeddedType,
- // inputEmbeddedContentType);
- // }
- // }
- // }
- /**
- * This init method is for the case where we are creating an empty model,
- * which we always do.
- */
- private void initializeEmbeddedTypeFromDefault(IStructuredModel model) {
- EmbeddedTypeHandler embeddedContentType = getJSPDefaultEmbeddedType();
- initializeEmbeddedType(model, embeddedContentType);
- }
-
- /**
- * This is "initialize" since is always assumes it hasn't been initalized
- * yet.
- */
- private void initializeEmbeddedType(IStructuredModel model, EmbeddedTypeHandler embeddedContentType) {
- // check program logic
- Assert.isNotNull(embeddedContentType, "Program error: invalid call during model initialization"); //$NON-NLS-1$
- // once we know the embedded content type, we need to set it in the
- // PageDirectiveAdapter ... the order of initialization is
- // critical here, the doc must have been created, but its contents not
- // set yet,
- // and all factories must have been set up also.
- XMLModel domModel = (XMLModel) model;
- XMLDocument document = domModel.getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getAdapterFor(PageDirectiveAdapter.class);
- pageDirectiveAdapter.setEmbeddedType(embeddedContentType);
- embeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- embeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
- // adding language here, in this convienent central
- // location, but some obvious renaming or refactoring
- // wouldn't hurt, in future.
- // I needed to add this language setting for JSP Fragment support
- // Note: I don't think this attempted init counts for much.
- // I think its always executed when model is very first
- // being initialized, and doesn't even have content
- // or an ID yet. I thought I'd leave, since it wouldn't
- // hurt, in case its called in other circumstances.
- // String language = getLanguage(model);
- // pageDirectiveAdapter.setLanguage(language);
- }
-
- /**
- * Method getLanguage.
- *
- * @param model
- * @return String
- */
- private String getLanguage(IStructuredModel model) {
- String result = null;
- // first check the model (document itself) to see if contains
- result = getLanguageFromStructuredDocument(model.getStructuredDocument());
- // Note: if model contains an unsupported
- // language, we'll even return it,
- // since who knows what future holds.
-
- // always return something
- if (result == null) {
- result = DEFAULT_LANGUAGE;
- }
- return result;
- }
-
- /**
- * Method getLanguageFromStructuredDocument.
- *
- * @param structuredDocument
- * @return String
- */
- private String getLanguageFromStructuredDocument(IStructuredDocument structuredDocument) {
- if (structuredDocument == null)
- return null;
- String result = null;
- // bascially same algorithm as get encoding or
- // get content type from structuredDocument.
- IJSPHeadContentDetector localHeadParser = getHeadParser();
- // we can be assured that its already been
- // parsed. If not call parseHeaderForPageDirective()
- // before calling getLanguage;
- localHeadParser.set(structuredDocument);
- try {
- result = localHeadParser.getLanguage();
- } catch (IOException e) {
- // impossible
- // TODO need to reconsider design to avoid
- throw new Error(e);
- }
- return result;
- }
-
- /**
- * This is "reinitialize" since there should always be at least the
- * default one assigned, before we start checking the stream
- */
- private void reInitializeEmbeddedType(IStructuredModel model, EmbeddedTypeHandler oldEmbeddedContentType, EmbeddedTypeHandler newEmbeddedContentType) {
- // check program logic
- Assert.isNotNull(oldEmbeddedContentType, "Program error: invalid call during model initialization"); //$NON-NLS-1$
- // once we know the embedded content type, we need to set it in the
- // PageDirectiveAdapter ... the order of initialization is
- // critical here, the doc must have been created, but its contents not
- // set yet,
- // and all factories must have been set up also.
- XMLModel domModel = (XMLModel) model;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- XMLDocument document = domModel.getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getExistingAdapter(PageDirectiveAdapter.class);
- // ==> // PropagatingAdapter propagatingAdapter = (PropagatingAdapter)
- // ((INodeNotifier)
- // document).getExistingAdapter(PropagatingAdapter.class);
- // ==> // ModelQueryAdapter modelQueryAdapter = (ModelQueryAdapter)
- // ((INodeNotifier)
- // document).getExistingAdapter(ModelQueryAdapter.class);
- oldEmbeddedContentType.uninitializeFactoryRegistry(model.getFactoryRegistry());
- oldEmbeddedContentType.uninitializeParser((JSPCapableParser) structuredDocument.getParser());
- // since 'document' is not recreated in this
- // reinit path, we need to remove all adapters,
- // except for the propagated adapters (including page
- // directive adapter, and model query adapter).
- // to accomplish this, we'll just remove all, then
- // add back with a call to pre-load adapt.
- // let clients decide to unload adapters from document
- // Collection oldAdapters = document.getAdapters();
- // Iterator oldAdaptersIterator = oldAdapters.iterator();
- // while (oldAdaptersIterator.hasNext()) {
- // INodeAdapter oldAdapter = (INodeAdapter)
- // oldAdaptersIterator.next();
- // if (oldAdapter != pageDirectiveAdapter && oldAdapter !=
- // propagatingAdapter && oldAdapter != modelQueryAdapter) {
- // // DO NOT remove directly!
- // // can change contents while in notifity loop!
- // //oldAdaptersIterator.remove();
- // document.removeAdapter(oldAdapter);
- // }
- // }
- // DMW: I believe something like the following is needed,
- // since releases cached adapters
- // if (document instanceof DocumentImpl) {
- // ((DocumentImpl) document).releaseDocumentType();
- // ((DocumentImpl) document).releaseStyleSheets();
- // }
- // remember, embedded type factories are automatically cleared when
- // embededType changed
- pageDirectiveAdapter.setEmbeddedType(newEmbeddedContentType);
- // // but still need to clear the page directive watchers, and let
- // them be rediscovered (with new, accurate node as target)
- // pageDirectiveAdapter.clearPageWatchers();
- if (newEmbeddedContentType != null) {
- newEmbeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
- newEmbeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
-
- // partitioner setup is the responsibility of this loader
- IDocumentPartitioner documentPartitioner = structuredDocument.getDocumentPartitioner();
- // ISSUE: this logic is flawed, not sure of original intent, but
- // added null/type checks for safety.
- if (documentPartitioner != null && documentPartitioner instanceof StructuredTextPartitionerForJSP) {
- if (newEmbeddedContentType.getFamilyId().equals(ContentTypeIdForXML.ContentTypeID_XML)) {
- ((StructuredTextPartitionerForJSP) documentPartitioner).setEmbeddedPartitioner(new StructuredTextPartitionerForXML());
- } else if (newEmbeddedContentType.getFamilyId().equals(ContentTypeIdForHTML.ContentTypeID_HTML)) {
- ((StructuredTextPartitionerForJSP) documentPartitioner).setEmbeddedPartitioner(new StructuredTextPartitionerForHTML());
- }
- }
- }
- // adding language here, in this convienent central
- // location, but some obvious renaming or refactoring
- // wouldn't hurt, in future.
- // I needed to add this language setting for JSP Fragment support
- // Note: this is the one that counts, since at this point,
- // the model has an ID, so we can look up IFile, etc.
- String language = getLanguage(model);
- if (language != null && language.length() > 0) {
- pageDirectiveAdapter.setLanguage(language);
- }
- }
-
- /**
- * This is "reinitialize" since there should always be at least the
- * default one assigned, before we start checking the stream
- */
- private void initCloneOfEmbeddedType(IStructuredModel model, EmbeddedTypeHandler oldEmbeddedContentType, EmbeddedTypeHandler newEmbeddedContentType) {
- // check program logic
- Assert.isNotNull(oldEmbeddedContentType, "Program error: invalid call during model initialization"); //$NON-NLS-1$
- // once we know the embedded content type, we need to set it in the
- // PageDirectiveAdapter ... the order of initialization is
- // critical here, the doc must have been created, but its contents not
- // set yet,
- // and all factories must have been set up also.
- XMLModel domModel = (XMLModel) model;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- XMLDocument document = domModel.getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getAdapterFor(PageDirectiveAdapter.class);
- // ==> // PropagatingAdapter propagatingAdapter = (PropagatingAdapter)
- // ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
- // ==> // ModelQueryAdapter modelQueryAdapter = (ModelQueryAdapter)
- // ((INodeNotifier) document).getAdapterFor(ModelQueryAdapter.class);
- // because, even in the clone case, the model has been paritally
- // intialized with
- // the old embedded type (during createModel), we need to unitialize
- // parts of it, based on the old (or default) ones
- oldEmbeddedContentType.uninitializeFactoryRegistry(model.getFactoryRegistry());
- oldEmbeddedContentType.uninitializeParser((JSPCapableParser) structuredDocument.getParser());
- // remember, embedded type factories are automatically cleared when
- // embededType changed
- pageDirectiveAdapter.setEmbeddedType(newEmbeddedContentType);
- if (newEmbeddedContentType != null) {
- newEmbeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
- newEmbeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
- }
- // adding language here, in this convienent central
- // location, but some obvious renaming or refactoring
- // wouldn't hurt, in future.
- // I needed to add this language setting for JSP Fragment support
- // Note: this is the one that counts, since at this point,
- // the model has an ID, so we can look up IFile, etc.
- String language = getLanguage(model);
- if (language != null && language.length() > 0) {
- pageDirectiveAdapter.setLanguage(language);
- }
- }
-
- private EmbeddedTypeHandler getEmbeddedType(IStructuredModel model) {
- Document doc = ((XMLModel) model).getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) ((INodeNotifier) doc).getAdapterFor(PageDirectiveAdapter.class);
- EmbeddedTypeHandler embeddedHandler = pageDirectiveAdapter.getEmbeddedType();
- return embeddedHandler;
- }
-
- /**
- * Method initEmbeddedType.
- */
- protected void initEmbeddedType(IStructuredModel model) {
- initializeEmbeddedTypeFromDefault(model);
- }
-
- /**
- * Method initEmbeddedType.
- */
- protected void initEmbeddedType(IStructuredModel oldModel, IStructuredModel newModel) {
- EmbeddedTypeHandler existingEmbeddedType = getEmbeddedType(oldModel);
- EmbeddedTypeHandler newEmbeddedContentType = existingEmbeddedType.newInstance();
- if (existingEmbeddedType == null) {
- initEmbeddedType(newModel);
- } else {
- // initEmbeddedType(newModel);
- initCloneOfEmbeddedType(newModel, existingEmbeddedType, newEmbeddedContentType);
- }
- setLanguageInPageDirective(newModel);
- }
-
- protected void setLanguageInPageDirective(IStructuredModel newModel) {
- if (newModel instanceof XMLModel) {
- XMLDocument document = ((XMLModel) newModel).getDocument();
- PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) document.getAdapterFor(PageDirectiveAdapter.class);
- String language = getLanguage(newModel);
- pageDirectiveAdapter.setLanguage(language);
- }
- }
-
- public IStructuredModel reinitialize(IStructuredModel model) {
- EmbeddedTypeHandler oldHandler = null;
- EmbeddedTypeHandler newHandler = null;
- Object reinitStateData = model.getReinitializeStateData();
- if (reinitStateData instanceof EmbeddedTypeStateData) {
- EmbeddedTypeStateData oldStateData = (EmbeddedTypeStateData) reinitStateData;
- oldHandler = oldStateData.getOldHandler();
- newHandler = oldStateData.getNewHandler();
- // note. We should already have the new handler in the model's
- // (documents) adapters,
- // so need need to use the old one to undo the old state data
- reInitializeEmbeddedType(model, oldHandler, newHandler);
- } else {
- // for language ... we someday MIGHT have to do something
- // here, but for now, we don't have any model-side language
- // sensitive adapters.
- }
- return super.reinitialize(model);
- }
-
- public ModelLoader newInstance() {
- return new JSPModelLoader();
- }
-
- public IDocumentLoader getDocumentLoader() {
- if (documentLoaderInstance == null) {
- documentLoaderInstance = new JSPDocumentLoader();
- }
- return documentLoaderInstance;
- }
-
- /**
- * Ensures that an InputStream has mark/reset support.
- */
- public static InputStream getMarkSupportedStream(InputStream original) {
- if (original == null)
- return null;
- if (original.markSupported())
- return original;
- return new BufferedInputStream(original);
- }
-
- protected byte[] getBytes(InputStream inputStream, int max) throws IOException {
- byte[] smallBuffer = new byte[max];
- byte[] returnBuffer = null;
- int nRead = inputStream.read(smallBuffer, 0, max);
- if (nRead < max) {
- // empty file will return -1;
- if (nRead < 0)
- nRead = 0;
- byte[] smallerBuffer = new byte[nRead];
- System.arraycopy(smallBuffer, 0, smallerBuffer, 0, nRead);
- returnBuffer = smallerBuffer;
- } else {
- returnBuffer = smallBuffer;
- }
- return returnBuffer;
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/ModelHandlerForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/ModelHandlerForJSP.java
deleted file mode 100644
index 5511d05ad5..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/ModelHandlerForJSP.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.modelhandler;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jst.jsp.core.encoding.JSPDocumentHeadContentDetector;
-import org.eclipse.jst.jsp.core.encoding.JSPDocumentLoader;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.internal.document.DocumentLoaderForJSP;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-import org.eclipse.wst.sse.core.ModelLoader;
-import org.eclipse.wst.sse.core.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.modelhandler.AbstractModelHandler;
-import org.eclipse.wst.sse.core.parser.BlockMarker;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-
-public class ModelHandlerForJSP extends AbstractModelHandler {
-
- /**
- * Needs to match what's in plugin registry. In fact, can be overwritten
- * at run time with what's in registry! (so should never be 'final')
- */
- static String AssociatedContentTypeID = "org.eclipse.jst.jsp.core.jspsource"; //$NON-NLS-1$
- /**
- * Needs to match what's in plugin registry. In fact, can be overwritten
- * at run time with what's in registry! (so should never be 'final')
- */
- private static String ModelHandlerID = "org.eclipse.jst.jsp.core.modelhandler"; //$NON-NLS-1$
-
-
- public ModelHandlerForJSP() {
- super();
- setId(ModelHandlerID);
- setAssociatedContentTypeId(AssociatedContentTypeID);
- }
-
- // private static final String PageDesigner =
- // "com.ibm.etools.webedit.page.PageDesigner"; //$NON-NLS-1$
- // private static final String HTMLEditor =
- // "com.ibm.etools.webedit.editor.HTMLEditor"; //$NON-NLS-1$
-
- protected void addJSPTagName(JSPSourceParser parser, String tagname) {
- BlockMarker bm = new BlockMarker(tagname, null, XMLJSPRegionContexts.JSP_CONTENT, true);
- parser.addBlockMarker(bm);
- }
-
- public ModelLoader getModelLoader() {
- return new JSPModelLoader();
- }
-
- public Preferences getPreferences() {
- return JSPCorePlugin.getDefault().getPluginPreferences();
- }
-
- public IDocumentCharsetDetector getEncodingDetector() {
- return new JSPDocumentHeadContentDetector();
- }
-
- public IDocumentLoader getDocumentLoader() {
- if (USE_FILE_BUFFERS)
- return new DocumentLoaderForJSP();
- else
- return new JSPDocumentLoader();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAdapterImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAdapterImpl.java
deleted file mode 100644
index d6a669fc1f..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAdapterImpl.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.modelquery;
-
-
-
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.common.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.sse.core.modelquery.ModelQueryAdapterImpl;
-import org.eclipse.wst.xml.uriresolver.util.IdResolver;
-
-
-public class JSPModelQueryAdapterImpl extends ModelQueryAdapterImpl {
- public JSPModelQueryAdapterImpl(CMDocumentCache cmDocumentCache, ModelQuery modelQuery, IdResolver idResolver) {
- super(cmDocumentCache, modelQuery, idResolver);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAssociationProvider.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAssociationProvider.java
deleted file mode 100644
index d91bc64513..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAssociationProvider.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.modelquery;
-
-import org.eclipse.wst.common.contentmodel.modelqueryimpl.SimpleAssociationProvider;
-
-/**
- */
-public class JSPModelQueryAssociationProvider extends SimpleAssociationProvider {
-
- /**
- * @param modelQueryCMProvider
- * org.eclipse.wst.common.contentmodel.modelquery.ModelQueryCMProvider
- */
- public JSPModelQueryAssociationProvider() {
- super(new JSPModelQueryCMProvider());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryCMProvider.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryCMProvider.java
deleted file mode 100644
index 842c09b15b..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryCMProvider.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.modelquery;
-
-
-
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.internal.contentmodel.JSPCMDocumentFactory;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQueryCMProvider;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.w3c.dom.Node;
-
-/**
- * CMDocument provider for HTML and JSP documents.
- */
-public class JSPModelQueryCMProvider implements ModelQueryCMProvider {
-
- protected JSPModelQueryCMProvider() {
- super();
- }
-
- /**
- * Returns the CMDocument that corresponds to the DOM Node. or null if no
- * CMDocument is appropriate for the DOM Node.
- */
- public CMDocument getCorrespondingCMDocument(Node node) {
- CMDocument jcmdoc = JSPCMDocumentFactory.getCMDocument();
-
- CMDocument result = null;
- try {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- String elementName = node.getNodeName();
-
- // test to see if this node belongs to JSP's CMDocument (case
- // sensitive)
- CMElementDeclaration dec = (CMElementDeclaration) jcmdoc.getElements().getNamedItem(elementName);
- if (dec != null) {
- result = jcmdoc;
- }
- }
-
- String prefix = node.getPrefix();
-
- if (result == null && prefix != null && prefix.length() > 0 && node instanceof XMLNode) {
- // check position dependent
- XMLNode xmlNode = (XMLNode) node;
- TLDCMDocumentManager tldmgr = TaglibController.getTLDCMDocumentManager(xmlNode.getStructuredDocument());
- if (tldmgr != null) {
- List documents = tldmgr.getCMDocumentTrackers(node.getPrefix(), xmlNode.getStartOffset());
- // there shouldn't be more than one cmdocument returned
- if (documents != null && documents.size() > 0)
- result = (CMDocument) documents.get(0);
- }
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- return result;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryImpl.java
deleted file mode 100644
index 2e92555ec0..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryImpl.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.modelquery;
-
-
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.PageDirectiveAdapter;
-import org.eclipse.wst.common.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.common.contentmodel.modelqueryimpl.ModelQueryImpl;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.modelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.uriresolver.util.IdResolver;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class JSPModelQueryImpl extends ModelQueryImpl {
-
- protected IStructuredModel jspModel = null;
- protected ModelQuery embeddedModelQuery = null;
- public JSPModelQueryImpl(IStructuredModel model, IdResolver resolver) {
- super(new JSPModelQueryAssociationProvider());
- jspModel = model;
- }
-
- /*
- * @see ModelQuery#getCMElementDeclaration(Element)
- */
- public CMElementDeclaration getCMElementDeclaration(Element element) {
- CMElementDeclaration result = super.getCMElementDeclaration(element);
- if (result == null) {
- ModelQuery query = getEmbeddedModelQuery(element);
- if (query != null) {
- result = query.getCMElementDeclaration(element);
- }
- }
- return result;
- }
-
- /*
- * @see ModelQuery#getCorrespondingCMDocument(Node)
- */
- public CMDocument getCorrespondingCMDocument(Node node) {
- CMDocument doc = super.getCorrespondingCMDocument(node);
- if (doc == null) {
- ModelQuery query = getEmbeddedModelQuery(node);
- if (query != null) {
- doc = query.getCorrespondingCMDocument(node);
- }
- }
- return doc;
- }
-
- /*
- * @see ModelQuery#getCMNode(Node)
- */
- public CMNode getCMNode(Node node) {
- CMNode result = super.getCMNode(node);
- if (result == null) {
- ModelQuery query = getEmbeddedModelQuery(node);
- if (query != null) {
- result = query.getCMNode(node);
- }
- }
- return result;
- }
-
- public List getAvailableContent(Element element, CMElementDeclaration ed, int includeOptions) {
- ModelQuery emq = getEmbeddedModelQuery(element);
- if (emq != null)
- return emq.getAvailableContent(element, ed, includeOptions);
- else
- return super.getAvailableContent(element, ed, includeOptions);
- }
-
- protected ModelQuery getEmbeddedModelQuery(Node node) {
- if (this.embeddedModelQuery == null && node instanceof INodeNotifier) {
- Node ownerNode = node.getOwnerDocument();
- if (ownerNode == null) {
- // then must be the document itself
- ownerNode = node;
- }
- PageDirectiveAdapter typeadapter = (PageDirectiveAdapter) ((INodeNotifier) ownerNode).getAdapterFor(PageDirectiveAdapter.class);
- if (typeadapter != null) {
- ModelQueryAdapter embeddedAdapter = (ModelQueryAdapter) typeadapter.adapt((INodeNotifier) node, ModelQueryAdapter.class);
- if (embeddedAdapter != null)
- this.embeddedModelQuery = embeddedAdapter.getModelQuery();
- }
- }
- return this.embeddedModelQuery;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.contentmodel.modelquery.ModelQuery#getCMAttributeDeclaration(org.w3c.dom.Attr)
- */
- public CMAttributeDeclaration getCMAttributeDeclaration(Attr attr) {
- CMAttributeDeclaration result = super.getCMAttributeDeclaration(attr);
- if (result == null) {
- ModelQuery query = getEmbeddedModelQuery(attr);
- if (query != null) {
- result = query.getCMAttributeDeclaration(attr);
- }
- }
- return result;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/ModelQueryAdapterFactoryForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/ModelQueryAdapterFactoryForJSP.java
deleted file mode 100644
index 5d78fcd149..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/ModelQueryAdapterFactoryForJSP.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.modelquery;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.common.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.sse.core.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.IModelStateListener;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.modelquery.ModelQueryAdapter;
-import org.eclipse.wst.sse.core.util.Debug;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.modelquery.XMLCatalogIdResolver;
-import org.eclipse.wst.xml.uriresolver.util.IdResolver;
-
-public class ModelQueryAdapterFactoryForJSP extends AbstractAdapterFactory implements IModelStateListener {
-
- protected JSPModelQueryAdapterImpl modelQueryAdapterImpl;
-
- protected IStructuredModel stateNotifier = null;
-
- public ModelQueryAdapterFactoryForJSP() {
- this(ModelQueryAdapter.class, true);
- }
-
- /**
- * ModelQueryAdapterFactoryForJSP constructor comment.
- *
- * @param adapterKey
- * java.lang.Object
- * @param registerAdapters
- * boolean
- */
- public ModelQueryAdapterFactoryForJSP(Object key, boolean registerAdapters) {
- super(key, registerAdapters);
- }
-
- public AdapterFactory copy() {
- return new ModelQueryAdapterFactoryForJSP(this.adapterKey, this.shouldRegisterAdapter);
- }
-
- /**
- * createAdapter method comment.
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
-
- if (Debug.displayInfo)
- System.out.println("-----------------------ModelQueryAdapterFactoryForJSP.createAdapter" + target); //$NON-NLS-1$
- if (modelQueryAdapterImpl == null) {
- if (target instanceof XMLNode) {
- XMLNode xmlNode = (XMLNode) target;
- IStructuredModel model = stateNotifier = xmlNode.getModel();
- String baseLocation = model.getBaseLocation();
- // continue only if the location is known
- if(baseLocation != null) {
- stateNotifier.addModelStateListener(this);
- CMDocumentCache cmDocumentCache = new CMDocumentCache();
- File file = new Path(model.getBaseLocation()).toFile();
- if(file.exists()) {
- baseLocation = file.getAbsolutePath();
- }
- else {
- baseLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(model.getBaseLocation()).toString();
- }
- IdResolver resolver = new XMLCatalogIdResolver(baseLocation, model.getResolver());
-
- ModelQuery modelQuery = new JSPModelQueryImpl(model, resolver);
- modelQuery.setEditMode(ModelQuery.EDIT_MODE_UNCONSTRAINED);
- modelQueryAdapterImpl = new JSPModelQueryAdapterImpl(cmDocumentCache, modelQuery, resolver);
- }
- }
- }
- return modelQueryAdapterImpl;
- }
-
- /**
- * @see IModelStateListener#modelAboutToBeChanged(IStructuredModel)
- */
- public void modelAboutToBeChanged(IStructuredModel model) {
- }
-
- /**
- * @see IModelStateListener#modelChanged(IStructuredModel)
- */
- public void modelChanged(IStructuredModel model) {
- }
-
- /**
- * @see IModelStateListener#modelDirtyStateChanged(IStructuredModel,
- * boolean)
- */
- public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
- }
-
- /**
- * @see IModelStateListener#modelResourceDeleted(IStructuredModel)
- */
- public void modelResourceDeleted(IStructuredModel model) {
- }
-
- /**
- * @see IModelStateListener#modelResourceMoved(IStructuredModel,
- * IStructuredModel)
- */
- public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
- // if oldModel != newModel, bad things might happen with the adapter
- stateNotifier.removeModelStateListener(this);
- stateNotifier = newModel;
- updateResolver(stateNotifier);
- stateNotifier.addModelStateListener(this);
- }
-
-
- public void release() {
- super.release();
- if (stateNotifier != null) {
- stateNotifier.removeModelStateListener(this);
- }
- stateNotifier = null;
- if (modelQueryAdapterImpl != null) {
- modelQueryAdapterImpl.release();
- }
- }
-
- protected void updateResolver(IStructuredModel model) {
- String baseLocation = model.getBaseLocation();
- IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
- if (baseFile != null) {
- baseLocation = baseFile.getLocation().toString();
- }
- modelQueryAdapterImpl.setIdResolver(new XMLCatalogIdResolver(baseLocation, model.getResolver()));
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/.classpath b/bundles/org.eclipse.wst.css.core/.classpath
deleted file mode 100644
index 275b34c699..0000000000
--- a/bundles/org.eclipse.wst.css.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.css.core/.cvsignore b/bundles/org.eclipse.wst.css.core/.cvsignore
deleted file mode 100644
index 0e7c86bf57..0000000000
--- a/bundles/org.eclipse.wst.css.core/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-temp.folder
-cssmodel.jar
-build.xml
-dev.properties
diff --git a/bundles/org.eclipse.wst.css.core/.options b/bundles/org.eclipse.wst.css.core/.options
deleted file mode 100644
index 490975b210..0000000000
--- a/bundles/org.eclipse.wst.css.core/.options
+++ /dev/null
@@ -1,2 +0,0 @@
-org.eclipse.wst.css.core/debug=true
-org.eclipse.wst.css.core/debug/tracefilter= \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/.project b/bundles/org.eclipse.wst.css.core/.project
deleted file mode 100644
index bb046e9d84..0000000000
--- a/bundles/org.eclipse.wst.css.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.css.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 700d744764..0000000000
--- a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,48 +0,0 @@
-#Wed Jan 12 13:24:26 EST 2005
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-eclipse.preferences.version=1
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.incompleteClasspath=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
diff --git a/bundles/org.eclipse.wst.css.core/build.properties b/bundles/org.eclipse.wst.css.core/build.properties
deleted file mode 100644
index 78aa1c4e21..0000000000
--- a/bundles/org.eclipse.wst.css.core/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = plugin.xml,\
- *.jar,\
- css.jar,\
- cssprofile/,\
- .options,\
- plugin.properties
-source.cssmodel.jar = src/
-src.includes = plugin.xml,\
- cssprofile/,\
- build.xml,\
- .options,\
- plugin.properties
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd b/bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd
deleted file mode 100644
index 35535a837c..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd
+++ /dev/null
@@ -1,132 +0,0 @@
-<!-- DTD for CSS Meta Model Profile -->
-
-<!-- Entities -->
-
-<!-- name-definition : In defining meta model object, object name -->
-<!-- is given by using this attribute. -->
-
-<!ENTITY % name-definition 'name CDATA #REQUIRED' >
-
-<!-- name-reference : used to refer meta model object that defined -->
-<!-- by name-definition -->
-
-<!ENTITY % name-reference 'name CDATA #REQUIRED' >
-
-<!-- availability : CSS Meta Model Profile permit importing -->
-<!-- other profile and describe difference for it. -->
-
-<!ENTITY % availability 'enabled (true | false) "true"' >
-<!ENTITY % overwrite 'overwrite (true | false) "false"' >
-
-<!-- ******************** -->
-<!-- elments/attributes -->
-<!-- ******************** -->
-
-<!ELEMENT css-profile (profile-import? , (stylesheet-def | charset-rule-def | import-rule-def | page-rule-def | media-rule-def | fontface-rule-def | style-rule-def | property-def | descriptor-def | container-def | function-def | number-def | unit-def | keyword-def | category-def | pseudo-element-def | pseudo-class-def)*) >
-
-<!-- a profile can include other profile -->
-
-<!ELEMENT profile-import EMPTY >
-<!ATTLIST profile-import name CDATA #REQUIRED >
-
-<!-- which type of rule can be used? -->
-
-<!ELEMENT stylesheet-def (description? , (charset-rule | import-rule | page-rule | media-rule | fontface-rule | style-rule)*) >
-<!ATTLIST stylesheet-def %overwrite; >
-
-<!ELEMENT charset-rule EMPTY >
-<!ATTLIST charset-rule %availability; >
-<!ELEMENT import-rule EMPTY >
-<!ATTLIST import-rule %availability; >
-<!ELEMENT page-rule EMPTY >
-<!ATTLIST page-rule %availability; >
-<!ELEMENT media-rule EMPTY >
-<!ATTLIST media-rule %availability; >
-<!ELEMENT fontface-rule EMPTY >
-<!ATTLIST fontface-rule %availability; >
-<!ELEMENT style-rule EMPTY >
-<!ATTLIST style-rule %availability; >
-
-<!ELEMENT charset-rule-def (description?) >
-<!ATTLIST charset-rule-def %overwrite; >
-
-<!ELEMENT import-rule-def (description?) >
-<!ATTLIST import-rule-def %overwrite; >
-
-<!ELEMENT page-rule-def (description? , (property | pseudo-class)*) >
-<!ATTLIST page-rule-def %overwrite; >
-
-<!ELEMENT media-rule-def (description?) >
-<!ATTLIST media-rule-def %overwrite; >
-
-<!ELEMENT fontface-rule-def (description? , descriptor*) >
-<!ATTLIST fontface-rule-def %overwrite; >
-
-<!ELEMENT style-rule-def (description? , (property | selector-expression | pseudo-class | pseudo-element)*) >
-<!ATTLIST style-rule-def %overwrite; >
-
-<!ELEMENT selector-expression EMPTY >
-<!ATTLIST selector-expression name (descendant | child | adjacent | universal | attribute) #REQUIRED %availability; >
-
-<!ELEMENT pseudo-class EMPTY >
-<!ATTLIST pseudo-class %name-reference; %availability; >
-
-<!ELEMENT pseudo-element EMPTY >
-<!ATTLIST pseudo-element %name-reference; %availability; >
-
-<!ELEMENT pseudo-class-def (description?, selector-value) >
-<!ATTLIST pseudo-class-def %name-definition; %overwrite; >
-<!ELEMENT selector-value (#PCDATA) >
-
-<!ELEMENT pseudo-element-def (description?, selector-value) >
-<!ATTLIST pseudo-element-def %name-definition; %overwrite; >
-
-<!ELEMENT keyword-def (description? , keyword-value) >
-<!ATTLIST keyword-def %name-definition; %overwrite; >
-<!ELEMENT keyword-value (#PCDATA) >
-<!ELEMENT description (#PCDATA) >
-
-<!ELEMENT function-def (description? , function-value) >
-<!ATTLIST function-def %name-definition; %overwrite; >
-<!ELEMENT function-value (#PCDATA) >
-
-<!ELEMENT number-def (description? , unit*) >
-<!ATTLIST number-def %name-definition; %overwrite; >
-<!ELEMENT unit EMPTY >
-<!ATTLIST unit %name-reference; %availability; >
-
-<!ELEMENT unit-def (description? , unit-value) >
-<!ATTLIST unit-def %name-definition; %overwrite; >
-<!ELEMENT unit-value (#PCDATA) >
-
-<!ELEMENT container-def (description? , (number | keyword | function | container)*) >
-<!ATTLIST container-def %name-definition; %overwrite; >
-
-<!ELEMENT category-def (description?, caption) >
-<!ATTLIST category-def %name-definition; %overwrite; >
-<!ELEMENT caption (#PCDATA) >
-
-<!ELEMENT property-def (description? , (number | keyword | function | container | string | separator | property)*) >
-<!ATTLIST property-def %name-definition; %overwrite;
- inherited (yes | no | na) "na"
- mediagroup CDATA #IMPLIED
- category CDATA #IMPLIED >
-<!ELEMENT descriptor-def (description?, (number | keyword | function | container | string | separator | property)*) >
-<!ATTLIST descriptor-def %name-definition; %overwrite; >
-
-<!ELEMENT number EMPTY >
-<!ATTLIST number %name-reference; %availability; >
-<!ELEMENT keyword EMPTY >
-<!ATTLIST keyword %name-reference; %availability; >
-<!ELEMENT function EMPTY >
-<!ATTLIST function %name-reference; %availability; >
-<!ELEMENT container EMPTY >
-<!ATTLIST container %name-reference; %availability; >
-<!ELEMENT string EMPTY >
-<!ATTLIST string %name-reference; %availability; >
-<!ELEMENT separator EMPTY >
-<!ATTLIST separator name (comma | slash) #REQUIRED %availability; >
-<!ELEMENT property EMPTY >
-<!ATTLIST property %name-reference; %availability; >
-<!ELEMENT descriptor EMPTY >
-<!ATTLIST descriptor %name-reference; %availability; >
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml
deleted file mode 100644
index 6b0b175319..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml
+++ /dev/null
@@ -1,826 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
- <stylesheet-def>
- <description>%css1.stylesheet-def.description</description>
- <import-rule/>
- <style-rule/>
- </stylesheet-def>
-
- <import-rule-def>
- </import-rule-def>
-
- <style-rule-def>
- <selector-expression name="descendant"/>
- <pseudo-element name="first-line"/>
- <pseudo-element name="first-letter"/>
- <pseudo-class name="link"/>
- <pseudo-class name="visited"/>
- <pseudo-class name="active"/>
- <property name="background"/>
- <property name="background-attachment"/>
- <property name="background-color"/>
- <property name="background-image"/>
- <property name="background-position"/>
- <property name="background-repeat"/>
- <property name="border"/>
- <property name="border-bottom"/>
- <property name="border-bottom-width"/>
- <property name="border-color"/>
- <property name="border-left"/>
- <property name="border-left-width"/>
- <property name="border-right"/>
- <property name="border-right-width"/>
- <property name="border-style"/>
- <property name="border-top"/>
- <property name="border-top-width"/>
- <property name="border-width"/>
- <property name="clear"/>
- <property name="color"/>
- <property name="display"/>
- <property name="float"/>
- <property name="font"/>
- <property name="font-family"/>
- <property name="font-size"/>
- <property name="font-style"/>
- <property name="font-variant"/>
- <property name="font-weight"/>
- <property name="height"/>
- <property name="letter-spacing"/>
- <property name="line-height"/>
- <property name="list-style"/>
- <property name="list-style-image"/>
- <property name="list-style-position"/>
- <property name="list-style-type"/>
- <property name="margin"/>
- <property name="margin-bottom"/>
- <property name="margin-left"/>
- <property name="margin-right"/>
- <property name="margin-top"/>
- <property name="padding"/>
- <property name="padding-bottom"/>
- <property name="padding-left"/>
- <property name="padding-right"/>
- <property name="padding-top"/>
- <property name="text-align"/>
- <property name="text-decoration"/>
- <property name="text-indent"/>
- <property name="text-transform"/>
- <property name="vertical-align"/>
- <property name="white-space"/>
- <property name="width"/>
- <property name="word-spacing"/>
- </style-rule-def>
-
- <pseudo-class-def name="link">
- <selector-value>link</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="visited">
- <selector-value>visited</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="active">
- <selector-value>active</selector-value>
- </pseudo-class-def>
-
- <pseudo-element-def name="first-line">
- <selector-value>first-line</selector-value>
- </pseudo-element-def>
- <pseudo-element-def name="first-letter">
- <selector-value>first-letter</selector-value>
- </pseudo-element-def>
-
- <!-- property definition -->
-
- <property-def name="background" inherited="no" category="colorandbackground">
- <property name="background-color"/>
- <property name="background-image"/>
- <property name="background-repeat"/>
- <property name="background-attachment"/>
- <property name="background-position"/>
- </property-def>
- <property-def name="background-attachment" inherited="no" category="colorandbackground">
- <keyword name="scroll"/>
- <keyword name="fixed"/>
- </property-def>
- <property-def name="background-color" inherited="no" category="colorandbackground">
- <container name="color"/>
- <keyword name="transparent"/>
- </property-def>
- <property-def name="background-image" inherited="no" category="colorandbackground">
- <function name="uri"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="background-position" inherited="no" category="colorandbackground">
- <number name="percentage"/>
- <number name="length"/>
- <keyword name="top"/>
- <keyword name="center"/>
- <keyword name="bottom"/>
- <keyword name="left"/>
- <keyword name="right"/>
- </property-def>
- <property-def name="background-repeat" inherited="no" category="colorandbackground">
- <keyword name="repeat"/>
- <keyword name="repeat-x"/>
- <keyword name="repeat-y"/>
- <keyword name="no-repeat"/>
- </property-def>
- <property-def name="border" inherited="no" category="box">
- <property name="border-width"/>
- <property name="border-style"/>
- <container name="color"/>
- </property-def>
- <property-def name="border-color" inherited="no" category="box">
- <container name="color"/>
- </property-def>
- <property-def name="border-style" inherited="no" category="box">
- <keyword name="none"/>
- <keyword name="dotted"/>
- <keyword name="dashed"/>
- <keyword name="solid"/>
- <keyword name="double"/>
- <keyword name="groove"/>
- <keyword name="ridge"/>
- <keyword name="inset"/>
- <keyword name="outset"/>
- </property-def>
- <property-def name="border-top" inherited="no" category="box">
- <property name="border-top-width"/>
- <property name="border-style"/>
- <container name="color"/>
- </property-def>
- <property-def name="border-right" inherited="no" category="box">
- <property name="border-right-width"/>
- <property name="border-style"/>
- <container name="color"/>
- </property-def>
- <property-def name="border-bottom" inherited="no" category="box">
- <property name="border-bottom-width"/>
- <property name="border-style"/>
- <container name="color"/>
- </property-def>
- <property-def name="border-left" inherited="no" category="box">
- <property name="border-left-width"/>
- <property name="border-style"/>
- <container name="color"/>
- </property-def>
- <property-def name="border-top-width" inherited="no" category="box">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </property-def>
- <property-def name="border-right-width" inherited="no" category="box">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </property-def>
- <property-def name="border-bottom-width" inherited="no" category="box">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </property-def>
- <property-def name="border-left-width" inherited="no" category="box">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </property-def>
- <property-def name="border-width" inherited="no" category="box">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </property-def>
- <property-def name="clear" inherited="no" category="box">
- <keyword name="none"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="both"/>
- </property-def>
- <property-def name="color" inherited="yes" category="colorandbackground">
- <container name="color"/>
- </property-def>
- <property-def name="display" inherited="no" category="classification">
- <keyword name="block"/>
- <keyword name="inline"/>
- <keyword name="list-item"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="float" inherited="no" category="box">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="font"
- inherited="yes" category="font">
- <property name="font-style"/>
- <property name="font-variant"/>
- <property name="font-weight"/>
- <property name="font-size"/>
- <property name="line-height"/>
- <property name="font-family"/>
- <separator name="slash"/>
- </property-def>
- <property-def name="font-family" inherited="yes" category="font">
- <string name="family-name"/>
- <container name="generic-family"/>
- <separator name="comma"/>
- </property-def>
- <property-def name="font-size" inherited="yes" category="font">
- <container name="absolute-size"/>
- <container name="relative-size"/>
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="font-style" inherited="yes" category="font">
- <keyword name="normal"/>
- <keyword name="italic"/>
- <keyword name="oblique"/>
- </property-def>
- <property-def name="font-variant" inherited="yes" category="font">
- <keyword name="normal"/>
- <keyword name="small-caps"/>
- </property-def>
- <property-def name="font-weight" inherited="yes" category="font">
- <keyword name="normal"/>
- <keyword name="bold"/>
- <keyword name="bolder"/>
- <keyword name="lighter"/>
- <keyword name="100"/>
- <keyword name="200"/>
- <keyword name="300"/>
- <keyword name="400"/>
- <keyword name="500"/>
- <keyword name="600"/>
- <keyword name="700"/>
- <keyword name="800"/>
- <keyword name="900"/>
- </property-def>
- <property-def name="height" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="letter-spacing" inherited="yes" category="text">
- <keyword name="normal"/>
- <number name="length"/>
- </property-def>
- <property-def name="line-height" inherited="yes" category="text">
- <keyword name="normal"/>
- <number name="number"/>
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="list-style" inherited="yes" category="classification">
- <keyword name="disc"/>
- <keyword name="circle"/>
- <keyword name="square"/>
- <keyword name="decimal"/>
- <keyword name="lower-roman"/>
- <keyword name="upper-roman"/>
- <keyword name="lower-alpha"/>
- <keyword name="upper-alpha"/>
- <keyword name="none"/>
- <keyword name="inside"/>
- <keyword name="outside"/>
- <function name="uri"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="list-style-image" inherited="yes" category="classification">
- <function name="uri"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="list-style-position" inherited="yes" category="classification">
- <keyword name="inside"/>
- <keyword name="outside"/>
- </property-def>
- <property-def name="list-style-type" inherited="yes" category="classification">
- <keyword name="disc"/>
- <keyword name="circle"/>
- <keyword name="square"/>
- <keyword name="decimal"/>
- <keyword name="lower-roman"/>
- <keyword name="upper-roman"/>
- <keyword name="lower-alpha"/>
- <keyword name="upper-alpha"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="margin" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="margin-top" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="margin-right" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="margin-bottom" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="margin-left" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="padding" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="padding-top" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="padding-right" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="padding-bottom" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="padding-left" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="text-align" inherited="yes" category="text">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="center"/>
- <keyword name="justify"/>
- </property-def>
- <property-def name="text-decoration" inherited="no" category="text">
- <keyword name="none"/>
- <keyword name="underline"/>
- <keyword name="overline"/>
- <keyword name="line-through"/>
- <keyword name="blink"/>
- </property-def>
- <property-def name="text-indent" inherited="yes" category="text">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="text-transform" inherited="yes" category="text">
- <keyword name="capitalize"/>
- <keyword name="uppercase"/>
- <keyword name="lowercase"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="vertical-align" inherited="no" category="text">
- <keyword name="baseline"/>
- <keyword name="sub"/>
- <keyword name="super"/>
- <keyword name="top"/>
- <keyword name="text-top"/>
- <keyword name="middle"/>
- <keyword name="bottom"/>
- <keyword name="text-bottom"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="white-space" inherited="yes" category="classification">
- <keyword name="normal"/>
- <keyword name="pre"/>
- <keyword name="nowrap"/>
- </property-def>
- <property-def name="width" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="word-spacing" inherited="yes" category="text">
- <keyword name="normal"/>
- <number name="length"/>
- </property-def>
-
- <!-- container definition : Container is the lump of values.
- It can be used like macros. -->
- <container-def name="absolute-size">
- <keyword name="xx-small"/>
- <keyword name="x-small"/>
- <keyword name="small"/>
- <keyword name="medium"/>
- <keyword name="large"/>
- <keyword name="x-large"/>
- <keyword name="xx-large"/>
- </container-def>
- <container-def name="color">
- <keyword name="aqua"/>
- <keyword name="black"/>
- <keyword name="blue"/>
- <keyword name="fuchsia"/>
- <keyword name="gray"/>
- <keyword name="green"/>
- <keyword name="lime"/>
- <keyword name="maroon"/>
- <keyword name="navy"/>
- <keyword name="olive"/>
- <keyword name="purple"/>
- <keyword name="red"/>
- <keyword name="silver"/>
- <keyword name="teal"/>
- <keyword name="white"/>
- <keyword name="yellow"/>
- <function name="rgb"/>
- <number name="hash"/>
- </container-def>
- <container-def name="generic-family">
- <keyword name="serif"/>
- <keyword name="sans-serif"/>
- <keyword name="cursive"/>
- <keyword name="fantasy"/>
- <keyword name="monospace"/>
- </container-def>
- <container-def name="relative-size">
- <keyword name="smaller"/>
- <keyword name="larger"/>
- </container-def>
-
- <!-- category definition : This is used to categorize properties
- in Properties View. -->
- <category-def name="box">
- <caption>%css1.category-def.box.caption</caption>
- </category-def>
- <category-def name="colorandbackground">
- <caption>%css1.category-def.colorandbackground.caption</caption>
- </category-def>
- <category-def name="classification">
- <caption>%css1.category-def.classification.caption</caption>
- </category-def>
- <category-def name="font">
- <caption>%css1.category-def.font.caption</caption>
- </category-def>
- <category-def name="text">
- <caption>%css1.category-def.text.caption</caption>
- </category-def>
-
- <function-def name="rgb">
- <function-value>rgb</function-value>
- </function-def>
- <function-def name="uri">
- <function-value>url</function-value>
- </function-def>
-
- <!-- number definition : What unit types be acceptable for each
- number type? -->
- <number-def name="hash">
- <unit name="hash"/>
- </number-def>
- <number-def name="length">
- <unit name="em"/>
- <unit name="ex"/>
- <unit name="px"/>
- <unit name="in"/>
- <unit name="cm"/>
- <unit name="mm"/>
- <unit name="pt"/>
- <unit name="pc"/>
- </number-def>
- <number-def name="number">
- </number-def>
- <number-def name="percentage">
- <unit name="percentage"/>
- </number-def>
-
- <unit-def name="cm">
- <unit-value>cm</unit-value>
- </unit-def>
- <unit-def name="em">
- <unit-value>em</unit-value>
- </unit-def>
- <unit-def name="ex">
- <unit-value>ex</unit-value>
- </unit-def>
- <unit-def name="hash">
- <unit-value>#</unit-value>
- </unit-def>
- <unit-def name="in">
- <unit-value>in</unit-value>
- </unit-def>
- <unit-def name="mm">
- <unit-value>mm</unit-value>
- </unit-def>
- <unit-def name="pc">
- <unit-value>pc</unit-value>
- </unit-def>
- <unit-def name="percentage">
- <unit-value>%</unit-value>
- </unit-def>
- <unit-def name="pt">
- <unit-value>pt</unit-value>
- </unit-def>
- <unit-def name="px">
- <unit-value>px</unit-value>
- </unit-def>
-
- <!-- keywords : string constants (this is last part..) -->
- <keyword-def name="100">
- <keyword-value>100</keyword-value>
- </keyword-def>
- <keyword-def name="200">
- <keyword-value>200</keyword-value>
- </keyword-def>
- <keyword-def name="300">
- <keyword-value>300</keyword-value>
- </keyword-def>
- <keyword-def name="400">
- <keyword-value>400</keyword-value>
- </keyword-def>
- <keyword-def name="500">
- <keyword-value>500</keyword-value>
- </keyword-def>
- <keyword-def name="600">
- <keyword-value>600</keyword-value>
- </keyword-def>
- <keyword-def name="700">
- <keyword-value>700</keyword-value>
- </keyword-def>
- <keyword-def name="800">
- <keyword-value>800</keyword-value>
- </keyword-def>
- <keyword-def name="900">
- <keyword-value>900</keyword-value>
- </keyword-def>
- <keyword-def name="aqua">
- <keyword-value>aqua</keyword-value>
- </keyword-def>
- <keyword-def name="auto">
- <keyword-value>auto</keyword-value>
- </keyword-def>
- <keyword-def name="baseline">
- <keyword-value>baseline</keyword-value>
- </keyword-def>
- <keyword-def name="black">
- <keyword-value>black</keyword-value>
- </keyword-def>
- <keyword-def name="blink">
- <keyword-value>blink</keyword-value>
- </keyword-def>
- <keyword-def name="block">
- <keyword-value>block</keyword-value>
- </keyword-def>
- <keyword-def name="blue">
- <keyword-value>blue</keyword-value>
- </keyword-def>
- <keyword-def name="bold">
- <keyword-value>bold</keyword-value>
- </keyword-def>
- <keyword-def name="bolder">
- <keyword-value>bolder</keyword-value>
- </keyword-def>
- <keyword-def name="both">
- <keyword-value>both</keyword-value>
- </keyword-def>
- <keyword-def name="bottom">
- <keyword-value>bottom</keyword-value>
- </keyword-def>
- <keyword-def name="capitalize">
- <keyword-value>capitalize</keyword-value>
- </keyword-def>
- <keyword-def name="center">
- <keyword-value>center</keyword-value>
- </keyword-def>
- <keyword-def name="circle">
- <keyword-value>circle</keyword-value>
- </keyword-def>
- <keyword-def name="cursive">
- <keyword-value>cursive</keyword-value>
- </keyword-def>
- <keyword-def name="dashed">
- <keyword-value>dashed</keyword-value>
- </keyword-def>
- <keyword-def name="decimal">
- <keyword-value>decimal</keyword-value>
- </keyword-def>
- <keyword-def name="disc">
- <keyword-value>disc</keyword-value>
- </keyword-def>
- <keyword-def name="dotted">
- <keyword-value>dotted</keyword-value>
- </keyword-def>
- <keyword-def name="double">
- <keyword-value>double</keyword-value>
- </keyword-def>
- <keyword-def name="fantasy">
- <keyword-value>fantasy</keyword-value>
- </keyword-def>
- <keyword-def name="fixed">
- <keyword-value>fixed</keyword-value>
- </keyword-def>
- <keyword-def name="fuchsia">
- <keyword-value>fuchsia</keyword-value>
- </keyword-def>
- <keyword-def name="gray">
- <keyword-value>gray</keyword-value>
- </keyword-def>
- <keyword-def name="green">
- <keyword-value>green</keyword-value>
- </keyword-def>
- <keyword-def name="groove">
- <keyword-value>groove</keyword-value>
- </keyword-def>
- <keyword-def name="inline">
- <keyword-value>inline</keyword-value>
- </keyword-def>
- <keyword-def name="inset">
- <keyword-value>inset</keyword-value>
- </keyword-def>
- <keyword-def name="inside">
- <keyword-value>inside</keyword-value>
- </keyword-def>
- <keyword-def name="italic">
- <keyword-value>italic</keyword-value>
- </keyword-def>
- <keyword-def name="justify">
- <keyword-value>justify</keyword-value>
- </keyword-def>
- <keyword-def name="large">
- <keyword-value>large</keyword-value>
- </keyword-def>
- <keyword-def name="larger">
- <keyword-value>larger</keyword-value>
- </keyword-def>
- <keyword-def name="left">
- <keyword-value>left</keyword-value>
- </keyword-def>
- <keyword-def name="lighter">
- <keyword-value>lighter</keyword-value>
- </keyword-def>
- <keyword-def name="lime">
- <keyword-value>lime</keyword-value>
- </keyword-def>
- <keyword-def name="line-through">
- <keyword-value>line-through</keyword-value>
- </keyword-def>
- <keyword-def name="list-item">
- <keyword-value>list-item</keyword-value>
- </keyword-def>
- <keyword-def name="lower-alpha">
- <keyword-value>lower-alpha</keyword-value>
- </keyword-def>
- <keyword-def name="lower-roman">
- <keyword-value>lower-roman</keyword-value>
- </keyword-def>
- <keyword-def name="lowercase">
- <keyword-value>lowercase</keyword-value>
- </keyword-def>
- <keyword-def name="maroon">
- <keyword-value>maroon</keyword-value>
- </keyword-def>
- <keyword-def name="medium">
- <keyword-value>medium</keyword-value>
- </keyword-def>
- <keyword-def name="middle">
- <keyword-value>middle</keyword-value>
- </keyword-def>
- <keyword-def name="monospace">
- <keyword-value>monospace</keyword-value>
- </keyword-def>
- <keyword-def name="navy">
- <keyword-value>navy</keyword-value>
- </keyword-def>
- <keyword-def name="no-repeat">
- <keyword-value>no-repeat</keyword-value>
- </keyword-def>
- <keyword-def name="none">
- <keyword-value>none</keyword-value>
- </keyword-def>
- <keyword-def name="normal">
- <keyword-value>normal</keyword-value>
- </keyword-def>
- <keyword-def name="nowrap">
- <keyword-value>nowrap</keyword-value>
- </keyword-def>
- <keyword-def name="oblique">
- <keyword-value>oblique</keyword-value>
- </keyword-def>
- <keyword-def name="olive">
- <keyword-value>olive</keyword-value>
- </keyword-def>
- <keyword-def name="outset">
- <keyword-value>outset</keyword-value>
- </keyword-def>
- <keyword-def name="outside">
- <keyword-value>outside</keyword-value>
- </keyword-def>
- <keyword-def name="overline">
- <keyword-value>overline</keyword-value>
- </keyword-def>
- <keyword-def name="pre">
- <keyword-value>pre</keyword-value>
- </keyword-def>
- <keyword-def name="purple">
- <keyword-value>purple</keyword-value>
- </keyword-def>
- <keyword-def name="red">
- <keyword-value>red</keyword-value>
- </keyword-def>
- <keyword-def name="repeat">
- <keyword-value>repeat</keyword-value>
- </keyword-def>
- <keyword-def name="repeat-x">
- <keyword-value>repeat-x</keyword-value>
- </keyword-def>
- <keyword-def name="repeat-y">
- <keyword-value>repeat-y</keyword-value>
- </keyword-def>
- <keyword-def name="ridge">
- <keyword-value>ridge</keyword-value>
- </keyword-def>
- <keyword-def name="right">
- <keyword-value>right</keyword-value>
- </keyword-def>
- <keyword-def name="sans-serif">
- <keyword-value>sans-serif</keyword-value>
- </keyword-def>
- <keyword-def name="scroll">
- <keyword-value>scroll</keyword-value>
- </keyword-def>
- <keyword-def name="serif">
- <keyword-value>serif</keyword-value>
- </keyword-def>
- <keyword-def name="silver">
- <keyword-value>silver</keyword-value>
- </keyword-def>
- <keyword-def name="small">
- <keyword-value>small</keyword-value>
- </keyword-def>
- <keyword-def name="small-caps">
- <keyword-value>small-caps</keyword-value>
- </keyword-def>
- <keyword-def name="smaller">
- <keyword-value>smaller</keyword-value>
- </keyword-def>
- <keyword-def name="solid">
- <keyword-value>solid</keyword-value>
- </keyword-def>
- <keyword-def name="square">
- <keyword-value>square</keyword-value>
- </keyword-def>
- <keyword-def name="sub">
- <keyword-value>sub</keyword-value>
- </keyword-def>
- <keyword-def name="super">
- <keyword-value>super</keyword-value>
- </keyword-def>
- <keyword-def name="teal">
- <keyword-value>teal</keyword-value>
- </keyword-def>
- <keyword-def name="text-top">
- <keyword-value>text-top</keyword-value>
- </keyword-def>
- <keyword-def name="text-bottom">
- <keyword-value>text-bottom</keyword-value>
- </keyword-def>
- <keyword-def name="thick">
- <keyword-value>thick</keyword-value>
- </keyword-def>
- <keyword-def name="thin">
- <keyword-value>thin</keyword-value>
- </keyword-def>
- <keyword-def name="top">
- <keyword-value>top</keyword-value>
- </keyword-def>
- <keyword-def name="transparent">
- <keyword-value>transparent</keyword-value>
- </keyword-def>
- <keyword-def name="underline">
- <keyword-value>underline</keyword-value>
- </keyword-def>
- <keyword-def name="upper-alpha">
- <keyword-value>upper-alpha</keyword-value>
- </keyword-def>
- <keyword-def name="upper-roman">
- <keyword-value>upper-roman</keyword-value>
- </keyword-def>
- <keyword-def name="uppercase">
- <keyword-value>uppercase</keyword-value>
- </keyword-def>
- <keyword-def name="white">
- <keyword-value>white</keyword-value>
- </keyword-def>
- <keyword-def name="x-large">
- <keyword-value>x-large</keyword-value>
- </keyword-def>
- <keyword-def name="x-small">
- <keyword-value>x-small</keyword-value>
- </keyword-def>
- <keyword-def name="xx-small">
- <keyword-value>xx-small</keyword-value>
- </keyword-def>
- <keyword-def name="xx-large">
- <keyword-value>xx-large</keyword-value>
- </keyword-def>
- <keyword-def name="yellow">
- <keyword-value>yellow</keyword-value>
- </keyword-def>
-</css-profile> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml
deleted file mode 100644
index 4efc084b91..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml
+++ /dev/null
@@ -1,2258 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
- <stylesheet-def>
- <description>%css2.stylesheet-def.description</description>
- <charset-rule/>
- <import-rule/>
- <page-rule/>
- <media-rule/>
- <fontface-rule/>
- <style-rule/>
- </stylesheet-def>
-
- <charset-rule-def>
- </charset-rule-def>
- <import-rule-def>
- </import-rule-def>
- <media-rule-def>
- </media-rule-def>
-
- <page-rule-def>
- <pseudo-class name="left"/>
- <pseudo-class name="right"/>
- <pseudo-class name="first"/>
- <property name="size"/>
- <property name="marks"/>
- <property name="page-break-after"/>
- <property name="page-break-before"/>
- <property name="page-break-inside"/>
- <property name="orphans"/>
- <property name="widows"/>
- </page-rule-def>
-
- <fontface-rule-def>
- <descriptor name="ascent"/>
- <descriptor name="baseline"/>
- <descriptor name="bbox"/>
- <descriptor name="cap-height"/>
- <descriptor name="centerline"/>
- <descriptor name="definition-src"/>
- <descriptor name="descent"/>
- <descriptor name="font-family"/>
- <descriptor name="font-size"/>
- <descriptor name="font-stretch"/>
- <descriptor name="font-style"/>
- <descriptor name="font-variant"/>
- <descriptor name="font-weight"/>
- <descriptor name="mathline"/>
- <descriptor name="panose-1"/>
- <descriptor name="slope"/>
- <descriptor name="slope"/>
- <descriptor name="src"/>
- <descriptor name="stemh"/>
- <descriptor name="stemv"/>
- <descriptor name="topline"/>
- <descriptor name="unicode-range"/>
- <descriptor name="units-per-em"/>
- <descriptor name="widths"/>
- <descriptor name="x-height"/>
- </fontface-rule-def>
-
- <!-- Which properties can style rule include ? -->
-
- <style-rule-def>
- <selector-expression name="descendant"/>
- <selector-expression name="child"/>
- <selector-expression name="adjacent"/>
- <selector-expression name="universal"/>
- <selector-expression name="attribute"/>
- <pseudo-element name="first-line"/>
- <pseudo-element name="first-letter"/>
- <pseudo-element name="before"/>
- <pseudo-element name="after"/>
- <pseudo-class name="first-child"/>
- <pseudo-class name="link"/>
- <pseudo-class name="visited"/>
- <pseudo-class name="hover"/>
- <pseudo-class name="active"/>
- <pseudo-class name="focus"/>
- <pseudo-class name="lang"/>
- <property name="azimuth"/>
- <property name="background"/>
- <property name="background-attachment"/>
- <property name="background-color"/>
- <property name="background-image"/>
- <property name="background-position"/>
- <property name="background-repeat"/>
- <property name="border"/>
- <property name="border-collapse"/>
- <property name="border-color"/>
- <property name="border-spacing"/>
- <property name="border-style"/>
- <property name="border-top"/>
- <property name="border-right"/>
- <property name="border-bottom"/>
- <property name="border-left"/>
- <property name="border-top-color"/>
- <property name="border-right-color"/>
- <property name="border-bottom-color"/>
- <property name="border-left-color"/>
- <property name="border-top-style"/>
- <property name="border-right-style"/>
- <property name="border-bottom-style"/>
- <property name="border-left-style"/>
- <property name="border-top-width"/>
- <property name="border-right-width"/>
- <property name="border-bottom-width"/>
- <property name="border-left-width"/>
- <property name="border-width"/>
- <property name="bottom"/>
- <property name="caption-side"/>
- <property name="clear"/>
- <property name="clip"/>
- <property name="color"/>
- <property name="content"/>
- <property name="counter-increment"/>
- <property name="counter-reset"/>
- <property name="cue"/>
- <property name="cue-after"/>
- <property name="cue-before"/>
- <property name="cursor"/>
- <property name="direction"/>
- <property name="display"/>
- <property name="elevation"/>
- <property name="empty-cells"/>
- <property name="float"/>
- <property name="font"/>
- <property name="font-family"/>
- <property name="font-size"/>
- <property name="font-size-adjust"/>
- <property name="font-stretch"/>
- <property name="font-style"/>
- <property name="font-variant"/>
- <property name="font-weight"/>
- <property name="height"/>
- <property name="left"/>
- <property name="letter-spacing"/>
- <property name="line-height"/>
- <property name="list-style"/>
- <property name="list-style-image"/>
- <property name="list-style-position"/>
- <property name="list-style-type"/>
- <property name="margin"/>
- <property name="margin-top"/>
- <property name="margin-right"/>
- <property name="margin-bottom"/>
- <property name="margin-left"/>
- <property name="marker-offset"/>
- <property name="marks"/>
- <property name="max-height"/>
- <property name="max-width"/>
- <property name="min-height"/>
- <property name="min-width"/>
- <property name="orphans"/>
- <property name="outline"/>
- <property name="outline-color"/>
- <property name="outline-style"/>
- <property name="outline-width"/>
- <property name="overflow"/>
- <property name="padding"/>
- <property name="padding-top"/>
- <property name="padding-right"/>
- <property name="padding-bottom"/>
- <property name="padding-left"/>
- <property name="page"/>
- <property name="page-break-after"/>
- <property name="page-break-before"/>
- <property name="page-break-inside"/>
- <property name="pause"/>
- <property name="pause-after"/>
- <property name="pause-before"/>
- <property name="pitch"/>
- <property name="pitch-range"/>
- <property name="play-during"/>
- <property name="position"/>
- <property name="quotes"/>
- <property name="richness"/>
- <property name="right"/>
- <property name="size"/>
- <property name="speak"/>
- <property name="speak-header"/>
- <property name="speak-numeral"/>
- <property name="speak-punctuation"/>
- <property name="speech-rate"/>
- <property name="stress"/>
- <property name="table-layout"/>
- <property name="text-align"/>
- <property name="text-decoration"/>
- <property name="text-indent"/>
- <property name="text-shadow"/>
- <property name="text-transform"/>
- <property name="top"/>
- <property name="unicode-bidi"/>
- <property name="vertical-align"/>
- <property name="visibility"/>
- <property name="voice-family"/>
- <property name="volume"/>
- <property name="white-space"/>
- <property name="widows"/>
- <property name="width"/>
- <property name="word-spacing"/>
- <property name="z-index"/>
- </style-rule-def>
-
- <pseudo-class-def name="first-child">
- <selector-value>first-child</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="link">
- <selector-value>link</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="visited">
- <selector-value>visited</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="hover">
- <selector-value>hover</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="active">
- <selector-value>active</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="focus">
- <selector-value>focus</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="lang">
- <selector-value>lang</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="left">
- <selector-value>left</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="right">
- <selector-value>right</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="first">
- <selector-value>first</selector-value>
- </pseudo-class-def>
-
- <pseudo-element-def name="first-line">
- <selector-value>first-line</selector-value>
- </pseudo-element-def>
- <pseudo-element-def name="first-letter">
- <selector-value>first-letter</selector-value>
- </pseudo-element-def>
- <pseudo-element-def name="before">
- <selector-value>before</selector-value>
- </pseudo-element-def>
- <pseudo-element-def name="after">
- <selector-value>after</selector-value>
- </pseudo-element-def>
-
- <!-- property definition -->
-
- <property-def name="azimuth"
- inherited="yes" mediagroup="aural" category="aural">
- <description>This provides spatial audio property for aural
- presentation</description>
- <number name="angle"/>
- <keyword name="left-side"/>
- <keyword name="far-left"/>
- <keyword name="left"/>
- <keyword name="center-left"/>
- <keyword name="center"/>
- <keyword name="center-right"/>
- <keyword name="right"/>
- <keyword name="far-right"/>
- <keyword name="right-side"/>
- <keyword name="behind"/>
- <keyword name="leftwards"/>
- <keyword name="rightwards"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <property name="background-color"/>
- <property name="background-image"/>
- <property name="background-repeat"/>
- <property name="background-attachment"/>
- <property name="background-position"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-attachment"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <keyword name="scroll"/>
- <keyword name="fixed"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-color"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <container name="color"/>
- <keyword name="transparent"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-image"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <function name="uri"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-position"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <number name="percentage"/>
- <number name="length"/>
- <keyword name="top"/>
- <keyword name="center"/>
- <keyword name="bottom"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-repeat"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <keyword name="repeat"/>
- <keyword name="repeat-x"/>
- <keyword name="repeat-y"/>
- <keyword name="no-repeat"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border"
- inherited="no" mediagroup="visual" category="box">
- <property name="border-width"/>
- <property name="border-style"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-collapse"
- inherited="yes" mediagroup="visual" category="tables">
- <keyword name="collapse"/>
- <keyword name="separate"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-color"
- inherited="no" mediagroup="visual" category="box">
- <container name="color"/>
- <keyword name="transparent"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-spacing"
- inherited="yes" mediagroup="visual" category="tables">
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-style"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-top"
- inherited="no" mediagroup="visual" category="box">
- <property name="border-top-width"/>
- <property name="border-style"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-right"
- inherited="no" mediagroup="visual" category="box">
- <property name="border-right-width"/>
- <property name="border-style"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-bottom"
- inherited="no" mediagroup="visual" category="box">
- <property name="border-bottom-width"/>
- <property name="border-style"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-left"
- inherited="no" mediagroup="visual" category="box">
- <property name="border-left-width"/>
- <property name="border-style"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-top-color"
- inherited="no" mediagroup="visual" category="box">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-right-color"
- inherited="no" mediagroup="visual" category="box">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-bottom-color"
- inherited="no" mediagroup="visual" category="box">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-left-color"
- inherited="no" mediagroup="visual" category="box">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-top-style"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-right-style"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-bottom-style"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-left-style"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-top-width"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-right-width"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-bottom-width"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-left-width"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-width"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="bottom"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="caption-side"
- inherited="yes" mediagroup="visual" category="tables">
- <keyword name="top"/>
- <keyword name="bottom"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="clear"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="none"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="both"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="clip"
- inherited="no" mediagroup="visual" category="visual">
- <container name="shape"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="color"
- inherited="yes" mediagroup="visual" category="colorandbackground">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="content"
- inherited="no" mediagroup="all" category="content">
- <string name="any"/>
- <function name="uri"/>
- <function name="counter"/>
- <function name="attr"/>
- <keyword name="open-quote"/>
- <keyword name="close-quote"/>
- <keyword name="no-open-quote"/>
- <keyword name="no-close-quote"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="counter-increment"
- inherited="no" mediagroup="all" category="content">
- <string name="counter-identifier"/>
- <number name="integer"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="counter-reset"
- inherited="no" mediagroup="all" category="content">
- <string name="counter-identifier"/>
- <number name="integer"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="cue"
- inherited="no" mediagroup="aural" category="aural">
- <property name="cue-before"/>
- <property name="cue-after"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="cue-after"
- inherited="no" mediagroup="aural" category="aural">
- <function name="uri"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="cue-before"
- inherited="no" mediagroup="aural" category="aural">
- <function name="uri"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="cursor"
- inherited="yes" mediagroup="visual,interactive" category="ui">
- <function name="uri"/>
- <keyword name="auto"/>
- <keyword name="crosshair"/>
- <keyword name="default"/>
- <keyword name="pointer"/>
- <keyword name="move"/>
- <keyword name="e-resize"/>
- <keyword name="ne-resize"/>
- <keyword name="nw-resize"/>
- <keyword name="n-resize"/>
- <keyword name="se-resize"/>
- <keyword name="sw-resize"/>
- <keyword name="s-resize"/>
- <keyword name="w-resize"/>
- <keyword name="text"/>
- <keyword name="wait"/>
- <keyword name="help"/>
- <keyword name="inherit"/>
- <separator name="comma"/>
- </property-def>
- <property-def name="direction"
- inherited="yes" mediagroup="visual" category="visual">
- <keyword name="ltr"/>
- <keyword name="rtl"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="display"
- inherited="no" mediagroup="all" category="visual">
- <keyword name="inline"/>
- <keyword name="block"/>
- <keyword name="list-item"/>
- <keyword name="run-in"/>
- <keyword name="compact"/>
- <keyword name="marker"/>
- <keyword name="table"/>
- <keyword name="inline-table"/>
- <keyword name="table-row-group"/>
- <keyword name="table-header-group"/>
- <keyword name="table-footer-group"/>
- <keyword name="table-row"/>
- <keyword name="table-column-group"/>
- <keyword name="table-column"/>
- <keyword name="table-cell"/>
- <keyword name="table-caption"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="elevation"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="angle"/>
- <keyword name="below"/>
- <keyword name="level"/>
- <keyword name="above"/>
- <keyword name="higher"/>
- <keyword name="lower"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="empty-cells"
- inherited="yes" mediagroup="visual" category="tables">
- <keyword name="show"/>
- <keyword name="hide"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="float"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font"
- inherited="yes" mediagroup="visual" category="font">
- <property name="font-style"/>
- <property name="font-variant"/>
- <property name="font-weight"/>
- <property name="font-size"/>
- <property name="line-height"/>
- <property name="font-family"/>
- <keyword name="caption"/>
- <keyword name="icon"/>
- <keyword name="menu"/>
- <keyword name="message-box"/>
- <keyword name="small-caption"/>
- <keyword name="status-bar"/>
- <keyword name="inherit"/>
- <separator name="slash"/>
- </property-def>
- <property-def name="font-family"
- inherited="yes" mediagroup="visual" category="font">
- <string name="family-name"/>
- <container name="generic-family"/>
- <keyword name="inherit"/>
- <separator name="comma"/>
- </property-def>
- <property-def name="font-size"
- inherited="yes" mediagroup="visual" category="font">
- <container name="absolute-size"/>
- <container name="relative-size"/>
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font-size-adjust"
- inherited="yes" mediagroup="visual" category="font">
- <number name="number"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font-stretch"
- inherited="yes" mediagroup="visual" category="font">
- <keyword name="normal"/>
- <keyword name="wider"/>
- <keyword name="narrower"/>
- <keyword name="ultra-condensed"/>
- <keyword name="extra-condensed"/>
- <keyword name="condensed"/>
- <keyword name="semi-condensed"/>
- <keyword name="semi-expanded"/>
- <keyword name="expanded"/>
- <keyword name="extra-expanded"/>
- <keyword name="ultra-expanded"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font-style"
- inherited="yes" mediagroup="visual" category="font">
- <keyword name="normal"/>
- <keyword name="italic"/>
- <keyword name="oblique"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font-variant"
- inherited="yes" mediagroup="visual" category="font">
- <keyword name="normal"/>
- <keyword name="small-caps"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font-weight"
- inherited="yes" mediagroup="visual" category="font">
- <keyword name="normal"/>
- <keyword name="bold"/>
- <keyword name="bolder"/>
- <keyword name="lighter"/>
- <keyword name="100"/>
- <keyword name="200"/>
- <keyword name="300"/>
- <keyword name="400"/>
- <keyword name="500"/>
- <keyword name="600"/>
- <keyword name="700"/>
- <keyword name="800"/>
- <keyword name="900"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="height"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="left"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="letter-spacing"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="normal"/>
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="line-height"
- inherited="yes" mediagroup="visual" category="visual">
- <keyword name="normal"/>
- <number name="number"/>
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="list-style"
- inherited="yes" mediagroup="visual" category="content">
- <property name="list-style-type"/>
- <property name="list-style-position"/>
- <property name="list-style-image"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="list-style-image"
- inherited="yes" mediagroup="visual" category="content">
- <function name="uri"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="list-style-position"
- inherited="yes" mediagroup="visual" category="content">
- <keyword name="inside"/>
- <keyword name="outside"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="list-style-type"
- inherited="yes" mediagroup="visual" category="content">
- <keyword name="disc"/>
- <keyword name="circle"/>
- <keyword name="square"/>
- <keyword name="decimal"/>
- <keyword name="decimal-leading-zero"/>
- <keyword name="lower-roman"/>
- <keyword name="upper-roman"/>
- <keyword name="lower-greek"/>
- <keyword name="lower-alpha"/>
- <keyword name="lower-latin"/>
- <keyword name="upper-alpha"/>
- <keyword name="upper-latin"/>
- <keyword name="hebrew"/>
- <keyword name="armenian"/>
- <keyword name="georgian"/>
- <keyword name="cjk-ideographic"/>
- <keyword name="hiragana"/>
- <keyword name="katakana"/>
- <keyword name="hiragana-iroha"/>
- <keyword name="katakana-iroha"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="margin"
- inherited="no" mediagroup="visual" category="box">
- <container name="margin-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="margin-top"
- inherited="no" mediagroup="visual" category="box">
- <container name="margin-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="margin-right"
- inherited="no" mediagroup="visual" category="box">
- <container name="margin-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="margin-bottom"
- inherited="no" mediagroup="visual" category="box">
- <container name="margin-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="margin-left"
- inherited="no" mediagroup="visual" category="box">
- <container name="margin-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="marker-offset"
- inherited="no" mediagroup="visual" category="content">
- <number name="length"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="marks"
- inherited="na" mediagroup="visual,paged" category="page">
- <keyword name="crop"/>
- <keyword name="cross"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="max-height"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="max-width"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="min-height"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="min-width"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="orphans"
- inherited="yes" mediagroup="visual,paged" category="page">
- <number name="integer"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="outline"
- inherited="no" mediagroup="visual,interactive" category="ui">
- <property name="outline-color"/>
- <property name="outline-style"/>
- <property name="outline-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="outline-color"
- inherited="no" mediagroup="visual,interactive" category="ui">
- <container name="color"/>
- <keyword name="invert"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="outline-style"
- inherited="no" mediagroup="visual,interactive" category="ui">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="outline-width"
- inherited="no" mediagroup="visual,interactive" category="ui">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="overflow"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="visible"/>
- <keyword name="hidden"/>
- <keyword name="scroll"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="padding"
- inherited="no" mediagroup="visual" category="box">
- <container name="padding-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="padding-top"
- inherited="no" mediagroup="visual" category="box">
- <container name="padding-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="padding-right"
- inherited="no" mediagroup="visual" category="box">
- <container name="padding-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="padding-bottom"
- inherited="no" mediagroup="visual" category="box">
- <container name="padding-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="padding-left"
- inherited="no" mediagroup="visual" category="box">
- <container name="padding-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="page"
- inherited="yes" mediagroup="visual,paged" category="page">
- <string name="page-identifier"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="page-break-after"
- inherited="no" mediagroup="visual,paged" category="page">
- <keyword name="auto"/>
- <keyword name="always"/>
- <keyword name="avoid"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="page-break-before"
- inherited="no" mediagroup="visual,paged" category="page">
- <keyword name="auto"/>
- <keyword name="always"/>
- <keyword name="avoid"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="page-break-inside"
- inherited="yes" mediagroup="visual,paged" category="page">
- <keyword name="avoid"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="pause"
- inherited="no" mediagroup="aural" category="aural">
- <number name="time"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="pause-after"
- inherited="no" mediagroup="aural" category="aural">
- <number name="time"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="pause-before"
- inherited="no" mediagroup="aural" category="aural">
- <number name="time"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="pitch"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="frequency"/>
- <keyword name="x-low"/>
- <keyword name="low"/>
- <keyword name="medium"/>
- <keyword name="high"/>
- <keyword name="x-high"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="pitch-range"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="number"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="play-during"
- inherited="no" mediagroup="aural" category="aural">
- <function name="uri"/>
- <keyword name="mix"/>
- <keyword name="repeat"/>
- <keyword name="auto"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="position"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="static"/>
- <keyword name="relative"/>
- <keyword name="absolute"/>
- <keyword name="fixed"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="quotes"
- inherited="yes" mediagroup="visual" category="content">
- <string name="any"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="richness"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="number"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="right"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="size"
- inherited="na" mediagroup="visual,paged" category="page">
- <number name="length"/>
- <keyword name="auto"/>
- <keyword name="portrait"/>
- <keyword name="landscape"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="speak"
- inherited="yes" mediagroup="aural" category="aural">
- <keyword name="normal"/>
- <keyword name="none"/>
- <keyword name="spell-out"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="speak-header"
- inherited="yes" mediagroup="aural" category="tables">
- <keyword name="once"/>
- <keyword name="always"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="speak-numeral"
- inherited="yes" mediagroup="aural" category="aural">
- <keyword name="digits"/>
- <keyword name="continuous"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="speak-punctuation"
- inherited="yes" mediagroup="aural" category="aural">
- <keyword name="code"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="speech-rate"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="number"/>
- <keyword name="x-slow"/>
- <keyword name="slow"/>
- <keyword name="medium"/>
- <keyword name="fast"/>
- <keyword name="x-fast"/>
- <keyword name="faster"/>
- <keyword name="slower"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="stress"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="number"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="table-layout"
- inherited="no" mediagroup="visual" category="tables">
- <keyword name="auto"/>
- <keyword name="fixed"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-align"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="center"/>
- <keyword name="justify"/>
- <string name="any"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-decoration"
- inherited="no" mediagroup="visual" category="text">
- <keyword name="none"/>
- <keyword name="underline"/>
- <keyword name="overline"/>
- <keyword name="line-through"/>
- <keyword name="blink"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-indent"
- inherited="yes" mediagroup="visual" category="text">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-shadow"
- inherited="no" mediagroup="visual" category="text">
- <keyword name="none"/>
- <container name="color"/>
- <number name="length"/>
- <keyword name="inherit"/>
- <separator name="comma"/>
- </property-def>
- <property-def name="text-transform"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="capitalize"/>
- <keyword name="uppercase"/>
- <keyword name="lowercase"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="top"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="unicode-bidi"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="normal"/>
- <keyword name="embed"/>
- <keyword name="bidi-override"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="vertical-align"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="baseline"/>
- <keyword name="sub"/>
- <keyword name="super"/>
- <keyword name="top"/>
- <keyword name="text-top"/>
- <keyword name="middle"/>
- <keyword name="bottom"/>
- <keyword name="text-bottom"/>
- <number name="percentage"/>
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="visibility"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="visible"/>
- <keyword name="hidden"/>
- <keyword name="collapse"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="voice-family"
- inherited="yes" mediagroup="aural" category="aural">
- <string name="specific-voice"/>
- <container name="generic-voice"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="volume"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="number"/>
- <number name="percentage"/>
- <keyword name="silent"/>
- <keyword name="x-soft"/>
- <keyword name="soft"/>
- <keyword name="medium"/>
- <keyword name="loud"/>
- <keyword name="x-loud"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="white-space"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="normal"/>
- <keyword name="pre"/>
- <keyword name="nowrap"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="widows"
- inherited="yes" mediagroup="visual,paged" category="page">
- <number name="integer"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="width"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="word-spacing"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="normal"/>
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="z-index"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="auto"/>
- <number name="integer"/>
- <keyword name="inherit"/>
- </property-def>
-
- <!-- descriptor definition : These are for @font-face -->
-
- <descriptor-def name="ascent">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="baseline">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="bbox">
- <number name="number"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="cap-height">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="centerline">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="definition-src">
- <function name="uri"/>
- </descriptor-def>
- <descriptor-def name="descent">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="font-family">
- <string name="family-name"/>
- <container name="generic-family"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="font-size">
- <keyword name="all"/>
- <number name="length"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="font-stretch">
- <keyword name="all"/>
- <keyword name="normal"/>
- <keyword name="ultra-condensed"/>
- <keyword name="extra-condensed"/>
- <keyword name="condensed"/>
- <keyword name="semi-condensed"/>
- <keyword name="semi-expanded"/>
- <keyword name="expanded"/>
- <keyword name="extra-expanded"/>
- <keyword name="ultra-expanded"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="font-style">
- <keyword name="all"/>
- <keyword name="normal"/>
- <keyword name="italic"/>
- <keyword name="oblique"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="font-variant">
- <keyword name="normal"/>
- <keyword name="small-caps"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="font-weight">
- <keyword name="all"/>
- <keyword name="normal"/>
- <keyword name="bold"/>
- <keyword name="100"/>
- <keyword name="200"/>
- <keyword name="300"/>
- <keyword name="400"/>
- <keyword name="500"/>
- <keyword name="600"/>
- <keyword name="700"/>
- <keyword name="800"/>
- <keyword name="900"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="mathline">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="panose-1">
- <number name="integer"/>
- </descriptor-def>
- <descriptor-def name="slope">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="src">
- <function name="uri"/>
- <function name="format"/>
- <container name="font-face-name"/>
- </descriptor-def>
- <descriptor-def name="stemh">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="stemv">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="topline">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="unicode-range">
- <string name="urange"/>
- </descriptor-def>
- <descriptor-def name="units-per-em">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="widths">
- <string name="urange"/>
- <number name="length"/>
- </descriptor-def>
- <descriptor-def name="x-height">
- <number name="number"/>
- </descriptor-def>
-
- <!-- container definition : Container is the lump of values.
- It can be used like macros. -->
- <container-def name="absolute-size">
- <keyword name="xx-small"/>
- <keyword name="x-small"/>
- <keyword name="small"/>
- <keyword name="medium"/>
- <keyword name="large"/>
- <keyword name="x-large"/>
- <keyword name="xx-large"/>
- </container-def>
- <container-def name="border-style">
- <keyword name="none"/>
- <keyword name="hidden"/>
- <keyword name="dotted"/>
- <keyword name="dashed"/>
- <keyword name="solid"/>
- <keyword name="double"/>
- <keyword name="groove"/>
- <keyword name="ridge"/>
- <keyword name="inset"/>
- <keyword name="outset"/>
- </container-def>
- <container-def name="border-width">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </container-def>
- <container-def name="color">
- <keyword name="aqua"/>
- <keyword name="black"/>
- <keyword name="blue"/>
- <keyword name="fuchsia"/>
- <keyword name="gray"/>
- <keyword name="green"/>
- <keyword name="lime"/>
- <keyword name="maroon"/>
- <keyword name="navy"/>
- <keyword name="olive"/>
- <keyword name="purple"/>
- <keyword name="red"/>
- <keyword name="silver"/>
- <keyword name="teal"/>
- <keyword name="white"/>
- <keyword name="yellow"/>
- <container name="system-color"/>
- <function name="rgb"/>
- <number name="hash"/>
- </container-def>
- <container-def name="generic-family">
- <keyword name="serif"/>
- <keyword name="sans-serif"/>
- <keyword name="cursive"/>
- <keyword name="fantasy"/>
- <keyword name="monospace"/>
- </container-def>
- <container-def name="font-face-name">
- <function name="local"/>
- </container-def>
- <container-def name="generic-voice">
- <keyword name="male"/>
- <keyword name="female"/>
- <keyword name="child"/>
- </container-def>
- <container-def name="margin-width">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </container-def>
- <container-def name="padding-width">
- <number name="length"/>
- <number name="percentage"/>
- </container-def>
- <container-def name="relative-size">
- <keyword name="smaller"/>
- <keyword name="larger"/>
- </container-def>
- <container-def name="shape">
- <function name="rect"/>
- </container-def>
- <container-def name="system-color">
- <keyword name="ActiveBorder"/>
- <keyword name="ActiveCaption"/>
- <keyword name="AppWorkspace"/>
- <keyword name="Background"/>
- <keyword name="ButtonFace"/>
- <keyword name="ButtonHighlight"/>
- <keyword name="ButtonShadow"/>
- <keyword name="ButtonText"/>
- <keyword name="CaptionText"/>
- <keyword name="GrayText"/>
- <keyword name="Highlight"/>
- <keyword name="HighlightText"/>
- <keyword name="InactiveBorder"/>
- <keyword name="InactiveCaption"/>
- <keyword name="InactiveCaptionText"/>
- <keyword name="InfoBackground"/>
- <keyword name="InfoText"/>
- <keyword name="Menu"/>
- <keyword name="MenuText"/>
- <keyword name="Scrollbar"/>
- <keyword name="ThreeDDarkShadow"/>
- <keyword name="ThreeDFace"/>
- <keyword name="ThreeDHighlight"/>
- <keyword name="ThreeDLightShadow"/>
- <keyword name="ThreeDShadow"/>
- <keyword name="Window"/>
- <keyword name="WindowFrame"/>
- <keyword name="WindowText"/>
- </container-def>
-
- <!-- category definition : This is used to categorize properties
- in Properties View. -->
- <category-def name="aural">
- <caption>%css2.category-def.aural.caption</caption>
- </category-def>
- <category-def name="box">
- <caption>%css2.category-def.box.caption</caption>
- </category-def>
- <category-def name="colorandbackground">
- <caption>%css2.category-def.colorandbackground.caption</caption>
- </category-def>
- <category-def name="content">
- <caption>%css2.category-def.content.caption</caption>
- </category-def>
- <category-def name="font">
- <caption>%css2.category-def.font.caption</caption>
- </category-def>
- <category-def name="page">
- <caption>%css2.category-def.page.caption</caption>
- </category-def>
- <category-def name="tables">
- <caption>%css2.category-def.tables.caption</caption>
- </category-def>
- <category-def name="text">
- <caption>%css2.category-def.text.caption</caption>
- </category-def>
- <category-def name="ui">
- <caption>%css2.category-def.ui.caption</caption>
- </category-def>
- <category-def name="visual">
-<!-- <caption>%css2.category-def.visual.caption</caption>-->
- <caption>%css2.category-def.visual.caption</caption>
- </category-def>
-
- <!-- function definition -->
- <function-def name="attr">
- <function-value>attr</function-value>
- </function-def>
- <function-def name="counter">
- <function-value>counter</function-value>
- </function-def>
- <function-def name="rect">
- <function-value>rect</function-value>
- </function-def>
- <function-def name="rgb">
- <function-value>rgb</function-value>
- </function-def>
- <function-def name="uri">
- <function-value>url</function-value>
- </function-def>
- <function-def name="format">
- <function-value>format</function-value>
- </function-def>
- <function-def name="local">
- <function-value>local</function-value>
- </function-def>
-
- <!-- number definition : What unit types be acceptable for each
- number type? -->
- <number-def name="angle">
- <unit name="deg"/>
- <unit name="grad"/>
- <unit name="rad"/>
- </number-def>
- <number-def name="frequency">
- <unit name="hz"/>
- <unit name="khz"/>
- </number-def>
- <number-def name="hash">
- <unit name="hash"/>
- </number-def>
- <number-def name="integer">
- </number-def>
- <number-def name="length">
- <unit name="em"/>
- <unit name="ex"/>
- <unit name="px"/>
- <unit name="in"/>
- <unit name="cm"/>
- <unit name="mm"/>
- <unit name="pt"/>
- <unit name="pc"/>
- </number-def>
- <number-def name="number">
- </number-def>
- <number-def name="percentage">
- <unit name="percentage"/>
- </number-def>
- <number-def name="time">
- <unit name="ms"/>
- <unit name="s"/>
- </number-def>
-
- <unit-def name="cm">
- <unit-value>cm</unit-value>
- </unit-def>
- <unit-def name="deg">
- <unit-value>deg</unit-value>
- </unit-def>
- <unit-def name="em">
- <unit-value>em</unit-value>
- </unit-def>
- <unit-def name="ex">
- <unit-value>ex</unit-value>
- </unit-def>
- <unit-def name="grad">
- <unit-value>grad</unit-value>
- </unit-def>
- <unit-def name="hash">
- <unit-value>#</unit-value>
- </unit-def>
- <unit-def name="hz">
- <unit-value>Hz</unit-value>
- </unit-def>
- <unit-def name="in">
- <unit-value>in</unit-value>
- </unit-def>
- <unit-def name="khz">
- <unit-value>kHz</unit-value>
- </unit-def>
- <unit-def name="mm">
- <unit-value>mm</unit-value>
- </unit-def>
- <unit-def name="ms">
- <unit-value>ms</unit-value>
- </unit-def>
- <unit-def name="pc">
- <unit-value>pc</unit-value>
- </unit-def>
- <unit-def name="percentage">
- <unit-value>%</unit-value>
- </unit-def>
- <unit-def name="pt">
- <unit-value>pt</unit-value>
- </unit-def>
- <unit-def name="px">
- <unit-value>px</unit-value>
- </unit-def>
- <unit-def name="rad">
- <unit-value>rad</unit-value>
- </unit-def>
- <unit-def name="s">
- <unit-value>s</unit-value>
- </unit-def>
-
- <!-- keywords : string constants (this is last part..) -->
- <keyword-def name="100">
- <keyword-value>100</keyword-value>
- </keyword-def>
- <keyword-def name="200">
- <keyword-value>200</keyword-value>
- </keyword-def>
- <keyword-def name="300">
- <keyword-value>300</keyword-value>
- </keyword-def>
- <keyword-def name="400">
- <keyword-value>400</keyword-value>
- </keyword-def>
- <keyword-def name="500">
- <keyword-value>500</keyword-value>
- </keyword-def>
- <keyword-def name="600">
- <keyword-value>600</keyword-value>
- </keyword-def>
- <keyword-def name="700">
- <keyword-value>700</keyword-value>
- </keyword-def>
- <keyword-def name="800">
- <keyword-value>800</keyword-value>
- </keyword-def>
- <keyword-def name="900">
- <keyword-value>900</keyword-value>
- </keyword-def>
- <keyword-def name="above">
- <keyword-value>above</keyword-value>
- </keyword-def>
- <keyword-def name="absolute">
- <keyword-value>absolute</keyword-value>
- </keyword-def>
- <keyword-def name="ActiveBorder">
- <keyword-value>ActiveBorder</keyword-value>
- </keyword-def>
- <keyword-def name="ActiveCaption">
- <keyword-value>ActiveCaption</keyword-value>
- </keyword-def>
- <keyword-def name="all">
- <keyword-value>all</keyword-value>
- </keyword-def>
- <keyword-def name="always">
- <keyword-value>always</keyword-value>
- </keyword-def>
- <keyword-def name="AppWorkspace">
- <keyword-value>AppWorkspace</keyword-value>
- </keyword-def>
- <keyword-def name="aqua">
- <keyword-value>aqua</keyword-value>
- </keyword-def>
- <keyword-def name="armenian">
- <keyword-value>armenian</keyword-value>
- </keyword-def>
- <keyword-def name="auto">
- <keyword-value>auto</keyword-value>
- </keyword-def>
- <keyword-def name="avoid">
- <keyword-value>avoid</keyword-value>
- </keyword-def>
- <keyword-def name="Background">
- <keyword-value>Background</keyword-value>
- </keyword-def>
- <keyword-def name="baseline">
- <keyword-value>baseline</keyword-value>
- </keyword-def>
- <keyword-def name="behind">
- <keyword-value>behind</keyword-value>
- </keyword-def>
- <keyword-def name="below">
- <keyword-value>below</keyword-value>
- </keyword-def>
- <keyword-def name="bidi-override">
- <keyword-value>bidi-override</keyword-value>
- </keyword-def>
- <keyword-def name="black">
- <keyword-value>black</keyword-value>
- </keyword-def>
- <keyword-def name="blink">
- <keyword-value>blink</keyword-value>
- </keyword-def>
- <keyword-def name="block">
- <keyword-value>block</keyword-value>
- </keyword-def>
- <keyword-def name="blue">
- <keyword-value>blue</keyword-value>
- </keyword-def>
- <keyword-def name="bold">
- <keyword-value>bold</keyword-value>
- </keyword-def>
- <keyword-def name="bolder">
- <keyword-value>bolder</keyword-value>
- </keyword-def>
- <keyword-def name="both">
- <keyword-value>both</keyword-value>
- </keyword-def>
- <keyword-def name="bottom">
- <keyword-value>bottom</keyword-value>
- </keyword-def>
- <keyword-def name="ButtonFace">
- <keyword-value>ButtonFace</keyword-value>
- </keyword-def>
- <keyword-def name="ButtonHighlight">
- <keyword-value>ButtonHighlight</keyword-value>
- </keyword-def>
- <keyword-def name="ButtonShadow">
- <keyword-value>ButtonShadow</keyword-value>
- </keyword-def>
- <keyword-def name="ButtonText">
- <keyword-value>ButtonText</keyword-value>
- </keyword-def>
- <keyword-def name="capitalize">
- <keyword-value>capitalize</keyword-value>
- </keyword-def>
- <keyword-def name="caption">
- <keyword-value>caption</keyword-value>
- </keyword-def>
- <keyword-def name="CaptionText">
- <keyword-value>CaptionText</keyword-value>
- </keyword-def>
- <keyword-def name="center">
- <keyword-value>center</keyword-value>
- </keyword-def>
- <keyword-def name="center-left">
- <keyword-value>center-left</keyword-value>
- </keyword-def>
- <keyword-def name="center-right">
- <keyword-value>center-right</keyword-value>
- </keyword-def>
- <keyword-def name="child">
- <keyword-value>child</keyword-value>
- </keyword-def>
- <keyword-def name="circle">
- <keyword-value>circle</keyword-value>
- </keyword-def>
- <keyword-def name="cjk-ideographic">
- <keyword-value>cjk-ideographic</keyword-value>
- </keyword-def>
- <keyword-def name="close-quote">
- <keyword-value>close-quote</keyword-value>
- </keyword-def>
- <keyword-def name="code">
- <keyword-value>code</keyword-value>
- </keyword-def>
- <keyword-def name="condensed">
- <keyword-value>condensed</keyword-value>
- </keyword-def>
- <keyword-def name="collapse">
- <keyword-value>collapse</keyword-value>
- </keyword-def>
- <keyword-def name="compact">
- <keyword-value>compact</keyword-value>
- </keyword-def>
- <keyword-def name="continuous">
- <keyword-value>continuous</keyword-value>
- </keyword-def>
- <keyword-def name="crop">
- <keyword-value>crop</keyword-value>
- </keyword-def>
- <keyword-def name="cross">
- <keyword-value>cross</keyword-value>
- </keyword-def>
- <keyword-def name="crosshair">
- <keyword-value>crosshair</keyword-value>
- </keyword-def>
- <keyword-def name="cursive">
- <keyword-value>cursive</keyword-value>
- </keyword-def>
- <keyword-def name="dashed">
- <keyword-value>dashed</keyword-value>
- </keyword-def>
- <keyword-def name="decimal">
- <keyword-value>decimal</keyword-value>
- </keyword-def>
- <keyword-def name="decimal-leading-zero">
- <keyword-value>decimal-leading-zero</keyword-value>
- </keyword-def>
- <keyword-def name="default">
- <keyword-value>default</keyword-value>
- </keyword-def>
- <keyword-def name="digits">
- <keyword-value>digits</keyword-value>
- </keyword-def>
- <keyword-def name="disc">
- <keyword-value>disc</keyword-value>
- </keyword-def>
- <keyword-def name="dotted">
- <keyword-value>dotted</keyword-value>
- </keyword-def>
- <keyword-def name="double">
- <keyword-value>double</keyword-value>
- </keyword-def>
- <keyword-def name="e-resize">
- <keyword-value>e-resize</keyword-value>
- </keyword-def>
- <keyword-def name="embed">
- <keyword-value>embed</keyword-value>
- </keyword-def>
- <keyword-def name="expanded">
- <keyword-value>expanded</keyword-value>
- </keyword-def>
- <keyword-def name="extra-condensed">
- <keyword-value>extra-condensed</keyword-value>
- </keyword-def>
- <keyword-def name="extra-expanded">
- <keyword-value>extra-expanded</keyword-value>
- </keyword-def>
- <keyword-def name="fantasy">
- <keyword-value>fantasy</keyword-value>
- </keyword-def>
- <keyword-def name="far-left">
- <keyword-value>far-left</keyword-value>
- </keyword-def>
- <keyword-def name="far-right">
- <keyword-value>far-right</keyword-value>
- </keyword-def>
- <keyword-def name="fast">
- <keyword-value>fast</keyword-value>
- </keyword-def>
- <keyword-def name="faster">
- <keyword-value>faster</keyword-value>
- </keyword-def>
- <keyword-def name="female">
- <keyword-value>female</keyword-value>
- </keyword-def>
- <keyword-def name="fixed">
- <keyword-value>fixed</keyword-value>
- </keyword-def>
- <keyword-def name="fuchsia">
- <keyword-value>fuchsia</keyword-value>
- </keyword-def>
- <keyword-def name="georgian">
- <keyword-value>georgian</keyword-value>
- </keyword-def>
- <keyword-def name="gray">
- <keyword-value>gray</keyword-value>
- </keyword-def>
- <keyword-def name="GrayText">
- <keyword-value>GrayText</keyword-value>
- </keyword-def>
- <keyword-def name="green">
- <keyword-value>green</keyword-value>
- </keyword-def>
- <keyword-def name="groove">
- <keyword-value>groove</keyword-value>
- </keyword-def>
- <keyword-def name="hebrew">
- <keyword-value>hebrew</keyword-value>
- </keyword-def>
- <keyword-def name="help">
- <keyword-value>help</keyword-value>
- </keyword-def>
- <keyword-def name="hidden">
- <keyword-value>hidden</keyword-value>
- </keyword-def>
- <keyword-def name="hide">
- <keyword-value>hide</keyword-value>
- </keyword-def>
- <keyword-def name="high">
- <keyword-value>high</keyword-value>
- </keyword-def>
- <keyword-def name="Highlight">
- <keyword-value>Highlight</keyword-value>
- </keyword-def>
- <keyword-def name="HighlightText">
- <keyword-value>HighlightText</keyword-value>
- </keyword-def>
- <keyword-def name="higher">
- <keyword-value>higher</keyword-value>
- </keyword-def>
- <keyword-def name="hiragana">
- <keyword-value>hiragana</keyword-value>
- </keyword-def>
- <keyword-def name="hiragana-iroha">
- <keyword-value>hiragana-iroha</keyword-value>
- </keyword-def>
- <keyword-def name="icon">
- <keyword-value>icon</keyword-value>
- </keyword-def>
- <keyword-def name="InactiveBorder">
- <keyword-value>InactiveBorder</keyword-value>
- </keyword-def>
- <keyword-def name="InactiveCaption">
- <keyword-value>InactiveCaption</keyword-value>
- </keyword-def>
- <keyword-def name="InactiveCaptionText">
- <keyword-value>InactiveCaptionText</keyword-value>
- </keyword-def>
- <keyword-def name="InfoBackground">
- <keyword-value>InfoBackground</keyword-value>
- </keyword-def>
- <keyword-def name="InfoText">
- <keyword-value>InfoText</keyword-value>
- </keyword-def>
- <keyword-def name="inherit">
- <keyword-value>inherit</keyword-value>
- </keyword-def>
- <keyword-def name="inline">
- <keyword-value>inline</keyword-value>
- </keyword-def>
- <keyword-def name="inline-table">
- <keyword-value>inline-table</keyword-value>
- </keyword-def>
- <keyword-def name="inset">
- <keyword-value>inset</keyword-value>
- </keyword-def>
- <keyword-def name="inside">
- <keyword-value>inside</keyword-value>
- </keyword-def>
- <keyword-def name="invert">
- <keyword-value>invert</keyword-value>
- </keyword-def>
- <keyword-def name="italic">
- <keyword-value>italic</keyword-value>
- </keyword-def>
- <keyword-def name="justify">
- <keyword-value>justify</keyword-value>
- </keyword-def>
- <keyword-def name="katakana">
- <keyword-value>katakana</keyword-value>
- </keyword-def>
- <keyword-def name="katakana-iroha">
- <keyword-value>katakana-iroha</keyword-value>
- </keyword-def>
- <keyword-def name="landscape">
- <keyword-value>landscape</keyword-value>
- </keyword-def>
- <keyword-def name="large">
- <keyword-value>large</keyword-value>
- </keyword-def>
- <keyword-def name="larger">
- <keyword-value>larger</keyword-value>
- </keyword-def>
- <keyword-def name="left">
- <keyword-value>left</keyword-value>
- </keyword-def>
- <keyword-def name="left-side">
- <keyword-value>left-side</keyword-value>
- </keyword-def>
- <keyword-def name="leftwards">
- <keyword-value>leftwards</keyword-value>
- </keyword-def>
- <keyword-def name="level">
- <keyword-value>level</keyword-value>
- </keyword-def>
- <keyword-def name="lighter">
- <keyword-value>lighter</keyword-value>
- </keyword-def>
- <keyword-def name="lime">
- <keyword-value>lime</keyword-value>
- </keyword-def>
- <keyword-def name="line-through">
- <keyword-value>line-through</keyword-value>
- </keyword-def>
- <keyword-def name="list-item">
- <keyword-value>list-item</keyword-value>
- </keyword-def>
- <keyword-def name="loud">
- <keyword-value>loud</keyword-value>
- </keyword-def>
- <keyword-def name="low">
- <keyword-value>low</keyword-value>
- </keyword-def>
- <keyword-def name="lower">
- <keyword-value>lower</keyword-value>
- </keyword-def>
- <keyword-def name="lower-alpha">
- <keyword-value>lower-alpha</keyword-value>
- </keyword-def>
- <keyword-def name="lower-greek">
- <keyword-value>lower-greek</keyword-value>
- </keyword-def>
- <keyword-def name="lower-latin">
- <keyword-value>lower-latin</keyword-value>
- </keyword-def>
- <keyword-def name="lower-roman">
- <keyword-value>lower-roman</keyword-value>
- </keyword-def>
- <keyword-def name="lowercase">
- <keyword-value>lowercase</keyword-value>
- </keyword-def>
- <keyword-def name="ltr">
- <keyword-value>ltr</keyword-value>
- </keyword-def>
- <keyword-def name="male">
- <keyword-value>male</keyword-value>
- </keyword-def>
- <keyword-def name="marker">
- <keyword-value>marker</keyword-value>
- </keyword-def>
- <keyword-def name="maroon">
- <keyword-value>maroon</keyword-value>
- </keyword-def>
- <keyword-def name="medium">
- <keyword-value>medium</keyword-value>
- </keyword-def>
- <keyword-def name="Menu">
- <keyword-value>Menu</keyword-value>
- </keyword-def>
- <keyword-def name="MenuText">
- <keyword-value>MenuText</keyword-value>
- </keyword-def>
- <keyword-def name="message-box">
- <keyword-value>message-box</keyword-value>
- </keyword-def>
- <keyword-def name="middle">
- <keyword-value>middle</keyword-value>
- </keyword-def>
- <keyword-def name="mix">
- <keyword-value>mix</keyword-value>
- </keyword-def>
- <keyword-def name="monospace">
- <keyword-value>monospace</keyword-value>
- </keyword-def>
- <keyword-def name="move">
- <keyword-value>move</keyword-value>
- </keyword-def>
- <keyword-def name="n-resize">
- <keyword-value>n-resize</keyword-value>
- </keyword-def>
- <keyword-def name="narrower">
- <keyword-value>narrower</keyword-value>
- </keyword-def>
- <keyword-def name="navy">
- <keyword-value>navy</keyword-value>
- </keyword-def>
- <keyword-def name="ne-resize">
- <keyword-value>ne-resize</keyword-value>
- </keyword-def>
- <keyword-def name="no-close-quote">
- <keyword-value>no-close-quote</keyword-value>
- </keyword-def>
- <keyword-def name="no-open-quote">
- <keyword-value>no-open-quote</keyword-value>
- </keyword-def>
- <keyword-def name="no-repeat">
- <keyword-value>no-repeat</keyword-value>
- </keyword-def>
- <keyword-def name="none">
- <keyword-value>none</keyword-value>
- </keyword-def>
- <keyword-def name="normal">
- <keyword-value>normal</keyword-value>
- </keyword-def>
- <keyword-def name="nowrap">
- <keyword-value>nowrap</keyword-value>
- </keyword-def>
- <keyword-def name="nw-resize">
- <keyword-value>nw-resize</keyword-value>
- </keyword-def>
- <keyword-def name="oblique">
- <keyword-value>oblique</keyword-value>
- </keyword-def>
- <keyword-def name="olive">
- <keyword-value>olive</keyword-value>
- </keyword-def>
- <keyword-def name="once">
- <keyword-value>once</keyword-value>
- </keyword-def>
- <keyword-def name="open-quote">
- <keyword-value>open-quote</keyword-value>
- </keyword-def>
- <keyword-def name="outset">
- <keyword-value>outset</keyword-value>
- </keyword-def>
- <keyword-def name="outside">
- <keyword-value>outside</keyword-value>
- </keyword-def>
- <keyword-def name="overline">
- <keyword-value>overline</keyword-value>
- </keyword-def>
- <keyword-def name="pointer">
- <keyword-value>pointer</keyword-value>
- </keyword-def>
- <keyword-def name="portrait">
- <keyword-value>portrait</keyword-value>
- </keyword-def>
- <keyword-def name="pre">
- <keyword-value>pre</keyword-value>
- </keyword-def>
- <keyword-def name="purple">
- <keyword-value>purple</keyword-value>
- </keyword-def>
- <keyword-def name="red">
- <keyword-value>red</keyword-value>
- </keyword-def>
- <keyword-def name="relative">
- <keyword-value>relative</keyword-value>
- </keyword-def>
- <keyword-def name="repeat">
- <keyword-value>repeat</keyword-value>
- </keyword-def>
- <keyword-def name="repeat-x">
- <keyword-value>repeat-x</keyword-value>
- </keyword-def>
- <keyword-def name="repeat-y">
- <keyword-value>repeat-y</keyword-value>
- </keyword-def>
- <keyword-def name="ridge">
- <keyword-value>ridge</keyword-value>
- </keyword-def>
- <keyword-def name="right">
- <keyword-value>right</keyword-value>
- </keyword-def>
- <keyword-def name="right-side">
- <keyword-value>right-side</keyword-value>
- </keyword-def>
- <keyword-def name="rightwards">
- <keyword-value>rightwards</keyword-value>
- </keyword-def>
- <keyword-def name="rtl">
- <keyword-value>rtl</keyword-value>
- </keyword-def>
- <keyword-def name="run-in">
- <keyword-value>run-in</keyword-value>
- </keyword-def>
- <keyword-def name="s-resize">
- <keyword-value>s-resize</keyword-value>
- </keyword-def>
- <keyword-def name="sans-serif">
- <keyword-value>sans-serif</keyword-value>
- </keyword-def>
- <keyword-def name="scroll">
- <keyword-value>scroll</keyword-value>
- </keyword-def>
- <keyword-def name="Scrollbar">
- <keyword-value>Scrollbar</keyword-value>
- </keyword-def>
- <keyword-def name="se-resize">
- <keyword-value>se-resize</keyword-value>
- </keyword-def>
- <keyword-def name="semi-condensed">
- <keyword-value>semi-condensed</keyword-value>
- </keyword-def>
- <keyword-def name="semi-expanded">
- <keyword-value>semi-expanded</keyword-value>
- </keyword-def>
- <keyword-def name="separate">
- <keyword-value>separate</keyword-value>
- </keyword-def>
- <keyword-def name="serif">
- <keyword-value>serif</keyword-value>
- </keyword-def>
- <keyword-def name="show">
- <keyword-value>show</keyword-value>
- </keyword-def>
- <keyword-def name="silent">
- <keyword-value>silent</keyword-value>
- </keyword-def>
- <keyword-def name="silver">
- <keyword-value>silver</keyword-value>
- </keyword-def>
- <keyword-def name="slow">
- <keyword-value>slow</keyword-value>
- </keyword-def>
- <keyword-def name="slower">
- <keyword-value>slower</keyword-value>
- </keyword-def>
- <keyword-def name="small">
- <keyword-value>small</keyword-value>
- </keyword-def>
- <keyword-def name="small-caps">
- <keyword-value>small-caps</keyword-value>
- </keyword-def>
- <keyword-def name="small-caption">
- <keyword-value>small-caption</keyword-value>
- </keyword-def>
- <keyword-def name="smaller">
- <keyword-value>smaller</keyword-value>
- </keyword-def>
- <keyword-def name="soft">
- <keyword-value>soft</keyword-value>
- </keyword-def>
- <keyword-def name="solid">
- <keyword-value>solid</keyword-value>
- </keyword-def>
- <keyword-def name="spell-out">
- <keyword-value>spell-out</keyword-value>
- </keyword-def>
- <keyword-def name="square">
- <keyword-value>square</keyword-value>
- </keyword-def>
- <keyword-def name="static">
- <keyword-value>static</keyword-value>
- </keyword-def>
- <keyword-def name="status-bar">
- <keyword-value>status-bar</keyword-value>
- </keyword-def>
- <keyword-def name="sub">
- <keyword-value>sub</keyword-value>
- </keyword-def>
- <keyword-def name="super">
- <keyword-value>super</keyword-value>
- </keyword-def>
- <keyword-def name="sw-resize">
- <keyword-value>sw-resize</keyword-value>
- </keyword-def>
- <keyword-def name="table">
- <keyword-value>table</keyword-value>
- </keyword-def>
- <keyword-def name="table-caption">
- <keyword-value>table-caption</keyword-value>
- </keyword-def>
- <keyword-def name="table-cell">
- <keyword-value>table-cell</keyword-value>
- </keyword-def>
- <keyword-def name="table-column">
- <keyword-value>table-column</keyword-value>
- </keyword-def>
- <keyword-def name="table-column-group">
- <keyword-value>table-column-group</keyword-value>
- </keyword-def>
- <keyword-def name="table-footer-group">
- <keyword-value>table-footer-group</keyword-value>
- </keyword-def>
- <keyword-def name="table-header-group">
- <keyword-value>table-header-group</keyword-value>
- </keyword-def>
- <keyword-def name="table-row">
- <keyword-value>table-row</keyword-value>
- </keyword-def>
- <keyword-def name="table-row-group">
- <keyword-value>table-row-group</keyword-value>
- </keyword-def>
- <keyword-def name="teal">
- <keyword-value>teal</keyword-value>
- </keyword-def>
- <keyword-def name="text">
- <keyword-value>text</keyword-value>
- </keyword-def>
- <keyword-def name="text-top">
- <keyword-value>text-top</keyword-value>
- </keyword-def>
- <keyword-def name="text-bottom">
- <keyword-value>text-bottom</keyword-value>
- </keyword-def>
- <keyword-def name="thick">
- <keyword-value>thick</keyword-value>
- </keyword-def>
- <keyword-def name="thin">
- <keyword-value>thin</keyword-value>
- </keyword-def>
- <keyword-def name="ThreeDDarkShadow">
- <keyword-value>ThreeDDarkShadow</keyword-value>
- </keyword-def>
- <keyword-def name="ThreeDFace">
- <keyword-value>ThreeDFace</keyword-value>
- </keyword-def>
- <keyword-def name="ThreeDHighlight">
- <keyword-value>ThreeDHighlight</keyword-value>
- </keyword-def>
- <keyword-def name="ThreeDLightShadow">
- <keyword-value>ThreeDLightShadow</keyword-value>
- </keyword-def>
- <keyword-def name="ThreeDShadow">
- <keyword-value>ThreeDShadow</keyword-value>
- </keyword-def>
- <keyword-def name="top">
- <keyword-value>top</keyword-value>
- </keyword-def>
- <keyword-def name="transparent">
- <keyword-value>transparent</keyword-value>
- </keyword-def>
- <keyword-def name="ultra-condensed">
- <keyword-value>ultra-condensed</keyword-value>
- </keyword-def>
- <keyword-def name="ultra-expanded">
- <keyword-value>ultra-expanded</keyword-value>
- </keyword-def>
- <keyword-def name="underline">
- <keyword-value>underline</keyword-value>
- </keyword-def>
- <keyword-def name="upper-alpha">
- <keyword-value>upper-alpha</keyword-value>
- </keyword-def>
- <keyword-def name="upper-latin">
- <keyword-value>upper-latin</keyword-value>
- </keyword-def>
- <keyword-def name="upper-roman">
- <keyword-value>upper-roman</keyword-value>
- </keyword-def>
- <keyword-def name="uppercase">
- <keyword-value>uppercase</keyword-value>
- </keyword-def>
- <keyword-def name="visible">
- <keyword-value>visible</keyword-value>
- </keyword-def>
- <keyword-def name="w-resize">
- <keyword-value>w-resize</keyword-value>
- </keyword-def>
- <keyword-def name="wait">
- <keyword-value>wait</keyword-value>
- </keyword-def>
- <keyword-def name="white">
- <keyword-value>white</keyword-value>
- </keyword-def>
- <keyword-def name="wider">
- <keyword-value>wider</keyword-value>
- </keyword-def>
- <keyword-def name="Window">
- <keyword-value>Window</keyword-value>
- </keyword-def>
- <keyword-def name="WindowFrame">
- <keyword-value>WindowFrame</keyword-value>
- </keyword-def>
- <keyword-def name="WindowText">
- <keyword-value>WindowText</keyword-value>
- </keyword-def>
- <keyword-def name="x-fast">
- <keyword-value>x-fast</keyword-value>
- </keyword-def>
- <keyword-def name="x-high">
- <keyword-value>x-high</keyword-value>
- </keyword-def>
- <keyword-def name="x-large">
- <keyword-value>x-large</keyword-value>
- </keyword-def>
- <keyword-def name="x-loud">
- <keyword-value>x-loud</keyword-value>
- </keyword-def>
- <keyword-def name="x-low">
- <keyword-value>x-low</keyword-value>
- </keyword-def>
- <keyword-def name="x-slow">
- <keyword-value>x-slow</keyword-value>
- </keyword-def>
- <keyword-def name="x-small">
- <keyword-value>x-small</keyword-value>
- </keyword-def>
- <keyword-def name="x-soft">
- <keyword-value>x-soft</keyword-value>
- </keyword-def>
- <keyword-def name="xx-small">
- <keyword-value>xx-small</keyword-value>
- </keyword-def>
- <keyword-def name="xx-large">
- <keyword-value>xx-large</keyword-value>
- </keyword-def>
- <keyword-def name="yellow">
- <keyword-value>yellow</keyword-value>
- </keyword-def>
-</css-profile> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml
deleted file mode 100644
index 73b6c1209c..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
- <profile-import name="cssprofile-css2.xml"/>
- <stylesheet-def>
- <description>%mobile1_0.stylesheet-def.description</description>
- <charset-rule/>
- <import-rule/>
- <media-rule/>
- <style-rule/>
- </stylesheet-def>
-
- <!-- Which properties can style rule include ? -->
- <!-- using "overwrite" method: only disabled properties are written. -->
-
- <style-rule-def overwrite="true">
- <selector-expression name="child" enabled="false"/>
- <selector-expression name="adjacent" enabled="false"/>
- <selector-expression name="attribute" enabled="false"/>
- <pseudo-class name="first-child" enabled="false"/>
- <pseudo-class name="link" enabled="false"/>
- <pseudo-class name="active" enabled="false"/>
- <pseudo-class name="lang" enabled="false"/>
- <property name="azimuth" enabled="false"/>
- <property name="border-collapse" enabled="false"/>
- <property name="border-spacing" enabled="false"/>
- <property name="bottom" enabled="false"/>
- <property name="caption-side" enabled="false"/>
- <property name="clip" enabled="false"/>
- <property name="content" enabled="false"/>
- <property name="counter-increment" enabled="false"/>
- <property name="counter-reset" enabled="false"/>
- <property name="cue" enabled="false"/>
- <property name="cue-after" enabled="false"/>
- <property name="cue-before" enabled="false"/>
- <property name="cursor" enabled="false"/>
- <property name="direction" enabled="false"/>
- <property name="elevation" enabled="false"/>
- <property name="empty-cells" enabled="false"/>
- <property name="font-size-adjust" enabled="false"/>
- <property name="font-stretch" enabled="false"/>
- <property name="left" enabled="false"/>
- <property name="letter-spacing" enabled="false"/>
- <property name="line-height" enabled="false"/>
- <property name="marker-offset" enabled="false"/>
- <property name="marks" enabled="false"/>
- <property name="max-height" enabled="false"/>
- <property name="max-width" enabled="false"/>
- <property name="min-height" enabled="false"/>
- <property name="min-width" enabled="false"/>
- <property name="orphans" enabled="false"/>
- <property name="outline" enabled="false"/>
- <property name="outline-color" enabled="false"/>
- <property name="outline-style" enabled="false"/>
- <property name="outline-width" enabled="false"/>
- <property name="overflow" enabled="false"/>
- <property name="page" enabled="false"/>
- <property name="page-break-after" enabled="false"/>
- <property name="page-break-before" enabled="false"/>
- <property name="page-break-inside" enabled="false"/>
- <property name="pause" enabled="false"/>
- <property name="pause-after" enabled="false"/>
- <property name="pause-before" enabled="false"/>
- <property name="pitch" enabled="false"/>
- <property name="pitch-range" enabled="false"/>
- <property name="play-during" enabled="false"/>
- <property name="position" enabled="false"/>
- <property name="quotes" enabled="false"/>
- <property name="richness" enabled="false"/>
- <property name="right" enabled="false"/>
- <property name="size" enabled="false"/>
- <property name="speak" enabled="false"/>
- <property name="speak-header" enabled="false"/>
- <property name="speak-numeral" enabled="false"/>
- <property name="speak-punctuation" enabled="false"/>
- <property name="speech-rate" enabled="false"/>
- <property name="stress" enabled="false"/>
- <property name="table-layout" enabled="false"/>
- <property name="text-shadow" enabled="false"/>
- <property name="top" enabled="false"/>
- <property name="unicode-bidi" enabled="false"/>
- <property name="voice-family" enabled="false"/>
- <property name="volume" enabled="false"/>
- <property name="widows" enabled="false"/>
- <property name="word-spacing" enabled="false"/>
- <property name="z-index" enabled="false"/>
- </style-rule-def>
-
- <!-- property definition -->
- <!-- using "redifine" method: if "overwrite" attribute is set to
- "false" or not set, it means the node is cleanly redifined -->
-
- <property-def name="background-attachment"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <keyword name="scroll"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="display"
- inherited="no" mediagroup="all" category="visual">
- <keyword name="inline"/>
- <keyword name="block"/>
- <keyword name="list-item"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="list-style-type"
- inherited="yes" mediagroup="visual" category="content">
- <keyword name="disc"/>
- <keyword name="circle"/>
- <keyword name="square"/>
- <keyword name="decimal"/>
- <keyword name="lower-roman"/>
- <keyword name="upper-roman"/>
- <keyword name="lower-greek"/>
- <keyword name="lower-alpha"/>
- <keyword name="upper-alpha"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-align"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="center"/>
- <keyword name="justify"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-decoration"
- inherited="no" mediagroup="visual" category="text">
- <keyword name="none"/>
- <keyword name="underline"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="vertical-align"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="baseline"/>
- <keyword name="sub"/>
- <keyword name="super"/>
- <keyword name="inherit"/>
- </property-def>
-
- <!-- container definition : Container is the lump of values.
- It can be used like macros. -->
- <container-def name="color" overwrite="true">
- <container name="system-color" enabled="false"/>
- </container-def>
-</css-profile> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml
deleted file mode 100644
index d3b2a09000..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml
+++ /dev/null
@@ -1,614 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
- <profile-import name="cssprofile-css2.xml"/>
- <stylesheet-def>
- <description>%wap.stylesheet-def.description</description>
- <charset-rule/>
- <import-rule/>
- <media-rule/>
- <style-rule/>
- </stylesheet-def>
-
- <!-- Which properties can style rule include ? -->
- <!-- using "overwrite" method: only disabled properties are written. -->
-
- <style-rule-def overwrite="true">
- <property name="azimuth" enabled="false"/>
- <property name="border-collapse" enabled="false"/>
- <property name="border-spacing" enabled="false"/>
- <property name="bottom" enabled="false"/>
- <property name="caption-side" enabled="false"/>
- <property name="clip" enabled="false"/>
- <property name="content" enabled="false"/>
- <property name="cue" enabled="false"/>
- <property name="cue-after" enabled="false"/>
- <property name="cue-before" enabled="false"/>
- <property name="cursor" enabled="false"/>
- <property name="direction" enabled="false"/>
- <property name="elevation" enabled="false"/>
- <property name="empty-cells" enabled="false"/>
- <property name="font-size-adjust" enabled="false"/>
- <property name="font-stretch" enabled="false"/>
- <property name="left" enabled="false"/>
- <property name="letter-spacing" enabled="false"/>
- <property name="line-height" enabled="false"/>
- <property name="marker-offset" enabled="false"/>
- <property name="marks" enabled="false"/>
- <property name="max-height" enabled="false"/>
- <property name="max-width" enabled="false"/>
- <property name="min-height" enabled="false"/>
- <property name="min-width" enabled="false"/>
- <property name="orphans" enabled="false"/>
- <property name="outline" enabled="false"/>
- <property name="outline-color" enabled="false"/>
- <property name="outline-style" enabled="false"/>
- <property name="outline-width" enabled="false"/>
- <property name="overflow" enabled="false"/>
- <property name="page" enabled="false"/>
- <property name="page-break-after" enabled="false"/>
- <property name="page-break-before" enabled="false"/>
- <property name="page-break-inside" enabled="false"/>
- <property name="pause" enabled="false"/>
- <property name="pause-after" enabled="false"/>
- <property name="pause-before" enabled="false"/>
- <property name="pitch" enabled="false"/>
- <property name="pitch-range" enabled="false"/>
- <property name="play-during" enabled="false"/>
- <property name="position" enabled="false"/>
- <property name="quotes" enabled="false"/>
- <property name="richness" enabled="false"/>
- <property name="right" enabled="false"/>
- <property name="size" enabled="false"/>
- <property name="speak" enabled="false"/>
- <property name="speak-header" enabled="false"/>
- <property name="speak-numeral" enabled="false"/>
- <property name="speak-punctuation" enabled="false"/>
- <property name="speech-rate" enabled="false"/>
- <property name="stress" enabled="false"/>
- <property name="table-layout" enabled="false"/>
- <property name="text-shadow" enabled="false"/>
- <property name="top" enabled="false"/>
- <property name="unicode-bidi" enabled="false"/>
- <property name="voice-family" enabled="false"/>
- <property name="volume" enabled="false"/>
- <property name="widows" enabled="false"/>
- <property name="word-spacing" enabled="false"/>
- <property name="z-index" enabled="false"/>
- <property name="-wap-marquee-style"/>
- <property name="-wap-marquee-loop"/>
- <property name="-wap-marquee-dir"/>
- <property name="-wap-marquee-speed"/>
- <property name="-wap-accesskey"/>
- <property name="-wap-input-format"/>
- <property name="-wap-input-required"/>
- </style-rule-def>
-
- <!-- property definition -->
- <!-- using "redifine" method: if "overwrite" attribute is set to
- "false" or not set, it means the node is cleanly redifined -->
-
- <property-def name="display"
- inherited="no" mediagroup="all" category="visual">
- <keyword name="inline"/>
- <keyword name="block"/>
- <keyword name="list-item"/>
- <keyword name="-wap-marquee"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="list-style-type"
- inherited="yes" mediagroup="visual" category="content">
- <keyword name="disc"/>
- <keyword name="circle"/>
- <keyword name="square"/>
- <keyword name="decimal"/>
- <keyword name="lower-roman"/>
- <keyword name="upper-roman"/>
- <keyword name="lower-alpha"/>
- <keyword name="upper-alpha"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-align"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="center"/>
- <keyword name="justify"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-decoration"
- inherited="no" mediagroup="visual" category="text">
- <keyword name="none"/>
- <keyword name="underline"/>
- <keyword name="blink"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="vertical-align"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="baseline"/>
- <keyword name="sub"/>
- <keyword name="super"/>
- <keyword name="top"/>
- <keyword name="middle"/>
- <keyword name="bottom"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-marquee-style"
- inherited="no" mediagroup="visual" category="wap">
- <keyword name="scroll"/>
- <keyword name="slide"/>
- <keyword name="alternate"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-marquee-loop"
- inherited="no" mediagroup="visual" category="wap">
- <number name="integer"/>
- <keyword name="infinite"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-marquee-dir"
- inherited="no" mediagroup="visual" category="wap">
- <keyword name="ltr"/>
- <keyword name="rtl"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-marquee-speed"
- inherited="no" mediagroup="visual" category="wap">
- <keyword name="slow"/>
- <keyword name="normal"/>
- <keyword name="fast"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-accesskey"
- inherited="no" mediagroup="interactive" category="wap">
- <container name="keycombination"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-input-format"
- inherited="no" mediagroup="interactive" category="wap">
- <container name="format"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-input-required"
- inherited="no" mediagroup="interactive" category="wap">
- <keyword name="true"/>
- <keyword name="false"/>
- <keyword name="inherit"/>
- </property-def>
-
- <!-- container definition : Container is the lump of values.
- It can be used like macros. -->
- <container-def name="color" overwrite="true">
- <container name="system-color" enabled="false"/>
- </container-def>
- <container-def name="format">
- <string name="any"/>
- </container-def>
- <container-def name="keycombination">
- <container name="key"/>
- <keyword name="-"/>
- </container-def>
- <container-def name="key">
- <keyword name="space"/>
- <container name="specialkey"/>
- </container-def>
- <container-def name="specialkey">
- <container name="modifierkey"/>
- <container name="functionkey"/>
- <container name="navigationkey"/>
- <container name="editkey"/>
- <container name="misckey"/>
- <container name="volumecontrolkey"/>
- <container name="applicationkey"/>
- <container name="phonekey"/>
- <container name="vendorkey"/>
- </container-def>
- <container-def name="modifierkey">
- <keyword name="accesskey"/>
- <container name="cmdkey"/>
- <container name="optkey"/>
- <container name="ctrlkey"/>
- <container name="shiftkey"/>
- <container name="altkey"/>
- <container name="winkey"/>
- <container name="metakey"/>
- <keyword name="fn"/>
- <keyword name="fcn"/>
- <keyword name="caps"/>
- </container-def>
- <container-def name="cmdkey">
- <keyword name="cmd"/>
- <keyword name="rcmd"/>
- <keyword name="lcmd"/>
- </container-def>
- <container-def name="optkey">
- <keyword name="opt"/>
- <keyword name="ropt"/>
- <keyword name="lopt"/>
- </container-def>
- <container-def name="ctrlkey">
- <keyword name="ctrl"/>
- <keyword name="rctrl"/>
- <keyword name="lctrl"/>
- </container-def>
- <container-def name="shiftkey">
- <keyword name="shift"/>
- <keyword name="rshift"/>
- <keyword name="lshift"/>
- </container-def>
- <container-def name="altkey">
- <keyword name="alt"/>
- <keyword name="ralt"/>
- <keyword name="lalt"/>
- </container-def>
- <container-def name="winkey">
- <keyword name="win"/>
- <keyword name="rwin"/>
- <keyword name="lwin"/>
- </container-def>
- <container-def name="metakey">
- <keyword name="meta"/>
- <keyword name="rmeta"/>
- <keyword name="lmeta"/>
- </container-def>
- <container-def name="functionkey">
- <keyword name="f1"/>
- <keyword name="f2"/>
- <keyword name="f3"/>
- <keyword name="f4"/>
- <keyword name="f5"/>
- <keyword name="f6"/>
- <keyword name="f7"/>
- <keyword name="f8"/>
- <keyword name="f9"/>
- <keyword name="f10"/>
- <keyword name="f11"/>
- <keyword name="f12"/>
- <keyword name="f13"/>
- <keyword name="f14"/>
- <keyword name="f15"/>
- </container-def>
- <container-def name="navigationkey">
- <keyword name="tab"/>
- <keyword name="esc"/>
- <keyword name="enter"/>
- <keyword name="return"/>
- <keyword name="menu"/>
- <keyword name="help"/>
- <keyword name="namemenu"/>
- <keyword name="rcl"/>
- <keyword name="snd"/>
- <keyword name="arrowkey"/>
- <keyword name="pagekey"/>
- </container-def>
- <container-def name="arrowkey">
- <keyword name="up"/>
- <keyword name="down"/>
- <keyword name="left"/>
- <keyword name="right"/>
- </container-def>
- <container-def name="pagekey">
- <keyword name="home"/>
- <keyword name="end"/>
- <keyword name="pgup"/>
- <keyword name="pgdn"/>
- </container-def>
- <container-def name="editkey">
- <keyword name="bs"/>
- <keyword name="del"/>
- <keyword name="ins"/>
- <keyword name="undo"/>
- <keyword name="cut"/>
- <keyword name="copy"/>
- <keyword name="paste"/>
- <keyword name="clr"/>
- <keyword name="sto"/>
- </container-def>
- <container-def name="misckey">
- <keyword name="prtsc"/>
- <keyword name="sysrq"/>
- <keyword name="scrlock"/>
- <keyword name="pause"/>
- <keyword name="brk"/>
- <keyword name="numlock"/>
- <keyword name="pwr"/>
- </container-def>
- <container-def name="volumecontrolkey">
- <keyword name="volumeup"/>
- <keyword name="volumedown"/>
- </container-def>
- <container-def name="applicationkey">
- <keyword name="memo"/>
- <keyword name="todo"/>
- <keyword name="calendar"/>
- <keyword name="mail"/>
- <keyword name="address"/>
- </container-def>
- <container-def name="phonekey">
- <keyword name="phone-send"/>
- <keyword name="phone-end"/>
- <keyword name="phone-accept"/>
- </container-def>
- <container-def name="vendorkey">
- <keyword name="vnd."/>
- </container-def>
-
- <category-def name="wap">
- <caption>%wap.category-def.wap.caption</caption>
- </category-def>
-
- <number-def name="length">
- <unit name="em"/>
- <unit name="ex"/>
- <unit name="px"/>
- </number-def>
-
- <keyword-def name="-wap-marquee">
- <keyword-value>-wap-marquee</keyword-value>
- </keyword-def>
- <keyword-def name="slide">
- <keyword-value>slide</keyword-value>
- </keyword-def>
- <keyword-def name="alternate">
- <keyword-value>alternate</keyword-value>
- </keyword-def>
- <keyword-def name="infinite">
- <keyword-value>infinite</keyword-value>
- </keyword-def>
- <keyword-def name="-">
- <keyword-value>-</keyword-value>
- </keyword-def>
- <keyword-def name="space">
- <keyword-value>space</keyword-value>
- </keyword-def>
- <keyword-def name="accesskey">
- <keyword-value>accesskey</keyword-value>
- </keyword-def>
- <keyword-def name="fn">
- <keyword-value>fn</keyword-value>
- </keyword-def>
- <keyword-def name="fcn">
- <keyword-value>fcn</keyword-value>
- </keyword-def>
- <keyword-def name="caps">
- <keyword-value>caps</keyword-value>
- </keyword-def>
- <keyword-def name="cmd">
- <keyword-value>cmd</keyword-value>
- </keyword-def>
- <keyword-def name="rcmd">
- <keyword-value>rcmd</keyword-value>
- </keyword-def>
- <keyword-def name="lcmd">
- <keyword-value>lcmd</keyword-value>
- </keyword-def>
- <keyword-def name="opt">
- <keyword-value>opt</keyword-value>
- </keyword-def>
- <keyword-def name="ropt">
- <keyword-value>ropt</keyword-value>
- </keyword-def>
- <keyword-def name="lopt">
- <keyword-value>lopt</keyword-value>
- </keyword-def>
- <keyword-def name="ctrl">
- <keyword-value>ctrl</keyword-value>
- </keyword-def>
- <keyword-def name="rctrl">
- <keyword-value>rctrl</keyword-value>
- </keyword-def>
- <keyword-def name="lctrl">
- <keyword-value>lctrl</keyword-value>
- </keyword-def>
- <keyword-def name="shift">
- <keyword-value>shift</keyword-value>
- </keyword-def>
- <keyword-def name="rshift">
- <keyword-value>rshift</keyword-value>
- </keyword-def>
- <keyword-def name="lshift">
- <keyword-value>lshift</keyword-value>
- </keyword-def>
- <keyword-def name="alt">
- <keyword-value>alt</keyword-value>
- </keyword-def>
- <keyword-def name="ralt">
- <keyword-value>ralt</keyword-value>
- </keyword-def>
- <keyword-def name="lalt">
- <keyword-value>lalt</keyword-value>
- </keyword-def>
- <keyword-def name="win">
- <keyword-value>win</keyword-value>
- </keyword-def>
- <keyword-def name="rwin">
- <keyword-value>rwin</keyword-value>
- </keyword-def>
- <keyword-def name="lwin">
- <keyword-value>lwin</keyword-value>
- </keyword-def>
- <keyword-def name="meta">
- <keyword-value>meta</keyword-value>
- </keyword-def>
- <keyword-def name="rmeta">
- <keyword-value>rmeta</keyword-value>
- </keyword-def>
- <keyword-def name="lmeta">
- <keyword-value>lmeta</keyword-value>
- </keyword-def>
- <keyword-def name="f1">
- <keyword-value>f1</keyword-value>
- </keyword-def>
- <keyword-def name="f2">
- <keyword-value>f2</keyword-value>
- </keyword-def>
- <keyword-def name="f3">
- <keyword-value>f3</keyword-value>
- </keyword-def>
- <keyword-def name="f4">
- <keyword-value>f4</keyword-value>
- </keyword-def>
- <keyword-def name="f5">
- <keyword-value>f5</keyword-value>
- </keyword-def>
- <keyword-def name="f6">
- <keyword-value>f6</keyword-value>
- </keyword-def>
- <keyword-def name="f7">
- <keyword-value>f7</keyword-value>
- </keyword-def>
- <keyword-def name="f8">
- <keyword-value>f8</keyword-value>
- </keyword-def>
- <keyword-def name="f9">
- <keyword-value>f9</keyword-value>
- </keyword-def>
- <keyword-def name="f10">
- <keyword-value>f10</keyword-value>
- </keyword-def>
- <keyword-def name="f11">
- <keyword-value>f11</keyword-value>
- </keyword-def>
- <keyword-def name="f12">
- <keyword-value>f12</keyword-value>
- </keyword-def>
- <keyword-def name="f13">
- <keyword-value>f13</keyword-value>
- </keyword-def>
- <keyword-def name="f14">
- <keyword-value>f14</keyword-value>
- </keyword-def>
- <keyword-def name="f15">
- <keyword-value>f15</keyword-value>
- </keyword-def>
- <keyword-def name="tab">
- <keyword-value>tab</keyword-value>
- </keyword-def>
- <keyword-def name="esc">
- <keyword-value>esc</keyword-value>
- </keyword-def>
- <keyword-def name="enter">
- <keyword-value>enter</keyword-value>
- </keyword-def>
- <keyword-def name="return">
- <keyword-value>return</keyword-value>
- </keyword-def>
- <keyword-def name="namemenu">
- <keyword-value>namemenu</keyword-value>
- </keyword-def>
- <keyword-def name="rcl">
- <keyword-value>rcl</keyword-value>
- </keyword-def>
- <keyword-def name="snd">
- <keyword-value>snd</keyword-value>
- </keyword-def>
- <keyword-def name="arrowkey">
- <keyword-value>arrowkey</keyword-value>
- </keyword-def>
- <keyword-def name="pagekey">
- <keyword-value>pagekey</keyword-value>
- </keyword-def>
- <keyword-def name="up">
- <keyword-value>up</keyword-value>
- </keyword-def>
- <keyword-def name="down">
- <keyword-value>down</keyword-value>
- </keyword-def>
- <keyword-def name="home">
- <keyword-value>home</keyword-value>
- </keyword-def>
- <keyword-def name="end">
- <keyword-value>end</keyword-value>
- </keyword-def>
- <keyword-def name="pgup">
- <keyword-value>pgup</keyword-value>
- </keyword-def>
- <keyword-def name="pgdn">
- <keyword-value>pgdn</keyword-value>
- </keyword-def>
- <keyword-def name="bs">
- <keyword-value>bs</keyword-value>
- </keyword-def>
- <keyword-def name="del">
- <keyword-value>del</keyword-value>
- </keyword-def>
- <keyword-def name="ins">
- <keyword-value>ins</keyword-value>
- </keyword-def>
- <keyword-def name="undo">
- <keyword-value>undo</keyword-value>
- </keyword-def>
- <keyword-def name="cut">
- <keyword-value>cut</keyword-value>
- </keyword-def>
- <keyword-def name="copy">
- <keyword-value>copy</keyword-value>
- </keyword-def>
- <keyword-def name="paste">
- <keyword-value>paste</keyword-value>
- </keyword-def>
- <keyword-def name="clr">
- <keyword-value>clr</keyword-value>
- </keyword-def>
- <keyword-def name="sto">
- <keyword-value>sto</keyword-value>
- </keyword-def>
- <keyword-def name="prtsc">
- <keyword-value>prtsc</keyword-value>
- </keyword-def>
- <keyword-def name="sysrq">
- <keyword-value>sysrq</keyword-value>
- </keyword-def>
- <keyword-def name="scrlock">
- <keyword-value>scrlock</keyword-value>
- </keyword-def>
- <keyword-def name="brk">
- <keyword-value>brk</keyword-value>
- </keyword-def>
- <keyword-def name="numlock">
- <keyword-value>numlock</keyword-value>
- </keyword-def>
- <keyword-def name="pwr">
- <keyword-value>pwr</keyword-value>
- </keyword-def>
- <keyword-def name="volumeup">
- <keyword-value>volumeup</keyword-value>
- </keyword-def>
- <keyword-def name="volumedown">
- <keyword-value>volumedown</keyword-value>
- </keyword-def>
- <keyword-def name="memo">
- <keyword-value>memo</keyword-value>
- </keyword-def>
- <keyword-def name="todo">
- <keyword-value>todo</keyword-value>
- </keyword-def>
- <keyword-def name="calendar">
- <keyword-value>calendar</keyword-value>
- </keyword-def>
- <keyword-def name="mail">
- <keyword-value>mail</keyword-value>
- </keyword-def>
- <keyword-def name="address">
- <keyword-value>address</keyword-value>
- </keyword-def>
- <keyword-def name="phone-send">
- <keyword-value>phone-send</keyword-value>
- </keyword-def>
- <keyword-def name="phone-end">
- <keyword-value>phone-end</keyword-value>
- </keyword-def>
- <keyword-def name="phone-accept">
- <keyword-value>phone-accept</keyword-value>
- </keyword-def>
- <keyword-def name="vnd.">
- <keyword-value>vnd.</keyword-value>
- </keyword-def>
- <keyword-def name="true">
- <keyword-value>true</keyword-value>
- </keyword-def>
- <keyword-def name="false">
- <keyword-value>false</keyword-value>
- </keyword-def>
-</css-profile> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties
deleted file mode 100644
index dd7e399c94..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# cssprofile-css1.xml
-css1.stylesheet-def.description=Cascading Style Sheets, level 1
-css1.category-def.box.caption=Box model
-css1.category-def.colorandbackground.caption=Colors and Backgrounds
-css1.category-def.classification.caption=Classification
-css1.category-def.font.caption=Font
-css1.category-def.text.caption=Text
-# cssprofile-css2.xml
-css2.stylesheet-def.description=Cascading Style Sheets, level 2
-css2.category-def.aural.caption=Aural
-css2.category-def.box.caption=Box model
-css2.category-def.colorandbackground.caption=Colors and Backgrounds
-css2.category-def.content.caption=Generated content/List
-css2.category-def.font.caption=Fonts
-css2.category-def.page.caption=Paged media
-css2.category-def.tables.caption=Tables
-css2.category-def.text.caption=Text
-css2.category-def.visual.caption=Visual
-css2.category-def.ui.caption=User interface
-# cssprofile-mobile1_0.xml
-mobile1_0.stylesheet-def.description=CSS Mobile Profile 1.0
-# cssprofile-wap.xml
-wap.stylesheet-def.description=WCSS 1.0
-wap.category-def.wap.caption=WCSS Extensions
diff --git a/bundles/org.eclipse.wst.css.core/plugin.properties b/bundles/org.eclipse.wst.css.core/plugin.properties
deleted file mode 100644
index 941ff800e7..0000000000
--- a/bundles/org.eclipse.wst.css.core/plugin.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Source CSS Model
-nlFeatureName=Structured Source CSS Model NL Support
-cssprofile_css2.name=CSS2: Cascading Style Sheets, level 2
-cssprofile_css1.name=CSS1: Cascading Style Sheets, level 1
-cssprofile_mobile1_0.name=CSS Mobile Profile 1.0
-cssprofile_wap.name=WCSS 1.0
-Structured_CSS_Document_Factory_Extension.name=Structured CSS Document Factory Extension
-CSS_Content_Type_Extension_Element.name=CSS Content Type
diff --git a/bundles/org.eclipse.wst.css.core/plugin.xml b/bundles/org.eclipse.wst.css.core/plugin.xml
deleted file mode 100644
index 13d9f460bb..0000000000
--- a/bundles/org.eclipse.wst.css.core/plugin.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.css.core"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.wst.css.core.internal.CSSCorePlugin">
-
- <runtime>
- <library name="cssmodel.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.wst.common.encoding"/>
- <import plugin="org.eclipse.wst.sse.ui"/>
- <import plugin="org.eclipse.wst.xml.core"/>
- <import plugin="org.eclipse.wst.sse.core"/>
- </requires>
-
- <extension
- point="org.eclipse.wst.sse.core.cssprofile">
- <profile
- name="%cssprofile_css2.name"
- default="true"
- uri="cssprofile/cssprofile-css2.xml"
- id="org.eclipse.wst.css.core.cssprofile.css2">
- </profile>
- <profile
- name="%cssprofile_css1.name"
- uri="cssprofile/cssprofile-css1.xml"
- id="org.eclipse.wst.css.core.cssprofile.css1">
- </profile>
- <profile
- name="%cssprofile_mobile1_0.name"
- uri="cssprofile/cssprofile-mobile1_0.xml"
- id="org.eclipse.wst.css.core.cssprofile.mobile1_0">
- </profile>
- <profile
- name="%cssprofile_wap.name"
- uri="cssprofile/cssprofile-wap.xml"
- id="org.eclipse.wst.css.core.cssprofile.wap">
- </profile>
- </extension>
- <extension
- point="org.eclipse.wst.sse.core.modelHandler">
- <modelHandler
- class="org.eclipse.wst.css.core.modelhandler.ModelHandlerForCSS"
- associatedContentTypeId="org.eclipse.wst.css.core.csssource"
- id="org.eclipse.wst.css.core.modelhandler">
- </modelHandler>
- </extension>
- <extension
- id="org.eclipse.wst.css.core.builderdelegate.todo"
- point="org.eclipse.wst.sse.core.builderdelegate">
- <participant
- class="org.eclipse.wst.css.core.internal.tasks.CSSTaskTagSeeker"
- contentType="org.eclipse.wst.css.core.csssource">
- </participant>
- </extension>
- <extension point="org.eclipse.core.filebuffers.documentCreation"
- id="org.eclipse.wst.css.core.documentfactories"
- name="%Structured_CSS_Document_Factory_Extension.name">
- <factory
- contentTypeId="org.eclipse.wst.css.core.csssource"
- class="org.eclipse.wst.sse.core.filebuffers.BasicStructuredDocumentFactory"/>
- </extension>
- <extension
- point="org.eclipse.team.core.fileTypes">
- <fileTypes
- type="text"
- extension="css">
- </fileTypes>
- </extension>
- <extension
- point="org.eclipse.wst.sse.core.formatProcessors">
- <processor
- class="org.eclipse.wst.css.core.format.FormatProcessorCSS"
- contentTypeId="org.eclipse.wst.css.core.csssource">
- </processor>
- </extension>
- <extension
- point="org.eclipse.core.runtime.contentTypes">
- <content-type
- file-extensions="css"
- priority="high"
- name="%CSS_Content_Type_Extension_Element.name"
- id="csssource"
- base-type="org.eclipse.core.runtime.text">
- <describer class="org.eclipse.wst.css.core.internal.content.ContentDescriberForCSS"/>
- </content-type>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/CSSCorePlugin.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/CSSCorePlugin.java
deleted file mode 100644
index 5896c163f5..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/CSSCorePlugin.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.css.core;
-
-/**
- * @deprecated use internal CSSCorePlugin class instead if possible
- */
-public class CSSCorePlugin extends
- org.eclipse.wst.css.core.internal.CSSCorePlugin {
- // see org.eclipse.wst.css.core.internal.CSSCorePlugin
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/ICSSModelAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/ICSSModelAdapter.java
deleted file mode 100644
index c9095174df..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/ICSSModelAdapter.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.adapters;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.sse.core.INodeAdapter;
-
-
-/**
- */
-public interface ICSSModelAdapter extends INodeAdapter {
-
- ICSSModel getModel();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IModelProvideAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IModelProvideAdapter.java
deleted file mode 100644
index b40be5ec5e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IModelProvideAdapter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.adapters;
-
-
-
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.IStructuredModel;
-
-/**
- *
- */
-public interface IModelProvideAdapter extends INodeAdapter {
-
- /**
- *
- */
- void modelProvided(IStructuredModel newModel);
-
- /**
- */
- void modelReleased(IStructuredModel newModel);
-
- /**
- */
- void modelRemoved(IStructuredModel newModel);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleDeclarationAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleDeclarationAdapter.java
deleted file mode 100644
index 967d8d87b7..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleDeclarationAdapter.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.adapters;
-
-
-
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-
-/**
- */
-public interface IStyleDeclarationAdapter extends ICSSModelAdapter {
-
- /**
- */
- public CSSStyleDeclaration getStyle();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSelectorAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSelectorAdapter.java
deleted file mode 100644
index b163d2701a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSelectorAdapter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.adapters;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSSimpleSelector;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.w3c.dom.Element;
-
-
-/**
- *
- */
-public interface IStyleSelectorAdapter extends INodeAdapter {
-
- /**
- * @return boolean
- * @param element
- * org.w3c.dom.Element
- * @param pseudoName
- * java.lang.String
- */
- boolean match(ICSSSimpleSelector selector, Element element, String pseudoName);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSheetAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSheetAdapter.java
deleted file mode 100644
index 33e09d258d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSheetAdapter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.adapters;
-
-
-
-import org.w3c.dom.Element;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- */
-public interface IStyleSheetAdapter extends ICSSModelAdapter {
-
- /**
- * Returns HTML/XML element that is the owner of this adapter
- */
- Element getElement();
-
- /**
- * Returns CSS document that is related to this element
- */
- public StyleSheet getSheet();
-
- /**
- * This is called at the time of releasing HTML/XML model
- */
- public void released();
-
- /**
- * This is called at the time of removing this Element from the document
- */
- public void removed();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSheetListAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSheetListAdapter.java
deleted file mode 100644
index 418db30cff..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/adapters/IStyleSheetListAdapter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.adapters;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- */
-public interface IStyleSheetListAdapter extends INodeAdapter {
-
- /**
- */
- Enumeration getClasses();
-
- /**
- */
- public CSSStyleDeclaration getOverrideStyle(Element element, String pseudoName);
-
- /**
- */
- public StyleSheetList getStyleSheets();
-
- /**
- */
- public void releaseStyleSheets();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CSSCleanupStrategy.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CSSCleanupStrategy.java
deleted file mode 100644
index ccbb10c44c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CSSCleanupStrategy.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.cleanup;
-
-
-
-public interface CSSCleanupStrategy {
-
- static final short ASIS = 0;
- static final short LOWER = 1;
- static final short UPPER = 2;
-
- /**
- *
- * @return short
- */
- short getIdentCase();
-
- /**
- *
- * @return short
- */
- short getPropNameCase();
-
- /**
- *
- * @return short
- */
- short getPropValueCase();
-
- /**
- *
- * @return short
- */
- short getSelectorTagCase();
-
- /**
- *
- * @return boolean
- */
- boolean isFormatSource();
-
- /**
- *
- * @return boolean
- */
- boolean isQuoteValues();
-
- /**
- *
- * @param formatSource
- * boolean
- */
- void setFormatSource(boolean formatSource);
-
- /**
- *
- * @param identCase
- * short
- */
- void setIdentCase(short identCase);
-
- /**
- *
- * @param propNameCase
- * short
- */
- void setPropNameCase(short propNameCase);
-
- /**
- *
- * @param propValueCase
- * short
- */
- void setPropValueCase(short propValueCase);
-
- /**
- *
- * @param quoteValues
- * boolean
- */
- void setQuoteValues(boolean quoteValues);
-
- /**
- *
- * @param selectorTagCase
- * short
- */
- void setSelectorTagCase(short selectorTagCase);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CSSCleanupStrategyImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CSSCleanupStrategyImpl.java
deleted file mode 100644
index 5907b394e8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CSSCleanupStrategyImpl.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.preferences.CSSModelPreferenceNames;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-
-
-
-public class CSSCleanupStrategyImpl implements CSSCleanupStrategy {
-
- static private CSSCleanupStrategy instance = null;
- // initialize with defaults
- protected short fIdentCase = ASIS;
- protected short fPropNameCase = ASIS;
- protected short fPropValueCase = ASIS;
- protected short fSelectorTagCase = UPPER;
- protected boolean fQuoteValues = true;
- protected boolean fFormatSource = true;
-
- /**
- * CSSCleanupStrategyImpl constructor comment.
- */
- protected CSSCleanupStrategyImpl() {
- super();
- initialize();
- }
-
- /**
- *
- * @return short
- */
- public short getIdentCase() {
- return fIdentCase;
- }
-
- /**
- *
- * @return org.eclipse.wst.css.core.cleanup.CSSCleanupStrategy
- */
- public synchronized static CSSCleanupStrategy getInstance() {
- if (instance == null)
- instance = new CSSCleanupStrategyImpl();
- return instance;
- }
-
- /**
- *
- * @return short
- */
- public short getPropNameCase() {
- return fPropNameCase;
- }
-
- /**
- *
- * @return short
- */
- public short getPropValueCase() {
- return fPropValueCase;
- }
-
- /**
- *
- * @return short
- */
- public short getSelectorTagCase() {
- return fSelectorTagCase;
- }
-
- /**
- *
- */
- private void initialize() {
- Preferences prefs = CSSCorePlugin.getDefault().getPluginPreferences();
- fIdentCase = getCleanupCaseValue(prefs.getInt(CSSModelPreferenceNames.CLEANUP_CASE_IDENTIFIER));
- fPropNameCase = getCleanupCaseValue(prefs.getInt(CSSModelPreferenceNames.CLEANUP_CASE_PROPERTY_NAME));
- fPropValueCase = getCleanupCaseValue(prefs.getInt(CSSModelPreferenceNames.CLEANUP_CASE_PROPERTY_VALUE));
- fSelectorTagCase = getCleanupCaseValue(prefs.getInt(CSSModelPreferenceNames.CLEANUP_CASE_SELECTOR));
- fQuoteValues = prefs.getBoolean(CommonModelPreferenceNames.QUOTE_ATTR_VALUES);
- fFormatSource = prefs.getBoolean(CommonModelPreferenceNames.FORMAT_SOURCE);
- }
-
- /**
- * Return the CSSCleanupStrategy equivalent case short value when given an
- * int
- *
- * @param value
- * @return equivalent case short or ASIS if cannot be determined
- */
- private short getCleanupCaseValue(int value) {
- switch (value) {
- case CommonModelPreferenceNames.LOWER :
- return LOWER;
- case CommonModelPreferenceNames.UPPER :
- return UPPER;
- }
- return ASIS;
- }
-
- /**
- *
- * @return boolean
- */
- public boolean isFormatSource() {
- return fFormatSource;
- }
-
- /**
- *
- * @return boolean
- */
- public boolean isQuoteValues() {
- return fQuoteValues;
- }
-
- /**
- *
- * @param formatSource
- * boolean
- */
- public void setFormatSource(boolean formatSource) {
- fFormatSource = formatSource;
- }
-
- /**
- *
- * @param identCase
- * short
- */
- public void setIdentCase(short identCase) {
- fIdentCase = identCase;
- }
-
- /**
- *
- * @param propNameCase
- * short
- */
- public void setPropNameCase(short propNameCase) {
- fPropNameCase = propNameCase;
- }
-
- /**
- *
- * @param propValueCase
- * short
- */
- public void setPropValueCase(short propValueCase) {
- fPropValueCase = propValueCase;
- }
-
- /**
- *
- * @param quoteValues
- * boolean
- */
- public void setQuoteValues(boolean quoteValues) {
- fQuoteValues = quoteValues;
- }
-
- /**
- *
- * @param selectorTagCase
- * short
- */
- public void setSelectorTagCase(short selectorTagCase) {
- fSelectorTagCase = selectorTagCase;
- }
-
- // TODO: a saveOptions should be added to CSSCleanupStrategy interface
- public void saveOptions() {
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSModelPreferenceNames.CLEANUP_CASE_IDENTIFIER, fIdentCase);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSModelPreferenceNames.CLEANUP_CASE_PROPERTY_NAME, fPropNameCase);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSModelPreferenceNames.CLEANUP_CASE_PROPERTY_VALUE, fPropValueCase);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSModelPreferenceNames.CLEANUP_CASE_SELECTOR, fSelectorTagCase);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CommonModelPreferenceNames.QUOTE_ATTR_VALUES, fQuoteValues);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CommonModelPreferenceNames.FORMAT_SOURCE, fFormatSource);
- CSSCorePlugin.getDefault().savePluginPreferences();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CleanupProcessorCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CleanupProcessorCSS.java
deleted file mode 100644
index 9a5deac639..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/cleanup/CleanupProcessorCSS.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.cleanup;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.css.core.document.ICSSDocument;
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.formatter.CSSFormatUtil;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.core.cleanup.AbstractStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.sse.core.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.w3c.dom.Node;
-
-
-public class CleanupProcessorCSS extends AbstractStructuredCleanupProcessor {
-
- public void cleanupModel(IStructuredModel structuredModel, int start, int length) {
- CSSFormatUtil formatUtil = CSSFormatUtil.getInstance();
- if (structuredModel instanceof ICSSModel) {
- ICSSDocument doc = ((ICSSModel) structuredModel).getDocument();
- CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) doc);
- StringBuffer buf = formatter.cleanup(doc);
- if (buf != null) {
- int startOffset = ((IndexedRegion) doc).getStartOffset();
- int endOffset = ((IndexedRegion) doc).getEndOffset();
- formatUtil.replaceSource(doc.getModel(), startOffset, endOffset - startOffset, buf.toString());
- }
- }
- else if (structuredModel instanceof XMLModel) {
- List cssnodes = formatUtil.collectCSSNodes(structuredModel, start, length);
- if (cssnodes != null && !cssnodes.isEmpty()) {
- ICSSModel model = null;
- for (int i = 0; i < cssnodes.size(); i++) {
- ICSSNode node = (ICSSNode) cssnodes.get(i);
- CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) node);
- StringBuffer buf = formatter.cleanup(node);
- if (buf != null) {
- int startOffset = ((IndexedRegion) node).getStartOffset();
- int endOffset = ((IndexedRegion) node).getEndOffset();
- if (model == null) {
- model = node.getOwnerDocument().getModel();
- }
- formatUtil.replaceSource(model, startOffset, endOffset - startOffset, buf.toString());
- }
- }
- }
- }
- }
-
- protected String getContentType() {
- return ContentTypeIdForCSS.ContentTypeID_CSS;
- }
-
- public void cleanupModel(IStructuredModel structuredModel) {
- int start = 0;
- int length = structuredModel.getStructuredDocument().getLength();
-
- cleanupModel(structuredModel, start, length);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.cleanup.IStructuredCleanupProcessor#cleanupDocument(org.eclipse.jface.text.IDocument)
- */
- public void cleanupDocument(IDocument document) throws IOException, CoreException {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.cleanup.IStructuredCleanupProcessor#cleanupDocument(org.eclipse.jface.text.IDocument,
- * int, int)
- */
- public void cleanupDocument(IDocument document, int start, int length) throws IOException, CoreException {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.cleanup.AbstractStructuredCleanupProcessor#getCleanupHandler(org.w3c.dom.Node)
- */
- protected IStructuredCleanupHandler getCleanupHandler(Node node) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.cleanup.AbstractStructuredCleanupProcessor#getFormatProcessor()
- */
- protected IStructuredFormatProcessor getFormatProcessor() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.cleanup.AbstractStructuredCleanupProcessor#refreshCleanupPreferences()
- */
- protected void refreshCleanupPreferences() {
- // TODO Auto-generated method stub
-
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSAccess.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSAccess.java
deleted file mode 100644
index f05ef5a504..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSAccess.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import java.util.Vector;
-
-/**
- *
- */
-public interface ICSSAccess {
-
- /**
- * @return java.util.Vector
- */
- Vector getClassNames();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSAttr.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSAttr.java
deleted file mode 100644
index 087d93b525..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSAttr.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-/**
- *
- */
-public interface ICSSAttr extends ICSSNode {
-
- /**
- * @return java.lang.String
- */
- String getName();
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- ICSSNode getOwnerCSSNode();
-
- /**
- * @return java.lang.String
- */
- String getValue();
-
- /**
- * @param newValue
- * java.lang.String
- */
- void setValue(String newValue);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSCharsetRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSCharsetRule.java
deleted file mode 100644
index b861262a5a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSCharsetRule.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSCharsetRule;
-
-/**
- *
- */
-public interface ICSSCharsetRule extends ICSSNode, CSSCharsetRule {
-
- java.lang.String ENCODING = "encoding"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSDocument.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSDocument.java
deleted file mode 100644
index 8d70e3a490..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSDocument.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSUnknownRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-/**
- *
- */
-public interface ICSSDocument extends ICSSNode {
-
- /**
- * @return org.w3c.dom.css.CSSCharsetRule
- */
- ICSSCharsetRule createCSSCharsetRule();
-
- /**
- * @return org.w3c.dom.css.CSSFontFaceRule
- */
- CSSFontFaceRule createCSSFontFaceRule();
-
- /**
- * @return org.w3c.dom.css.CSSImportRule
- */
- ICSSImportRule createCSSImportRule();
-
- /**
- * @return org.w3c.dom.css.ICSSMediaRule
- */
- ICSSMediaRule createCSSMediaRule();
-
- /**
- * @return org.w3c.dom.css.CSSPageRule
- */
- ICSSPageRule createCSSPageRule();
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- */
- ICSSPrimitiveValue createCSSPrimitiveValue(short primitiveType);
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * java.lang.String
- */
- CSSRule createCSSRule(String rule);
-
- /**
- * @return org.w3c.dom.css.CSSStyleDeclaration
- */
- ICSSStyleDeclaration createCSSStyleDeclaration();
-
- /**
- * @return com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @param propertyName
- * java.lang.String
- */
- ICSSStyleDeclItem createCSSStyleDeclItem(String propertyName);
-
- /**
- * @return org.w3c.dom.css.CSSStyleRule
- */
- ICSSStyleRule createCSSStyleRule();
-
- /**
- * @return org.w3c.dom.css.CSSUnknownRule
- */
- CSSUnknownRule createCSSUnknownRule();
-
- /**
- * @return org.w3c.dom.stylesheets.MediaList
- */
- MediaList createMediaList();
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSModel
- */
- ICSSModel getModel();
-
- /**
- * @return boolean
- */
- boolean isDocument();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSImportRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSImportRule.java
deleted file mode 100644
index 9818c2f160..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSImportRule.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSImportRule;
-
-/**
- *
- */
-public interface ICSSImportRule extends ICSSNode, CSSImportRule {
-
- java.lang.String HREF = "href"; //$NON-NLS-1$
-
- /**
- *
- */
- void refreshStyleSheet();
-
- /**
- * @param href
- * java.lang.String
- */
- void setHref(String href);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSMediaRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSMediaRule.java
deleted file mode 100644
index d06f3c5a71..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSMediaRule.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSMediaRule;
-
-/**
- *
- */
-public interface ICSSMediaRule extends ICSSNode, ICSSRuleContainer, CSSMediaRule {
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSModel.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSModel.java
deleted file mode 100644
index 15f5f3fd6e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSModel.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.eclipse.wst.css.core.event.ICSSStyleNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.w3c.dom.Node;
-
-
-/**
- *
- */
-public interface ICSSModel extends ICSSStyleNotifier, IStructuredModel {
-
- public static final String EXTERNAL = "externalCSS"; //$NON-NLS-1$
- public static final String EMBEDDED = "embeddedCSS"; //$NON-NLS-1$
- public static final String INLINE = "inlineCSS"; //$NON-NLS-1$
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSDocument
- */
- ICSSDocument getDocument();
-
- /**
- * @return org.w3c.dom.Node
- */
- Node getOwnerDOMNode();
-
- /**
- *
- * @return java.lang.Object
- */
- Object getStyleSheetType();
-
- /**
- * cleanup -> rebuild CSS Nodes This is pre-beta fix for 178176.
- */
- void refreshNodes();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNamedNodeMap.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNamedNodeMap.java
deleted file mode 100644
index 321acca79d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNamedNodeMap.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-/**
- *
- */
-public interface ICSSNamedNodeMap extends ICSSNodeList {
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param name
- * java.lang.String
- */
- ICSSNode getNamedItem(String name);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNode.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNode.java
deleted file mode 100644
index f8af0b89f4..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNode.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-/**
- *
- */
-public interface ICSSNode {
-
- short ATTR_NODE = -1;
- short UNKNOWNRULE_NODE = 0;
- short STYLERULE_NODE = 1;
- short CHARSETRULE_NODE = 2;
- short IMPORTRULE_NODE = 3;
- short MEDIARULE_NODE = 4;
- short FONTFACERULE_NODE = 5;
- short PAGERULE_NODE = 6;
- short STYLESHEET_NODE = 7;
- short STYLEDECLARATION_NODE = 8;
- short STYLEDECLITEM_NODE = 9;
- short VALUELIST_NODE = 10;
- short PRIMITIVEVALUE_NODE = 11;
- short MEDIALIST_NODE = 12;
- short DOCUMENTCSSSTYLE_NODE = 13;
- short LINKSTYLE_NODE = 14;
- short ELEMENTCSSINLINESTYLE_NODE = 15;
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- * @param deep
- * boolean
- */
- ICSSNode cloneNode(boolean deep);
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNamedNodeMap
- */
- ICSSNamedNodeMap getAttributes();
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNodeList
- */
- ICSSNodeList getChildNodes();
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- */
- ICSSNode getFirstChild();
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- */
- ICSSNode getLastChild();
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- */
- ICSSNode getNextSibling();
-
- /**
- * @return short
- */
- short getNodeType();
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSDocument
- */
- ICSSDocument getOwnerDocument();
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- */
- ICSSNode getParentNode();
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- */
- ICSSNode getPreviousSibling();
-
- /**
- * @return boolean
- */
- boolean hasChildNodes();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNodeList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNodeList.java
deleted file mode 100644
index 235bfbe8cb..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSNodeList.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-/**
- *
- */
-public interface ICSSNodeList {
-
- /**
- * @return int
- */
- int getLength();
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- * @param index
- * int
- */
- ICSSNode item(int index);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSPageRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSPageRule.java
deleted file mode 100644
index a182fad23f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSPageRule.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSPageRule;
-
-/**
- *
- */
-public interface ICSSPageRule extends ICSSNode, CSSPageRule {
-
- java.lang.String SELECTOR = "selector"; //$NON-NLS-1$
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSSelectorList
- */
- ICSSSelectorList getSelectors();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSPrimitiveValue.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSPrimitiveValue.java
deleted file mode 100644
index 0260b69f00..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSPrimitiveValue.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-/**
- *
- */
-public interface ICSSPrimitiveValue extends ICSSNode, ICSSValue, CSSPrimitiveValue {
-
- short CSS_INTEGER = 26;
- short CSS_HASH = 27;
- short CSS_URANGE = 28;
- short CSS_FORMAT = 29;
- short CSS_LOCAL = 30;
- short CSS_SLASH = 31;
- short CSS_COMMA = 32;
- short CSS_INHERIT_PRIMITIVE = 33;
-
- /**
- * @param floatValue
- * float
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- void setValue(float floatValue) throws org.w3c.dom.DOMException;
-
- /**
- * @param stringValue
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- void setValue(String stringValue) throws org.w3c.dom.DOMException;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSRuleContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSRuleContainer.java
deleted file mode 100644
index 61ea7d317c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSRuleContainer.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-
-/**
- *
- */
-public interface ICSSRuleContainer {
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- CSSRule appendRule(CSSRule rule) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newRule
- * org.w3c.dom.css.CSSRule
- * @param refRule
- * org.w3c.dom.css.CSSRule
- */
- CSSRule insertRuleBefore(CSSRule newRule, CSSRule refRule) throws DOMException;
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- CSSRule removeRule(CSSRule rule) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newChild
- * org.w3c.dom.css.CSSRule
- * @param oldChild
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- CSSRule replaceRule(CSSRule newRule, CSSRule oldRule) throws org.w3c.dom.DOMException;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelector.java
deleted file mode 100644
index 301ceb9c8b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelector.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import java.util.Iterator;
-
-import org.w3c.dom.Element;
-
-/**
- *
- */
-public interface ICSSSelector {
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSSelectorItem
- * @param index
- * int
- */
- ICSSSelectorItem getItem(int index);
-
- /**
- * @return java.util.Iterator
- */
- Iterator getIterator();
-
- /**
- * @return int
- */
- int getLength();
-
- /**
- * @return int
- */
- int getSpecificity();
-
- /**
- * @return java.lang.String
- */
- String getString();
-
- /**
- * @return boolean
- * @param element
- * org.w3c.dom.Element
- */
- boolean match(Element element, String pseudoName);
-
- /**
- *
- */
- Iterator getErrors();
-
- /**
- *
- */
- int getErrorCount();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorCombinator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorCombinator.java
deleted file mode 100644
index 62ceac299b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorCombinator.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-/**
- *
- */
-public interface ICSSSelectorCombinator extends ICSSSelectorItem {
-
- public static final char DESCENDANT = ' ';
- public static final char CHILD = '>';
- public static final char ADJACENT = '+';
- public static final char UNKNOWN = '?'; // error case
-
- /**
- * @return int
- */
- char getCombinatorType();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorItem.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorItem.java
deleted file mode 100644
index 94dae8924c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorItem.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-/**
- *
- */
-public interface ICSSSelectorItem {
-
- public static final int SIMPLE = 1;
- public static final int COMBINATOR = 2;
-
- /**
- * @return int
- */
- int getItemType();
-
- /**
- * @return java.lang.String
- */
- String getString();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorList.java
deleted file mode 100644
index c4608ddde5..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSelectorList.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import java.util.Iterator;
-
-import org.w3c.dom.Element;
-
-/**
- *
- */
-public interface ICSSSelectorList {
-
- /**
- * @return java.util.Iterator
- */
- Iterator getIterator();
-
- /**
- * @return int
- */
- int getLength();
-
- /**
- * @return java.util.Vector
- * @param index
- * int
- */
- ICSSSelector getSelector(int index);
-
- /**
- * @return java.lang.String
- */
- String getString();
-
- /**
- *
- */
- int getErrorCount();
-
- /**
- *
- */
- Iterator getErrors();
-
- /**
- * @return boolean
- * @param element
- * org.w3c.dom.Element
- */
- boolean match(Element element, String pseudoName);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSimpleSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSimpleSelector.java
deleted file mode 100644
index 4e332e42bf..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSSimpleSelector.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-/**
- *
- */
-public interface ICSSSimpleSelector extends ICSSSelectorItem {
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- String getAttribute(int index);
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- String getClass(int index);
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- String getID(int index);
-
- /**
- * @return java.lang.String
- */
- String getName();
-
- /**
- * @return boolean
- */
- int getNumOfAttributes();
-
- /**
- * @return boolean
- */
- int getNumOfClasses();
-
- /**
- * @return boolean
- */
- int getNumOfIDs();
-
- /**
- * @return boolean
- */
- int getNumOfPseudoNames();
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- String getPseudoName(int index);
-
- /**
- * @return boolean
- */
- boolean isUniversal();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleDeclItem.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleDeclItem.java
deleted file mode 100644
index 6d4b080379..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleDeclItem.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSValue;
-
-/**
- *
- */
-public interface ICSSStyleDeclItem extends ICSSNode, ICSSValueList {
-
- java.lang.String IMPORTANT = "important"; //$NON-NLS-1$
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- ICSSPrimitiveValue appendValue(ICSSPrimitiveValue value) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.css.CSSValue
- */
- CSSValue getCSSValue();
-
- /**
- * @return java.lang.String
- */
- String getPriority();
-
- /**
- * @return java.lang.String
- */
- String getPropertyName();
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- ICSSPrimitiveValue removeValue(ICSSPrimitiveValue value) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param newValue
- * org.w3c.dom.css.CSSPrimitiveValue
- * @param oldValue
- * org.w3c.dom.css.CSSPrimitiveValue
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- ICSSPrimitiveValue replaceValue(ICSSPrimitiveValue newValue, ICSSPrimitiveValue oldValue) throws org.w3c.dom.DOMException;
-
- /**
- * @param priority
- * java.lang.String
- */
- void setPriority(String priority);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleDeclaration.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleDeclaration.java
deleted file mode 100644
index f9aeb80c82..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleDeclaration.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- *
- */
-public interface ICSSStyleDeclaration extends ICSSDocument, CSSStyleDeclaration {
-
- /**
- * @return com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @param propertyName
- * java.lang.String
- */
- ICSSStyleDeclItem getDeclItemNode(String propertyName);
-
- /**
- * @return com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @param oldDecl
- * com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- ICSSStyleDeclItem removeDeclItemNode(ICSSStyleDeclItem oldDecl) throws org.w3c.dom.DOMException;
-
- /**
- * @return com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @param newDecl
- * com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- ICSSStyleDeclItem setDeclItemNode(ICSSStyleDeclItem newDecl) throws org.w3c.dom.DOMException;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleRule.java
deleted file mode 100644
index 95fe26fd9c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleRule.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSStyleRule;
-
-/**
- *
- */
-public interface ICSSStyleRule extends ICSSNode, CSSStyleRule {
-
- java.lang.String SELECTOR = "selector"; //$NON-NLS-1$
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSSelectorList
- */
- ICSSSelectorList getSelectors();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleSheet.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleSheet.java
deleted file mode 100644
index 7da1f4710a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSStyleSheet.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- *
- */
-public interface ICSSStyleSheet extends ICSSDocument, ICSSRuleContainer, CSSStyleSheet {
-
- /**
- * @return org.w3c.dom.NodeList
- */
- NodeList getOwnerNodes();
-
- /**
- * @return org.w3c.dom.NodeList
- * @param doc
- * org.w3c.dom.Document
- */
- NodeList getOwnerNodes(Document doc);
-
- /**
- * @return org.w3c.dom.css.CSSRuleList
- */
- CSSRuleList getOwnerRules();
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheetList
- */
- StyleSheetList getParentStyleSheets();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSValue.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSValue.java
deleted file mode 100644
index 90715e9cea..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSValue.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSValue;
-
-/**
- *
- */
-public interface ICSSValue extends CSSValue {
-
- /**
- * @return java.lang.String
- */
- String getCSSValueText();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSValueList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSValueList.java
deleted file mode 100644
index 91a59346ea..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICSSValueList.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.CSSValueList;
-
-/**
- *
- */
-public interface ICSSValueList extends ICSSValue, CSSValueList {
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- ICSSPrimitiveValue appendValue(ICSSPrimitiveValue value);
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- ICSSPrimitiveValue removeValue(ICSSPrimitiveValue value);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICounter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICounter.java
deleted file mode 100644
index fc57d59e68..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/ICounter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.Counter;
-
-/**
- *
- */
-public interface ICounter extends ICSSNode, Counter {
-
- java.lang.String IDENTIFIER = "identifier"; //$NON-NLS-1$
- java.lang.String LISTSTYLE = "liststyle"; //$NON-NLS-1$
- java.lang.String SEPARATOR = "separator"; //$NON-NLS-1$
-
- /**
- * @param identifier
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- void setIdentifier(String identifier) throws org.w3c.dom.DOMException;
-
- /**
- * @param listStyle
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- void setListStyle(String listStyle) throws org.w3c.dom.DOMException;
-
- /**
- * @param Separator
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- void setSeparator(String separator) throws org.w3c.dom.DOMException;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/IDOMImplementationCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/IDOMImplementationCSS.java
deleted file mode 100644
index 81edc69b3f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/IDOMImplementationCSS.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.css.DOMImplementationCSS;
-
-/**
- *
- */
-public interface IDOMImplementationCSS extends DOMImplementationCSS {
-
- /**
- * @return com.ibm.sed.treemodel.cei.CSSStyleDeclBlock
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- ICSSStyleDeclaration createCSSStyleDeclaration() throws org.w3c.dom.DOMException;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/IDocumentStyle.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/IDocumentStyle.java
deleted file mode 100644
index bed9a86504..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/document/IDocumentStyle.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.document;
-
-
-
-import org.w3c.dom.stylesheets.DocumentStyle;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- *
- */
-public interface IDocumentStyle extends DocumentStyle {
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheet
- * @param newSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- StyleSheet appendSheet(StyleSheet newSheet) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheet
- * @param newSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @param refSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- StyleSheet insertSheetBefore(StyleSheet newSheet, StyleSheet refSheet) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheet
- * @param oldSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- StyleSheet removeSheet(StyleSheet oldSheet) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheet
- * @param newSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @param oldSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- StyleSheet replaceSheet(StyleSheet newSheet, StyleSheet oldSheet) throws org.w3c.dom.DOMException;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/event/ICSSStyleListener.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/event/ICSSStyleListener.java
deleted file mode 100644
index 021394de83..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/event/ICSSStyleListener.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.event;
-
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSSelector;
-
-
-
-/**
- *
- */
-public interface ICSSStyleListener {
-
- /**
- *
- */
- void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media);
-
- /**
- *
- */
- void styleUpdate(ICSSModel srcModel);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/event/ICSSStyleNotifier.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/event/ICSSStyleNotifier.java
deleted file mode 100644
index cf824531f7..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/event/ICSSStyleNotifier.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.event;
-
-
-
-import java.util.List;
-
-/**
- *
- */
-public interface ICSSStyleNotifier extends ICSSStyleListener {
-
- /**
- *
- */
- void addStyleListener(ICSSStyleListener listener);
-
- /**
- *
- */
- List getStyleListeners();
-
- /**
- */
- boolean isRecording();
-
- /**
- *
- */
- void removeStyleListener(ICSSStyleListener listener);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/format/CSSSourceFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/format/CSSSourceFormatter.java
deleted file mode 100644
index 4ce2309227..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/format/CSSSourceFormatter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.format;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.sse.core.INodeAdapter;
-
-
-/**
- * @deprecated
- */
-public interface CSSSourceFormatter extends INodeAdapter {
-
- /**
- *
- */
- StringBuffer cleanup(ICSSNode node);
-
- /**
- *
- * @return java.lang.StringBuffer
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param region
- * org.eclipse.jface.text.IRegion
- */
- StringBuffer cleanup(ICSSNode node, IRegion region);
-
- /**
- *
- */
- StringBuffer format(ICSSNode node);
-
- /**
- *
- */
- StringBuffer format(ICSSNode node, IRegion region);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/format/FormatProcessorCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/format/FormatProcessorCSS.java
deleted file mode 100644
index 8ce323113b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/format/FormatProcessorCSS.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.format;
-
-import java.util.List;
-
-import org.eclipse.wst.css.core.document.ICSSDocument;
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.formatter.CSSFormatUtil;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.core.format.AbstractStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.format.IStructuredFormatPreferences;
-import org.eclipse.wst.sse.core.format.IStructuredFormatter;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.w3c.dom.Node;
-
-
-public class FormatProcessorCSS extends AbstractStructuredFormatProcessor {
- /**
- * @deprecated renamed to getFileExtension() TODO will delete in C5
- */
- protected String getContentType() {
- return "css"; //$NON-NLS-1$
- }
-
- protected String getFileExtension() {
- return "css"; //$NON-NLS-1$
- }
-
- public void formatModel(IStructuredModel structuredModel) {
- int start = 0;
- int length = structuredModel.getStructuredDocument().getLength();
-
- formatModel(structuredModel, start, length);
- }
-
- public void formatModel(IStructuredModel structuredModel, int start, int length) {
- CSSFormatUtil formatUtil = CSSFormatUtil.getInstance();
- if (structuredModel instanceof ICSSModel) {
- ICSSDocument doc = ((ICSSModel) structuredModel).getDocument();
- CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) doc);
- StringBuffer buf = formatter.format(doc);
- if (buf != null) {
- int startOffset = ((IndexedRegion) doc).getStartOffset();
- int endOffset = ((IndexedRegion) doc).getEndOffset();
- formatUtil.replaceSource(doc.getModel(), startOffset, endOffset - startOffset, buf.toString());
- }
- }
- else if (structuredModel instanceof XMLModel) {
- List cssnodes = formatUtil.collectCSSNodes(structuredModel, start, length);
- if (cssnodes != null && !cssnodes.isEmpty()) {
- ICSSModel model = null;
- for (int i = 0; i < cssnodes.size(); i++) {
- ICSSNode node = (ICSSNode) cssnodes.get(i);
- CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) node);
- StringBuffer buf = formatter.format(node);
- if (buf != null) {
- int startOffset = ((IndexedRegion) node).getStartOffset();
- int endOffset = ((IndexedRegion) node).getEndOffset();
- if (model == null) {
- model = node.getOwnerDocument().getModel();
- }
- formatUtil.replaceSource(model, startOffset, endOffset - startOffset, buf.toString());
- }
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.format.AbstractStructuredFormatProcessor#getFormatPreferences()
- */
- public IStructuredFormatPreferences getFormatPreferences() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.format.AbstractStructuredFormatProcessor#getFormatter(org.w3c.dom.Node)
- */
- protected IStructuredFormatter getFormatter(Node node) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.format.AbstractStructuredFormatProcessor#refreshFormatPreferences()
- */
- protected void refreshFormatPreferences() {
- // TODO Auto-generated method stub
-
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java
deleted file mode 100644
index ee035424c3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.common.encoding.CommonCharsetNames;
-import org.eclipse.wst.common.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.css.core.preferences.CSSPreferenceHelper;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class CSSCorePlugin extends Plugin {
- // The shared instance.
- private static CSSCorePlugin plugin;
- // Resource bundle.
- private ResourceBundle resourceBundle;
- private static final String KEY_PREFIX = "%"; //$NON-NLS-1$
- private static final String KEY_DOUBLE_PREFIX = "%%"; //$NON-NLS-1$
-
- /**
- * The constructor.
- */
- public CSSCorePlugin() {
- super();
- plugin = this;
- }
-
- /**
- * Returns the shared instance.
- */
- public static CSSCorePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Plugin#initializeDefaultPluginPreferences()
- */
- protected void initializeDefaultPluginPreferences() {
- Preferences prefs = getDefault().getPluginPreferences();
-
- CSSPreferenceHelper.createDefaultPreferences(prefs);
-
- // set model preference defaults
- prefs.setDefault(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE, CommonModelPreferenceNames.ASIS);
- prefs.setDefault(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE, CommonModelPreferenceNames.ASIS);
- prefs.setDefault(CommonModelPreferenceNames.INSERT_MISSING_TAGS, true);
- prefs.setDefault(CommonModelPreferenceNames.QUOTE_ATTR_VALUES, true);
- prefs.setDefault(CommonModelPreferenceNames.FORMAT_SOURCE, true);
- prefs.setDefault(CommonModelPreferenceNames.CONVERT_EOL_CODES, false);
-
- prefs.setDefault(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
-
- String defaultEnc = CommonModelPreferenceNames.UTF_8;
- String systemEnc = System.getProperty("file.encoding"); //$NON-NLS-1$
- if (systemEnc != null) {
- defaultEnc = CommonCharsetNames.getPreferredDefaultIanaName(systemEnc, CommonModelPreferenceNames.UTF_8);
- }
- prefs.setDefault(CommonEncodingPreferenceNames.OUTPUT_CODESET, defaultEnc);
-
- prefs.setDefault(CommonEncodingPreferenceNames.END_OF_LINE_CODE, ""); //$NON-NLS-1$
-
- prefs.setDefault(CommonModelPreferenceNames.TAB_WIDTH, 4);
-
- prefs.setDefault(CommonModelPreferenceNames.FORMATTING_SUPPORTED, true);
- prefs.setDefault(CommonModelPreferenceNames.LINE_WIDTH, 72);
- prefs.setDefault(CommonModelPreferenceNames.SPLIT_MULTI_ATTRS, false);
- prefs.setDefault(CommonModelPreferenceNames.INDENT_USING_TABS, true);
- prefs.setDefault(CommonModelPreferenceNames.CLEAR_ALL_BLANK_LINES, false);
-
- prefs.setDefault(CommonModelPreferenceNames.PREFERRED_MARKUP_CASE_SUPPORTED, false);
- prefs.setDefault(CommonModelPreferenceNames.TAG_NAME_CASE, CommonModelPreferenceNames.LOWER);
- prefs.setDefault(CommonModelPreferenceNames.ATTR_NAME_CASE, CommonModelPreferenceNames.LOWER);
- }
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String value) {
- String s = value.trim();
- if (!s.startsWith(KEY_PREFIX, 0))
- return s;
- if (s.startsWith(KEY_DOUBLE_PREFIX, 0))
- return s.substring(1);
-
- int ix = s.indexOf(' ');
- String key = ix == -1 ? s : s.substring(0, ix);
-
- ResourceBundle bundle = getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key.substring(1)) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- public static String getResourceString(String key, Object[] args) {
-
- try {
- return MessageFormat.format(getResourceString(key), args);
- } catch (IllegalArgumentException e) {
- return getResourceString(key);
- }
-
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.css.core.internal.CSSCorePluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
deleted file mode 100644
index 8b7eabba04..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-Please_specify_CSS_file_na=Please specify CSS file name.
-ERROR__Cannot_use_a_static_ERROR_=ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.
-You_cannot_use_CSSStyleShe_UI_=You cannot use CSSStyleSheet.getOwnerRule() because of many referencers of this rule\nPlease use getOnwerRules()
-Missing_return_statement_i_ERROR_=Missing return statement in function
-1concat_ERROR_={0}first flat node is null.
-2concat_ERROR_={0}first flat node is not in model.
-3concat_ERROR_={0}last flat node is null.
-4concat_ERROR_={0}last flat node is not in model.
-25concat_ERROR_={0}first region is null.
-26concat_ERROR_={0}first region is not in model.
-27concat_ERROR_={0}last region is null.
-28concat_ERROR_={0}last region is not in model.
-5concat_ERROR_={0}first region is null.
-6concat_ERROR_={0}first region is not in model.
-7concat_ERROR_={0}last region is null.
-8concat_ERROR_={0}last region is not in model.
-9concat_ERROR_=Invalid escape character at line {0} column {1}.
-12concat_EXC_=Caught Exception: {0}
-13concat_ERROR_=Error: Ignoring invalid lexical state : {0}. State unchanged.
-15concat_ERROR_=Lexical error at line {0}, column {1}. Encountered: {2} after :
-ERROR__Cannot_use_a_static_ERROR__ERROR_=ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java
deleted file mode 100644
index 78e2fed3f3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal;
-
-
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.css.core"; //$NON-NLS-1$
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
-
- public static final int OK = IStatus.OK; // 0
- public static final int INFO = IStatus.INFO; // 1
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int ERROR = IStatus.ERROR; // 4
-
- public static final int OK_DEBUG = 200 + OK;
- public static final int INFO_DEBUG = 200 + INFO;
- public static final int WARNING_DEBUG = 200 + WARNING;
- public static final int ERROR_DEBUG = 200 + ERROR;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- *
- * @param message
- * text to print
- * @param category
- * category of the message, to be compared with
- * /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- *
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/AbstractContentDescriber.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/AbstractContentDescriber.java
deleted file mode 100644
index df2b730102..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/AbstractContentDescriber.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.content;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescriber;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.eclipse.wst.common.encoding.EncodingMemento;
-import org.eclipse.wst.common.encoding.IContentDescriptionExtended;
-import org.eclipse.wst.common.encoding.IResourceCharsetDetector;
-
-public abstract class AbstractContentDescriber implements ITextContentDescriber {
-
- private final static QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK, IContentDescriptionExtended.DETECTED_CHARSET, IContentDescriptionExtended.UNSUPPORTED_CHARSET, IContentDescriptionExtended.APPROPRIATE_DEFAULT};
-
- private void calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException {
- if (isRelevent(description)) {
- IResourceCharsetDetector detector = getDetector();
- detector.set(contents);
- handleCalculations(description, detector);
- }
- }
-
- /**
- * @param contents
- * @param description
- * @throws IOException
- */
- private void calculateSupportedOptions(Reader contents, IContentDescription description) throws IOException {
- if (isRelevent(description)) {
- IResourceCharsetDetector detector = getDetector();
- detector.set(contents);
- handleCalculations(description, detector);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.content.IContentDescriber#describe(java.io.InputStream,
- * org.eclipse.core.runtime.content.IContentDescription)
- */
- public int describe(InputStream contents, IContentDescription description) throws IOException {
- int result = IContentDescriber.VALID;
-
- calculateSupportedOptions(contents, description);
-
- // assume if we're called at all that we are valid (few types could be
- // disproved, maybe XML -- or, maybe if exception occurs above?)
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.content.ITextContentDescriber#describe(java.io.Reader,
- * org.eclipse.core.runtime.content.IContentDescription)
- */
- public int describe(Reader contents, IContentDescription description) throws IOException {
- int result = IContentDescriber.VALID;
-
- calculateSupportedOptions(contents, description);
-
- // assume if we're called at all that we are valid (few types could be
- // disproved, maybe XML -- or, maybe if exception occurs above?)
- return result;
- }
-
- protected abstract IResourceCharsetDetector getDetector();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.content.IContentDescriber#getSupportedOptions()
- */
- public QualifiedName[] getSupportedOptions() {
-
- return SUPPORTED_OPTIONS;
- }
-
- /**
- * @param description
- * @param detector
- * @throws IOException
- */
- protected void handleCalculations(IContentDescription description, IResourceCharsetDetector detector) throws IOException {
- // note: if we're asked for one, we set them all. I need to be sure if
- // called
- // mulitiple times (one for each, say) that we don't waste time
- // processing same
- // content again.
- EncodingMemento encodingMemento = detector.getEncodingMemento();
- // TODO: I need to verify to see if this BOM work is always done
- // by text type.
- Object detectedByteOrderMark = encodingMemento.getUnicodeBOM();
- if (detectedByteOrderMark != null) {
- Object existingByteOrderMark = description.getProperty(IContentDescription.BYTE_ORDER_MARK);
- // not sure why would ever be different, so if is different, may
- // need to "push" up into base.
- if (!detectedByteOrderMark.equals(existingByteOrderMark))
- description.setProperty(IContentDescription.BYTE_ORDER_MARK, detectedByteOrderMark);
- }
-
-
- if (!encodingMemento.isValid()) {
- // note: after setting here, its the mere presence of
- // IContentDescriptionExtended.UNSUPPORTED_CHARSET
- // in the resource's description that can be used to determine if
- // invalid
- // in those cases, the "detected" property contains an
- // "appropriate default" to use.
- description.setProperty(IContentDescriptionExtended.UNSUPPORTED_CHARSET, encodingMemento.getInvalidEncoding());
- description.setProperty(IContentDescriptionExtended.APPROPRIATE_DEFAULT, encodingMemento.getAppropriateDefault());
- }
-
- Object detectedCharset = encodingMemento.getDetectedCharsetName();
- Object javaCharset = encodingMemento.getJavaCharsetName();
-
- // we always include detected, if its different than java
- handleDetectedSpecialCase(description, detectedCharset, javaCharset);
-
- if (javaCharset != null) {
- Object existingCharset = description.getProperty(IContentDescription.CHARSET);
- if (javaCharset.equals(existingCharset)) {
- handleDetectedSpecialCase(description, detectedCharset, javaCharset);
- } else {
- // we may need to add what we found, but only need to add
- // if different from default.the
- Object defaultCharset = getDetector().getSpecDefaultEncoding();
- if (defaultCharset != null) {
- if (!defaultCharset.equals(javaCharset)) {
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- } else {
- // assuming if there is no spec default, we always need to
- // add, I'm assuming
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- }
- }
-
- // avoid adding anything if not absolutly needed, since always
- // "cached" per session
- //description.setProperty(IContentDescriptionExtended.ENCODING_MEMENTO,
- // encodingMemento);
- }
-
- private void handleDetectedSpecialCase(IContentDescription description, Object detectedCharset, Object javaCharset) {
- // since equal, we don't need to add, but if our detected version is
- // different than
- // javaCharset, then we should add it. This will happen, for example,
- // if there's
- // differences in case, or differences due to override properties
- if (detectedCharset != null) {
- // if (!detectedCharset.equals(javaCharset)) {
- // description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET,
- // detectedCharset);
- // }
-
- // Once we detected a charset, we should set the property even
- // though it's the same as javaCharset
- // because there are clients that rely on this property to
- // determine if the charset is actually detected in file or not.
- description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET, detectedCharset);
- }
- }
-
- /**
- * @param description
- * @return
- */
- private boolean isRelevent(IContentDescription description) {
- boolean result = false;
- if (description == null)
- result = false;
- else if (description.isRequested(IContentDescription.BYTE_ORDER_MARK))
- result = true;
- else if (description.isRequested(IContentDescription.CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.APPROPRIATE_DEFAULT))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.DETECTED_CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.UNSUPPORTED_CHARSET))
- result = true;
- // else if
- // (description.isRequested(IContentDescriptionExtended.ENCODING_MEMENTO))
- // result = true;
- return result;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/AbstractResourceEncodingDetector.java
deleted file mode 100644
index 20d03817d6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/AbstractResourceEncodingDetector.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.content;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.encoding.CodedIO;
-import org.eclipse.wst.common.encoding.EncodingMemento;
-import org.eclipse.wst.common.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.common.encoding.internal.ByteReader;
-
-
-public abstract class AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
- protected EncodingMemento fEncodingMemento;
-
- protected boolean fHeaderParsed;
-
- protected Reader fReader;
-
- /**
- *
- */
- public AbstractResourceEncodingDetector() {
- super();
- }
-
- /**
- * Note: once this instance is created, trace info still needs to be
- * appended by caller, depending on the context its created.
- */
- private void createEncodingMemento(String detectedCharsetName) {
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(getAppropriateJavaCharset(detectedCharsetName));
- fEncodingMemento.setDetectedCharsetName(detectedCharsetName);
- // TODO: if detectedCharset and spec default is
- // null, need to use "work
- // bench based" defaults.
- fEncodingMemento.setAppropriateDefault(getSpecDefaultEncoding());
- }
-
- /**
- * convience method all subclasses can use (but not override)
- *
- * @param detectedCharsetName
- * @param reason
- */
- final protected void createEncodingMemento(String detectedCharsetName, String reason) {
- createEncodingMemento(detectedCharsetName);
- fEncodingMemento.addTrace(reason);
- }
-
- /**
- * convience method all subclasses can use (but not override)
- */
- final protected void ensureInputSet() {
- if (fReader == null) {
- throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
- }
- }
-
- /**
- * This method can return null, if invalid charset name (in which case
- * "appropriateDefault" should be used, if a name is really need for some
- * "save anyway" cases).
- *
- * @param detectedCharsetName
- * @return
- */
- private String getAppropriateJavaCharset(String detectedCharsetName) {
- String result = null;
- // 1. Check explicit mapping overrides from
- // property file -- its here we pick up "rules" for cases
- // that are not even in Java
- result = CodedIO.checkMappingOverrides(detectedCharsetName);
- // 2. Use the "canonical" name from JRE mappings
- // Note: see Charset JavaDoc, the name you get one
- // with can be alias,
- // the name you get back is "standard" name.
- Charset javaCharset = null;
- try {
- javaCharset = Charset.forName(detectedCharsetName);
- } catch (UnsupportedCharsetException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- } catch (IllegalCharsetNameException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- }
- // give priority to java cononical name, if present
- if (javaCharset != null) {
- result = javaCharset.name();
- // but still allow overrides
- result = CodedIO.checkMappingOverrides(result);
- }
- return result;
- }
-
- public String getEncoding() throws IOException {
- return getEncodingMemento().getDetectedCharsetName();
- }
-
- // to ensure consist overall rules used, we'll mark as
- // final,
- // and require subclasses to provide certain pieces of
- // the
- // implementation
- public EncodingMemento getEncodingMemento() throws IOException {
- ensureInputSet();
- if (!fHeaderParsed) {
- parseInput();
- // we keep track of if header's already been
- // parse, so can make
- // multiple 'get' calls, without causing
- // reparsing.
- fHeaderParsed = true;
- // Note: there is a "hidden assumption" here
- // that an empty
- // string in content should be treated same as
- // not present.
- }
- if (fEncodingMemento == null) {
- handleSpecDefault();
- }
- if (fEncodingMemento == null) {
- // safty net
- fEncodingMemento = new NullMemento();
- }
- return fEncodingMemento;
- }
-
- /**
- * This is to return a default encoding -- as specified by an industry
- * content type spec -- when not present in the stream, for example, XML
- * specifies UTF-8, JSP specifies ISO-8859-1. This method should return
- * null if there is no such "spec default".
- */
- abstract public String getSpecDefaultEncoding();
-
- public EncodingMemento getSpecDefaultEncodingMemento() {
- resetAll();
- EncodingMemento result = null;
- String enc = getSpecDefaultEncoding();
- if (enc != null) {
- createEncodingMemento(enc, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT);
- fEncodingMemento.setAppropriateDefault(enc);
- result = fEncodingMemento;
- }
- return result;
- }
-
- private void handleSpecDefault() {
- String encodingName;
- encodingName = getSpecDefaultEncoding();
- if (encodingName != null) {
- //createEncodingMemento(encodingName,
- // EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(encodingName);
- fEncodingMemento.setAppropriateDefault(encodingName);
- fEncodingMemento.addTrace(EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
- }
- }
-
- /**
- * Every subclass must provide a way to parse the input. This method has
- * several critical responsibilities:
- * <li>set the fEncodingMemento field appropriately, according to the
- * results of the parse of fReader.</li>
- * <li>set fHarderParsed to true, to avoid wasted re-parsing.</li>
- */
- abstract protected void parseInput() throws IOException;
-
- /**
- *
- */
- private void resetAll() {
- fReader = null;
- fHeaderParsed = false;
- fEncodingMemento = null;
- }
-
- /**
- *
- */
- public void set(InputStream inputStream) {
- resetAll();
- fReader = new ByteReader(inputStream);
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- } catch (IOException e) {
- // impossible, since we know ByteReader
- // supports marking
- throw new Error(e);
- }
- }
-
- /**
- *
- */
- public void set(IStorage iStorage) throws CoreException {
- resetAll();
- InputStream inputStream = iStorage.getContents();
- InputStream resettableStream = new BufferedInputStream(inputStream, CodedIO.MAX_BUF_SIZE);
- resettableStream.mark(CodedIO.MAX_MARK_SIZE);
- set(resettableStream);
- // TODO we'll need to "remember" IFile, or
- // get its (or its project's) settings, in case
- // those are needed to handle cases when the
- // encoding is not in the file stream.
- }
-
- /**
- * Note: this is not part of interface to help avoid confusion ... it
- * expected this Reader is a well formed character reader ... that is, its
- * all ready been determined to not be a unicode marked input stream. And,
- * its assumed to be in the correct position, at position zero, ready to
- * read first character.
- */
- public void set(Reader reader) {
- resetAll();
- fReader = reader;
- if (!fReader.markSupported()) {
- fReader = new BufferedReader(fReader);
- }
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- } catch (IOException e) {
- // impossble, since we just checked if markable
- throw new Error(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSHeadTokenizer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSHeadTokenizer.java
deleted file mode 100644
index b25ebf716e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSHeadTokenizer.java
+++ /dev/null
@@ -1,1355 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:42 PM */
-
-/*nlsXXX*/
-package org.eclipse.wst.css.core.internal.content;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-
-/**
- * This class is a scanner generated by <a
- * href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex </a> 1.2.2
- * on 1/27/04 6:42 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jflex</tt>
- */
-public class CSSHeadTokenizer {
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
- final public static int YYINITIAL = 0;
- final public static int UnDelimitedString = 12;
- final public static int DQ_STRING = 8;
- final public static int SQ_STRING = 10;
- final public static int ST_XMLDecl = 2;
- final public static int QuotedAttributeValue = 6;
- final public static int CHARSET_RULE = 4;
-
- /**
- * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
- * YY_LEXSTATE[l+1] is the state in the DFA for the lexical state l at the
- * beginning of a line l is of the form l = 2*k, k a non negative integer
- */
- private final static int YY_LEXSTATE[] = {0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7};
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed = "\11\0\1\6\1\11\2\0\1\10\22\0\1\6\1\0\1\36\2\0" + "\1\41\1\0\1\37\7\0\1\40\13\0\1\35\1\12\1\7\1\34" + "\1\13\1\17\1\22\1\0\1\20\1\31\1\25\1\0\1\33\1\21" + "\1\32\2\0\1\16\1\15\1\27\1\30\2\0\1\23\1\24\1\26" + "\3\0\1\14\10\0\1\22\1\0\1\20\1\31\1\25\1\0\1\33" + "\1\21\1\32\2\0\1\16\1\15\1\27\1\30\2\0\1\23\1\24" + "\1\26\3\0\1\14\102\0\1\4\3\0\1\5\17\0\1\3\16\0" + "\1\1\20\0\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char[] yycmap = yy_unpack_cmap(yycmap_packed);
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {"Unkown internal scanner error", "Internal error: unknown state", "Error: could not match input", "Error: pushback value was too large"};
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /**
- * this buffer contains the current text to be matched and is the source
- * of the yytext() string
- */
- private char yy_buffer[] = new char[16384];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /**
- * endRead marks the last character in the buffer, that has been read from
- * input
- */
- private int yy_endRead;
-
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
-
- /**
- * yy_atBOL == true <=>the scanner is currently at the beginning of a
- * line
- */
- private boolean yy_atBOL;
-
- /** yy_atEOF == true <=>the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean yy_eof_done;
-
- /* user code: */
-
-
- private boolean hasMore = true;
- private final static int MAX_TO_SCAN = 1000;
- StringBuffer string = new StringBuffer();
- // state stack for easier state handling
- private IntStack fStateStack = new IntStack();
- private String valueText = null;
-
-
-
- public CSSHeadTokenizer() {
- super();
- }
-
- public void reset(Reader in) {
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /*
- * this buffer contains the current text to be matched and is the
- * source of the yytext() string
- */
- java.util.Arrays.fill(yy_buffer, (char) 0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
-
- /**
- * yy_atBOL == true <=>the scanner is currently at the beginning of a
- * line
- */
- yy_atBOL = false;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- fStateStack.clear();
-
- hasMore = true;
-
- // its a little wasteful to "throw away" first char array generated
- // by class init (via auto generated code), but we really do want
- // a small buffer for our head parsers.
- if (yy_buffer.length != MAX_TO_SCAN) {
- yy_buffer = new char[MAX_TO_SCAN];
- }
-
-
- }
-
-
- public final HeadParserToken getNextToken() throws IOException {
- String context = null;
- context = primGetNextToken();
- HeadParserToken result = null;
- if (valueText != null) {
- result = createToken(context, yychar, valueText);
- valueText = null;
- }
- else {
- result = createToken(context, yychar, yytext());
- }
- return result;
- }
-
- public final boolean hasMoreTokens() {
- return hasMore && yychar < MAX_TO_SCAN;
- }
-
- private void pushCurrentState() {
- fStateStack.push(yystate());
-
- }
-
- private void popState() {
- yybegin(fStateStack.pop());
- }
-
- private HeadParserToken createToken(String context, int start, String text) {
- return new HeadParserToken(context, start, text);
- }
-
-
-
- /**
- * Creates a new scanner There is also a java.io.InputStream version of
- * this constructor.
- *
- * @param in
- * the java.io.Reader to read input from.
- */
- public CSSHeadTokenizer(java.io.Reader in) {
- this.yy_reader = in;
- }
-
- /**
- * Creates a new scanner. There is also java.io.Reader version of this
- * constructor.
- *
- * @param in
- * the java.io.Inputstream to read input from.
- */
- public CSSHeadTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed
- * the packed character translation table
- * @return the unpacked character translation table
- */
- private static char[] yy_unpack_cmap(String packed) {
- char[] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 158) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do
- map[j++] = value;
- while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Gets the next input character.
- *
- * @return the next character of the input stream, EOF if the end of the
- * stream is reached.
- * @exception IOException
- * if any I/O-Error occurs
- */
- private int yy_advance() throws java.io.IOException {
-
- /* standard case */
- if (yy_currentPos < yy_endRead)
- return yy_buffer[yy_currentPos++];
-
- /* if the eof is reached, we don't need to work hard */
- if (yy_atEOF)
- return YYEOF;
-
- /* otherwise: need to refill the buffer */
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead, yy_buffer, 0, yy_endRead - yy_startRead);
-
- /* translate stored positions */
- yy_endRead -= yy_startRead;
- yy_currentPos -= yy_startRead;
- yy_markedPos -= yy_startRead;
- yy_pushbackPos -= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos * 2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead, yy_buffer.length - yy_endRead);
-
- if (numRead == -1)
- return YYEOF;
-
- yy_endRead += numRead;
-
- return yy_buffer[yy_currentPos++];
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
- yy_reader.close();
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
- /**
- * Enters a new lexical state
- *
- * @param newState
- * the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String(yy_buffer, yy_startRead, yy_markedPos - yy_startRead);
- }
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos - yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning.
- *
- * @param errorCode
- * the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- try {
- System.out.println(YY_ERROR_MSG[errorCode]);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- }
-
- System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number
- * the number of characters to be read again. This number must
- * not be greater than yylength()!
- */
- private void yypushback(int number) {
- if (number > yylength())
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
-
- /**
- * Contains user EOF-code, which will be executed exactly once, when the
- * end of file is reached
- */
- private void yy_do_eof() {
- if (!yy_eof_done) {
- yy_eof_done = true;
- hasMore = false;
-
- }
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched, the end
- * of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception IOException
- * if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
-
- while (true) {
-
- yychar += yylength();
-
- yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos - 1] == '\n';
- if (!yy_atBOL && yy_buffer[yy_markedPos - 1] == '\r') {
- yy_atBOL = yy_advance() != '\n';
- if (!yy_atEOF)
- yy_currentPos--;
- }
-
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
- if (yy_atBOL)
- yy_state = YY_LEXSTATE[yy_lexical_state + 1];
- else
- yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
- yy_forAction : {
- while (true) {
-
- yy_input = yy_advance();
-
- if (yy_input == YYEOF)
- break yy_forAction;
-
- yy_input = yycmap[yy_input];
-
- boolean yy_isFinal = false;
- boolean yy_noLookAhead = false;
-
- yy_forNext : {
- switch (yy_state) {
- case 0 :
- switch (yy_input) {
- case 1 :
- yy_isFinal = true;
- yy_state = 9;
- break yy_forNext;
- case 2 :
- yy_isFinal = true;
- yy_state = 10;
- break yy_forNext;
- case 3 :
- yy_isFinal = true;
- yy_state = 11;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 8;
- break yy_forNext;
- }
-
- case 1 :
- switch (yy_input) {
- case 1 :
- yy_isFinal = true;
- yy_state = 9;
- break yy_forNext;
- case 2 :
- yy_isFinal = true;
- yy_state = 10;
- break yy_forNext;
- case 3 :
- yy_isFinal = true;
- yy_state = 11;
- break yy_forNext;
- case 6 :
- case 8 :
- case 9 :
- yy_isFinal = true;
- yy_state = 12;
- break yy_forNext;
- case 10 :
- yy_isFinal = true;
- yy_state = 13;
- break yy_forNext;
- case 15 :
- yy_isFinal = true;
- yy_state = 14;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 8;
- break yy_forNext;
- }
-
- case 2 :
- switch (yy_input) {
- case 11 :
- yy_isFinal = true;
- yy_state = 15;
- break yy_forNext;
- case 21 :
- yy_isFinal = true;
- yy_state = 16;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 8;
- break yy_forNext;
- }
-
- case 3 :
- switch (yy_input) {
- case 6 :
- case 8 :
- case 9 :
- yy_isFinal = true;
- yy_state = 17;
- break yy_forNext;
- case 29 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 18;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 8;
- break yy_forNext;
- }
-
- case 4 :
- switch (yy_input) {
- case 6 :
- case 8 :
- yy_isFinal = true;
- yy_state = 20;
- break yy_forNext;
- case 9 :
- yy_isFinal = true;
- yy_state = 21;
- break yy_forNext;
- case 30 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 22;
- break yy_forNext;
- case 31 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 23;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 19;
- break yy_forNext;
- }
-
- case 5 :
- switch (yy_input) {
- case 8 :
- case 9 :
- case 10 :
- case 28 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 25;
- break yy_forNext;
- case 11 :
- case 32 :
- yy_isFinal = true;
- yy_state = 26;
- break yy_forNext;
- case 29 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 27;
- break yy_forNext;
- case 30 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 28;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 24;
- break yy_forNext;
- }
-
- case 6 :
- switch (yy_input) {
- case 8 :
- case 9 :
- case 10 :
- case 28 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 25;
- break yy_forNext;
- case 32 :
- yy_isFinal = true;
- yy_state = 26;
- break yy_forNext;
- case 29 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 27;
- break yy_forNext;
- case 31 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 28;
- break yy_forNext;
- case 33 :
- yy_isFinal = true;
- yy_state = 29;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 24;
- break yy_forNext;
- }
-
- case 7 :
- switch (yy_input) {
- case 10 :
- case 28 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 25;
- break yy_forNext;
- case 32 :
- yy_isFinal = true;
- yy_state = 26;
- break yy_forNext;
- case 11 :
- yy_isFinal = true;
- yy_state = 29;
- break yy_forNext;
- case 6 :
- case 8 :
- case 9 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 30;
- break yy_forNext;
- case 29 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 31;
- break yy_forNext;
- case 30 :
- case 31 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 32;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 24;
- break yy_forNext;
- }
-
- case 9 :
- switch (yy_input) {
- case 2 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 33;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 10 :
- switch (yy_input) {
- case 1 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 34;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 11 :
- switch (yy_input) {
- case 4 :
- yy_state = 35;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 12 :
- switch (yy_input) {
- case 6 :
- case 8 :
- case 9 :
- yy_state = 36;
- break yy_forNext;
- case 10 :
- yy_state = 37;
- break yy_forNext;
- case 15 :
- yy_state = 38;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 13 :
- switch (yy_input) {
- case 11 :
- yy_state = 39;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 14 :
- switch (yy_input) {
- case 16 :
- yy_state = 40;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 15 :
- switch (yy_input) {
- case 28 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 41;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 16 :
- switch (yy_input) {
- case 23 :
- yy_state = 42;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 17 :
- switch (yy_input) {
- case 6 :
- case 8 :
- case 9 :
- yy_isFinal = true;
- yy_state = 17;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 20 :
- switch (yy_input) {
- case 6 :
- case 8 :
- yy_isFinal = true;
- yy_state = 20;
- break yy_forNext;
- case 9 :
- yy_state = 43;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 19;
- break yy_forNext;
- }
-
- case 21 :
- switch (yy_input) {
- case 6 :
- case 8 :
- yy_isFinal = true;
- yy_state = 20;
- break yy_forNext;
- case 9 :
- yy_state = 43;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 19;
- break yy_forNext;
- }
-
- case 26 :
- switch (yy_input) {
- case 28 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 44;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 29 :
- switch (yy_input) {
- case 28 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 45;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 35 :
- switch (yy_input) {
- case 5 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 46;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 36 :
- switch (yy_input) {
- case 6 :
- case 8 :
- case 9 :
- yy_state = 36;
- break yy_forNext;
- case 10 :
- yy_state = 37;
- break yy_forNext;
- case 15 :
- yy_state = 38;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 37 :
- switch (yy_input) {
- case 11 :
- yy_state = 39;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 38 :
- switch (yy_input) {
- case 16 :
- yy_state = 40;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 39 :
- switch (yy_input) {
- case 12 :
- yy_state = 47;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 40 :
- switch (yy_input) {
- case 17 :
- yy_state = 48;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 42 :
- switch (yy_input) {
- case 16 :
- yy_state = 49;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 43 :
- switch (yy_input) {
- case 6 :
- case 8 :
- yy_isFinal = true;
- yy_state = 20;
- break yy_forNext;
- case 9 :
- yy_state = 43;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 19;
- break yy_forNext;
- }
-
- case 47 :
- switch (yy_input) {
- case 13 :
- yy_state = 50;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 48 :
- switch (yy_input) {
- case 18 :
- yy_state = 51;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 49 :
- switch (yy_input) {
- case 24 :
- yy_state = 52;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 50 :
- switch (yy_input) {
- case 14 :
- yy_state = 53;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 51 :
- switch (yy_input) {
- case 19 :
- yy_state = 54;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 52 :
- switch (yy_input) {
- case 25 :
- yy_state = 55;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 53 :
- switch (yy_input) {
- case 6 :
- case 8 :
- case 9 :
- yy_isFinal = true;
- yy_state = 56;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 54 :
- switch (yy_input) {
- case 20 :
- yy_state = 57;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 55 :
- switch (yy_input) {
- case 26 :
- yy_state = 58;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 56 :
- switch (yy_input) {
- case 6 :
- case 8 :
- case 9 :
- yy_isFinal = true;
- yy_state = 56;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 57 :
- switch (yy_input) {
- case 21 :
- yy_state = 59;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 58 :
- switch (yy_input) {
- case 23 :
- yy_state = 60;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 59 :
- switch (yy_input) {
- case 22 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 61;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 60 :
- switch (yy_input) {
- case 27 :
- yy_state = 62;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 62 :
- switch (yy_input) {
- case 6 :
- case 8 :
- case 9 :
- yy_state = 62;
- break yy_forNext;
- case 7 :
- yy_isFinal = true;
- yy_state = 63;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 63 :
- switch (yy_input) {
- case 6 :
- case 8 :
- case 9 :
- yy_isFinal = true;
- yy_state = 63;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- default :
- yy_ScanError(YY_ILLEGAL_STATE);
- break;
- }
- }
-
- if (yy_isFinal) {
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
- if (yy_noLookAhead)
- break yy_forAction;
- }
-
- }
- }
-
-
- switch (yy_action) {
-
- case 45 : {
- yypushback(2);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.InvalidTerminatedStringValue;
- }
- case 65 :
- break;
- case 25 : {
- yypushback(1);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.InvalidTerminatedStringValue;
- }
- case 66 :
- break;
- case 19 :
- case 20 : {
- yypushback(1);
- yybegin(UnDelimitedString);
- string.setLength(0);
- }
- case 67 :
- break;
- case 18 : {
- yybegin(YYINITIAL);
- hasMore = false;
- return CSSHeadTokenizerConstants.RuleEnd;
- }
- case 68 :
- break;
- case 32 : {
- yypushback(1);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
- }
- case 69 :
- break;
- case 44 : {
- yypushback(2);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.InvalidTerminatedStringValue;
- }
- case 70 :
- break;
- case 61 : {
- if (yychar == 0) {
- yybegin(CHARSET_RULE);
- return CSSHeadTokenizerConstants.CHARSET_RULE;
- }
- }
- case 71 :
- break;
- case 56 : {
- if (yychar == 0) {
- yybegin(ST_XMLDecl);
- return XMLHeadTokenizerConstants.XMLDeclStart;
- }
- }
- case 72 :
- break;
- case 8 :
- case 9 :
- case 10 :
- case 11 :
- case 12 :
- case 13 :
- case 14 :
- case 15 :
- case 16 :
- case 21 : {
- if (yychar > MAX_TO_SCAN) {
- hasMore = false;
- return EncodingParserConstants.MAX_CHARS_REACHED;
- }
- }
- case 73 :
- break;
- case 41 : {
- yybegin(YYINITIAL);
- return XMLHeadTokenizerConstants.XMLDeclEnd;
- }
- case 74 :
- break;
- case 63 : {
- pushCurrentState();
- yybegin(QuotedAttributeValue);
- return XMLHeadTokenizerConstants.XMLDelEncoding;
- }
- case 75 :
- break;
- case 3 :
- case 17 : {
- pushCurrentState();
- yybegin(QuotedAttributeValue);
- }
- case 76 :
- break;
- case 46 : {
- hasMore = false;
- return EncodingParserConstants.UTF83ByteBOM;
- }
- case 77 :
- break;
- case 33 : {
- hasMore = false;
- return EncodingParserConstants.UTF16BE;
- }
- case 78 :
- break;
- case 34 : {
- hasMore = false;
- return EncodingParserConstants.UTF16LE;
- }
- case 79 :
- break;
- case 24 :
- case 26 :
- case 29 : {
- string.append(yytext());
- }
- case 80 :
- break;
- case 23 : {
- yybegin(SQ_STRING);
- string.setLength(0);
- }
- case 81 :
- break;
- case 22 : {
- yybegin(DQ_STRING);
- string.setLength(0);
- }
- case 82 :
- break;
- case 27 : {
- yypushback(1);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.InvalidTerminatedStringValue;
- }
- case 83 :
- break;
- case 28 : {
- popState();
- valueText = string.toString();
- return EncodingParserConstants.StringValue;
- }
- case 84 :
- break;
- case 30 : {
- yypushback(1);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.UnDelimitedStringValue;
- }
- case 85 :
- break;
- case 31 : {
- yypushback(1);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.UnDelimitedStringValue;
- }
- case 86 :
- break;
- default :
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
- yy_do_eof();
- {
- hasMore = false;
- return EncodingParserConstants.EOF;
- }
- }
- else {
- yy_ScanError(YY_NO_MATCH);
- }
- }
- }
- }
-
- /**
- * Runs the scanner on input files.
- *
- * This main method is the debugging routine for the scanner. It prints
- * each returned token to System.out until the end of file is reached, or
- * an error occured.
- *
- * @param argv
- * the command line, contains the filenames to run the scanner
- * on.
- */
- public static void main(String argv[]) {
- for (int i = 0; i < argv.length; i++) {
- CSSHeadTokenizer scanner = null;
- try {
- scanner = new CSSHeadTokenizer(new java.io.FileReader(argv[i]));
- }
- catch (java.io.FileNotFoundException e) {
- System.out.println("File not found : \"" + argv[i] + "\"");
- System.exit(1);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("Usage : java CSSHeadTokenizer <inputfile>");
- System.exit(1);
- }
-
- try {
- do {
- System.out.println(scanner.primGetNextToken());
- }
- while (!scanner.yy_atEOF);
-
- }
- catch (java.io.IOException e) {
- System.out.println("An I/O error occured while scanning :");
- System.out.println(e);
- System.exit(1);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSHeadTokenizerConstants.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSHeadTokenizerConstants.java
deleted file mode 100644
index b8ddef77fa..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSHeadTokenizerConstants.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.content;
-
-
-public interface CSSHeadTokenizerConstants {
-
- String RuleEnd = "RuleEnd"; //$NON-NLS-1$
- String CHARSET_RULE = "CHARSET_RULE"; //$NON-NLS-1$
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSResourceEncodingDetector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSResourceEncodingDetector.java
deleted file mode 100644
index 4a50adc4ee..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/CSSResourceEncodingDetector.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.content;
-
-import java.io.IOException;
-
-import org.eclipse.wst.common.encoding.EncodingMemento;
-import org.eclipse.wst.common.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-
-
-
-public class CSSResourceEncodingDetector extends AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
- private CSSHeadTokenizer fTokenizer;
-
- /**
- * There is no spec defined encoding for CSS, so Null is returned.
- */
- public String getSpecDefaultEncoding() {
- // should match what's in plugin.xml (or look it up from there).
- return null;
- }
-
- private boolean canHandleAsUnicodeStream(String tokenType) {
- boolean canHandleAsUnicodeStream = false;
- if (tokenType == EncodingParserConstants.UTF83ByteBOM) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-8"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- fEncodingMemento.setUTF83ByteBOMUsed(true);
- }
- else if (tokenType == EncodingParserConstants.UTF16BE) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-16BE"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- }
- else if (tokenType == EncodingParserConstants.UTF16LE) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-16"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- }
- return canHandleAsUnicodeStream;
- }
-
- /**
- * @return Returns the tokenizer.
- */
- private CSSHeadTokenizer getTokenizer() {
- if (fTokenizer == null) {
- fTokenizer = new CSSHeadTokenizer();
- }
- return fTokenizer;
- }
-
- private boolean isLegalString(String valueTokenType) {
- if (valueTokenType == null)
- return false;
- else
- return valueTokenType.equals(EncodingParserConstants.StringValue) || valueTokenType.equals(EncodingParserConstants.UnDelimitedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTerminatedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue);
- }
-
- protected void parseInput() throws IOException {
- checkInContents();
- if (fEncodingMemento == null) {
- checkHeuristics();
- }
- }
-
- private void checkInContents() throws IOException {
- CSSHeadTokenizer tokenizer = getTokenizer();
- tokenizer.reset(fReader);
- HeadParserToken token = null;
- String tokenType = null;
- do {
- token = tokenizer.getNextToken();
- tokenType = token.getType();
- if (canHandleAsUnicodeStream(tokenType)) {
- // side effect of canHandle is to create appropriate memento
- }
- else if (tokenType == CSSHeadTokenizerConstants.CHARSET_RULE) {
- if (tokenizer.hasMoreTokens()) {
- HeadParserToken valueToken = tokenizer.getNextToken();
- String valueTokenType = valueToken.getType();
- if (isLegalString(valueTokenType)) {
- createEncodingMemento(valueToken.getText(), EncodingMemento.FOUND_ENCODING_IN_CONTENT);
-
- }
- }
- }
-
- }
- while (tokenizer.hasMoreTokens());
- }
-
- /**
- *
- */
- private void checkHeuristics() throws IOException {
- boolean noHeuristic = false;
- String heuristicEncoding = null;
- try {
- fReader.reset();
- byte[] bytes = new byte[3];
- int nRead = 0;
- for (int i = 0; i < bytes.length; i++) {
- if (fReader.ready()) {
- int oneByte = fReader.read();
- nRead++;
- if (oneByte <= 0xFF) {
- bytes[i] = (byte) oneByte;
- }
- else {
- noHeuristic = true;
- }
- }
- else {
- noHeuristic = true;
- break;
- }
- }
- if (!noHeuristic && nRead == 3) {
- heuristicEncoding = EncodingGuesser.guessEncoding(bytes, 3);
- }
- }
- catch (IOException e) {
- // if any IO exception, then not a heuristic case
- }
- finally {
- fReader.reset();
- }
- if (heuristicEncoding != null) {
- createEncodingMemento(heuristicEncoding, EncodingMemento.GUESSED_ENCODING_FROM_STREAM);
- }
-
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/ContentDescriberForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/ContentDescriberForCSS.java
deleted file mode 100644
index 00a9f9c783..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/ContentDescriberForCSS.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.content;
-
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.eclipse.wst.common.encoding.IResourceCharsetDetector;
-
-
-public class ContentDescriberForCSS extends AbstractContentDescriber implements ITextContentDescriber {
-
- protected IResourceCharsetDetector getDetector() {
- return new CSSResourceEncodingDetector();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/EncodingGuesser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/EncodingGuesser.java
deleted file mode 100644
index bd05a5ec0b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/EncodingGuesser.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.content;
-
-/**
- *
- * This is ported from PageDesigner's hpbcom/Kanji.cpp's
- * Kanji::guess_kanji_code(),
- *
- */
-public class EncodingGuesser {
- private static final int ASCII = 0; // ASCII
- // ISO-2022-JP
- private static final int ASCII_IN = 8; // This is after ISO2022's change
- // Shift-JIS
- private static final int EUC_HALFKANA = 6; // This is Half Kana in EUC-JP
- private static final int EUC_JP = 3; // This is EUC-JP
- private static final int ISO2022_JP = 4; // This is ISO-2022-JP
- private static final int JIS_HALFKANA = 7; // THis is Half Kana in
- private static final byte KT_EUC1 = 0x40;
- private static final byte KT_EUC2 = (byte) 0x80;
- // ASCII
- private static final byte KT_JIN = 0x01;
- private static final byte KT_JOUT = 0x02;
- // private static final byte KT_ESC = 0x04;
- // private static final byte KT_JIS = 0x08;
- private static final byte KT_SFT1 = 0x10;
- private static final byte KT_SFT2 = 0x20;
- private static final byte ktype[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x09, 0x08, 0x08, 0x08, /* !"#$%&' *//* " */
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* ()*+,-./ */
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 01234567 */
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 89:; <=>? */
- 0x29, 0x28, 0x2b, 0x28, 0x28, 0x28, 0x28, 0x28, /* @ABCDEFG */
- 0x2a, 0x28, 0x2a, 0x28, 0x28, 0x28, 0x28, 0x28, /* HIJKLMNO */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* PQRSTUVW */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* XYZ[\]^_ */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* abcdefg */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* hijklmno */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* pqrstuvw */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, /* xyz{|}~ */
- 0x20, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, /* 80 */
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, /* 90 */
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* A0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* B0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* C0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* D0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, /* E0 */
- (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, /* F0 */
- (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xc0, (byte) 0xc0, 0x00,};
- // private static final int ISO8859_1 = 1; // ISO-1
- private static final int SHIFT_JIS = 2; // This is Shift-JIS
- private static final int SJIS_HALFKANA = 5; // This is Half Kana in
-
- /**
- * Currently, only Japanese encodings are supported.
- */
- private static final int UNKNOWN = -1; // Unknown
-
- /**
- * @return java.lang.String
- * @param code
- * int
- *
- * Convert private int to IANA Encoding name.
- */
- private static String convertToIANAEncodingName(int code) {
- String encoding = null;
-
- switch (code) {
- case SHIFT_JIS :
- case SJIS_HALFKANA :
- encoding = "Shift_JIS";//$NON-NLS-1$
- break;
- case EUC_JP :
- case EUC_HALFKANA :
- encoding = "EUC-JP";//$NON-NLS-1$
- break;
- case ISO2022_JP :
- case JIS_HALFKANA :
- encoding = "ISO-2022-JP";//$NON-NLS-1$
- default :
- break;
- }
-
- return encoding;
- }
-
- /**
- * Return guessed Java Encoding name target: bytes to be inspected length:
- * length of target
- */
- public static String guessEncoding(byte[] target, int length) {
- int code = UNKNOWN;
-
- // Currently, only Japanese is supported.
- String system_ctype = java.util.Locale.getDefault().getLanguage();
- String jp_ctype = java.util.Locale.JAPANESE.getLanguage();
- if (system_ctype.compareTo(jp_ctype) == 0) {
- // Ok, I'm under ja_JP.
- code = ASCII;
- int pos = 0;
- while ((code == ASCII) && (length > 0)) {
- int ch1 = target[pos];
- ch1 = ch1 & 0x000000FF;
- int ch2 = (length >= 2) ? target[pos + 1] : 0;
- ch2 = ch2 & 0x000000FF;
- int ch3 = (length >= 3) ? target[pos + 2] : 0;
- ch3 = ch3 & 0x000000FF;
- code = guessJapaneseKanjiCode(ch1, ch2, ch3, 0);
- pos++;
- length--;
- }
- switch (code) {
- case ISO2022_JP :
- case JIS_HALFKANA :
- code = ISO2022_JP;
- break;
- case EUC_JP :
- code = EUC_JP;
- break;
- default :
- code = SHIFT_JIS;
- }
- }
- return (convertToIANAEncodingName(code));
- }
-
- /**
- * Guess the encoding. halfkana_flag = 0x01 ( detect SJIS half kana )
- * halfkana_flag = 0x02 ( detect EUC half kana )
- */
- private static int guessJapaneseKanjiCode(int ch1, int ch2, int ch3, int halfkana_flag) {
- boolean sjis_hankaku_flag = ((halfkana_flag & 0x01) != 0) ? true : false;
- boolean euc_hankaku_flag = ((halfkana_flag & 0x02) != 0) ? true : false;
-
- if (ch1 == 0)
- return UNKNOWN;
- if (sjis_hankaku_flag && ch1 >= 0xa1 && ch1 <= 0xdf)
- return SJIS_HALFKANA;
- else if (euc_hankaku_flag && ch1 == 0x8e && ch2 >= 0xa1 && ch2 <= 0xdf)
- return EUC_HALFKANA;
- else if (((ktype[ch1] & KT_SFT1) != 0) && ((ktype[ch2] & KT_SFT2) != 0))
- return SHIFT_JIS;
- else if (((ktype[ch1] & KT_EUC1) != 0) && ((ktype[ch2] & KT_EUC2) != 0))
- return EUC_JP;
- else if (ch1 == 0x1b && ((ktype[ch2] & KT_JIN) != 0))
- return ISO2022_JP;
- else if (ch1 >= 0xa1 && ch1 <= 0xdf)
- return SJIS_HALFKANA;
- else if (ch1 == 0x1b && ch2 == 0x28/* '(' */&& ch3 == 0x49/* 'I' */)
- return JIS_HALFKANA;
- else if (ch1 == 0x1b && ch2 == 0x28/* '(' */&& ((ktype[ch3] & KT_JOUT) != 0))
- return ASCII_IN;
-
- return ASCII;
- }
-
- public EncodingGuesser() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/HeadParserToken.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/HeadParserToken.java
deleted file mode 100644
index b7d9a531be..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/HeadParserToken.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.content;
-
-public class HeadParserToken {
- private int fStart;
-
- private String fText;
- private String fType;
-
- protected HeadParserToken() {
- super();
- }
-
- public HeadParserToken(String type, int start, String text) {
- this();
- fType = type;
- fStart = start;
- fText = text;
-
- }
-
- public String getText() {
- return fText;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return ("text: " + fText + " offset: " + fStart + " type: " + fType); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/IntStack.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/IntStack.java
deleted file mode 100644
index ab95ad51e4..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/IntStack.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.content;
-
-/*
- *
- * A non-resizable class implementing the behavior of java.util.Stack, but
- * directly for the <code> integer </code> primitive.
- */
-import java.util.EmptyStackException;
-
-public class IntStack {
- private int[] list = null;
-
- private int size = 0;
-
- public IntStack() {
- this(100);
- }
-
- public IntStack(int maxdepth) {
- super();
- list = new int[maxdepth];
- initialize();
- }
-
- public void clear() {
- initialize();
- }
-
- public boolean empty() {
- return size == 0;
- }
-
- public int get(int slot) {
- return list[slot];
- }
-
- private void initialize() {
- for (int i = 0; i < list.length; i++)
- list[i] = -1;
- }
-
- /**
- * Returns the int at the top of the stack without removing it
- *
- * @return int at the top of this stack.
- * @exception EmptyStackException
- * when empty.
- */
- public int peek() {
- if (size == 0)
- throw new EmptyStackException();
- return list[size - 1];
- }
-
- /**
- * Removes and returns the int at the top of the stack
- *
- * @return int at the top of this stack.
- * @exception EmptyStackException
- * when empty.
- */
- public int pop() {
- int value = peek();
- list[size - 1] = -1;
- size--;
- return value;
- }
-
- /**
- * Pushes an item onto the top of this stack.
- *
- * @param newValue -
- * the int to be pushed onto this stack.
- * @return the <code>newValue</code> argument.
- */
- public int push(int newValue) {
- if (size == list.length) {
- throw new StackOverflowError();
- }
- list[size++] = newValue;
- return newValue;
- }
-
- public int size() {
- return list.length;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/NullMemento.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/NullMemento.java
deleted file mode 100644
index 3c5c734ef0..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/content/NullMemento.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.content;
-
-import org.eclipse.wst.common.encoding.EncodingMemento;
-import org.eclipse.wst.common.encoding.NonContentBasedEncodingRules;
-
-
-
-/**
- * This class can be used in place of an EncodingMemento (its super class),
- * when there is not in fact ANY encoding information. For example, when a
- * structuredDocument is created directly from a String
- */
-public class NullMemento extends EncodingMemento {
- /**
- *
- */
- public NullMemento() {
- super();
- String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
- setJavaCharsetName(defaultCharset);
- setAppropriateDefault(defaultCharset);
- setDetectedCharsetName(null);
- addTrace(DEFAULTS_ASSUMED_FOR_EMPTY_INPUT);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java
deleted file mode 100644
index 8d02ac886b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-/**
- *
- */
-public interface IMediaGroupID {
-
- public final static String M_CONTINUOUS = "continuous"; //$NON-NLS-1$
- public final static String M_PAGED = "paged"; //$NON-NLS-1$
-
- public final static String M_VISUAL = "visual"; //$NON-NLS-1$
- public final static String M_AURAL = "aural"; //$NON-NLS-1$
- public final static String M_TACTILE = "tactile"; //$NON-NLS-1$
-
- public final static String M_GRID = "grid"; //$NON-NLS-1$
- public final static String M_BITMAP = "bitmap"; //$NON-NLS-1$
-
- public final static String M_INTERACTIVE = "interactive"; //$NON-NLS-1$
- public final static String M_STATIC = "static"; //$NON-NLS-1$
-
- public final static String M_ALL = "all"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java
deleted file mode 100644
index f49c1a113e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-/**
- *
- */
-public interface IValID {
-
- public final static String V_100 = "100"; //$NON-NLS-1$
- public final static String V_200 = "200"; //$NON-NLS-1$
- public final static String V_300 = "300"; //$NON-NLS-1$
- public final static String V_400 = "400"; //$NON-NLS-1$
- public final static String V_500 = "500"; //$NON-NLS-1$
- public final static String V_600 = "600"; //$NON-NLS-1$
- public final static String V_700 = "700"; //$NON-NLS-1$
- public final static String V_800 = "800"; //$NON-NLS-1$
- public final static String V_900 = "900"; //$NON-NLS-1$
- public final static String V_ABOVE = "above"; //$NON-NLS-1$
- public final static String V_ABSOLUTE = "absolute"; //$NON-NLS-1$
- public final static String V_ACTIVEBORDER = "ActiveBorder"; //$NON-NLS-1$
- public final static String V_ACTIVECAPTION = "ActiveCaption"; //$NON-NLS-1$
- public final static String V_ALL = "all"; //$NON-NLS-1$
- public final static String V_ALWAYS = "always"; //$NON-NLS-1$
- public final static String V_APPWORKSPACE = "AppWorkspace"; //$NON-NLS-1$
- public final static String V_AQUA = "aqua"; //$NON-NLS-1$
- public final static String V_ARMENIAN = "armenian"; //$NON-NLS-1$
- public final static String V_AUTO = "auto"; //$NON-NLS-1$
- public final static String V_AVOID = "avoid"; //$NON-NLS-1$
- public final static String V_BACKGROUND = "Background"; //$NON-NLS-1$
- public final static String V_BASELINE = "baseline"; //$NON-NLS-1$
- public final static String V_BEHIND = "behind"; //$NON-NLS-1$
- public final static String V_BELOW = "below"; //$NON-NLS-1$
- public final static String V_BIDI_OVERRIDE = "bidi-override"; //$NON-NLS-1$
- public final static String V_BLACK = "black"; //$NON-NLS-1$
- public final static String V_BLINK = "blink"; //$NON-NLS-1$
- public final static String V_BLOCK = "block"; //$NON-NLS-1$
- public final static String V_BLUE = "blue"; //$NON-NLS-1$
- public final static String V_BOLD = "bold"; //$NON-NLS-1$
- public final static String V_BOLDER = "bolder"; //$NON-NLS-1$
- public final static String V_BOTH = "both"; //$NON-NLS-1$
- public final static String V_BOTTOM = "bottom"; //$NON-NLS-1$
- public final static String V_BUTTONFACE = "ButtonFace"; //$NON-NLS-1$
- public final static String V_BUTTONHIGHLIGHT = "ButtonHighlight"; //$NON-NLS-1$
- public final static String V_BUTTONSHADOW = "ButtonShadow"; //$NON-NLS-1$
- public final static String V_BUTTONTEXT = "ButtonText"; //$NON-NLS-1$
- public final static String V_CAPITALIZE = "capitalize"; //$NON-NLS-1$
- public final static String V_CAPTION = "caption"; //$NON-NLS-1$
- public final static String V_CAPTIONTEXT = "CaptionText"; //$NON-NLS-1$
- public final static String V_CENTER = "center"; //$NON-NLS-1$
- public final static String V_CENTER_LEFT = "center-left"; //$NON-NLS-1$
- public final static String V_CENTER_RIGHT = "center-right"; //$NON-NLS-1$
- public final static String V_CHILD = "child"; //$NON-NLS-1$
- public final static String V_CIRCLE = "circle"; //$NON-NLS-1$
- public final static String V_CJK_IDEOGRAPHIC = "cjk-ideographic"; //$NON-NLS-1$
- public final static String V_CLOSE_QUOTE = "close-quote"; //$NON-NLS-1$
- public final static String V_CODE = "code"; //$NON-NLS-1$
- public final static String V_CONDENSED = "condensed"; //$NON-NLS-1$
- public final static String V_COLLAPSE = "collapse"; //$NON-NLS-1$
- public final static String V_COMPACT = "compact"; //$NON-NLS-1$
- public final static String V_CONTINUOUS = "continuous"; //$NON-NLS-1$
- public final static String V_CROP = "crop"; //$NON-NLS-1$
- public final static String V_CROSS = "cross"; //$NON-NLS-1$
- public final static String V_CROSSHAIR = "crosshair"; //$NON-NLS-1$
- public final static String V_CURSIVE = "cursive"; //$NON-NLS-1$
- public final static String V_DASHED = "dashed"; //$NON-NLS-1$
- public final static String V_DECIMAL = "decimal"; //$NON-NLS-1$
- public final static String V_DECIMAL_LEADING_ZERO = "decimal-leading-zero"; //$NON-NLS-1$
- public final static String V_DEFAULT = "default"; //$NON-NLS-1$
- public final static String V_DIGITS = "digits"; //$NON-NLS-1$
- public final static String V_DISC = "disc"; //$NON-NLS-1$
- public final static String V_DOTTED = "dotted"; //$NON-NLS-1$
- public final static String V_DOUBLE = "double"; //$NON-NLS-1$
- public final static String V_E_RESIZE = "e-resize"; //$NON-NLS-1$
- public final static String V_EMBED = "embed"; //$NON-NLS-1$
- public final static String V_EXPANDED = "expanded"; //$NON-NLS-1$
- public final static String V_EXTRA_CONDENSED = "extra-condensed"; //$NON-NLS-1$
- public final static String V_EXTRA_EXPANDED = "extra-expanded"; //$NON-NLS-1$
- public final static String V_FANTASY = "fantasy"; //$NON-NLS-1$
- public final static String V_FAR_LEFT = "far-left"; //$NON-NLS-1$
- public final static String V_FAR_RIGHT = "far-right"; //$NON-NLS-1$
- public final static String V_FAST = "fast"; //$NON-NLS-1$
- public final static String V_FASTER = "faster"; //$NON-NLS-1$
- public final static String V_FEMALE = "female"; //$NON-NLS-1$
- public final static String V_FIXED = "fixed"; //$NON-NLS-1$
- public final static String V_FUCHSIA = "fuchsia"; //$NON-NLS-1$
- public final static String V_GEORGIAN = "georgian"; //$NON-NLS-1$
- public final static String V_GRAY = "gray"; //$NON-NLS-1$
- public final static String V_GRAYTEXT = "GrayText"; //$NON-NLS-1$
- public final static String V_GREEN = "green"; //$NON-NLS-1$
- public final static String V_GROOVE = "groove"; //$NON-NLS-1$
- public final static String V_HEBREW = "hebrew"; //$NON-NLS-1$
- public final static String V_HELP = "help"; //$NON-NLS-1$
- public final static String V_HIDDEN = "hidden"; //$NON-NLS-1$
- public final static String V_HIDE = "hide"; //$NON-NLS-1$
- public final static String V_HIGH = "high"; //$NON-NLS-1$
- public final static String V_HIGHLIGHT = "Highlight"; //$NON-NLS-1$
- public final static String V_HIGHLIGHTTEXT = "HighlightText"; //$NON-NLS-1$
- public final static String V_HIGHER = "higher"; //$NON-NLS-1$
- public final static String V_HIRAGANA = "hiragana"; //$NON-NLS-1$
- public final static String V_HIRAGANA_IROHA = "hiragana-iroha"; //$NON-NLS-1$
- public final static String V_ICON = "icon"; //$NON-NLS-1$
- public final static String V_INACTIVEBORDER = "InactiveBorder"; //$NON-NLS-1$
- public final static String V_INACTIVECAPTION = "InactiveCaption"; //$NON-NLS-1$
- public final static String V_INACTIVECAPTIONTEXT = "InactiveCaptionText"; //$NON-NLS-1$
- public final static String V_INFOBACKGROUND = "InfoBackground"; //$NON-NLS-1$
- public final static String V_INFOTEXT = "InfoText"; //$NON-NLS-1$
- public final static String V_INLINE = "inline"; //$NON-NLS-1$
- public final static String V_INLINE_TABLE = "inline-table"; //$NON-NLS-1$
- public final static String V_INSET = "inset"; //$NON-NLS-1$
- public final static String V_INSIDE = "inside"; //$NON-NLS-1$
- public final static String V_INVERT = "invert"; //$NON-NLS-1$
- public final static String V_ITALIC = "italic"; //$NON-NLS-1$
- public final static String V_JUSTIFY = "justify"; //$NON-NLS-1$
- public final static String V_KATAKANA = "katakana"; //$NON-NLS-1$
- public final static String V_KATAKANA_IROHA = "katakana-iroha"; //$NON-NLS-1$
- public final static String V_LANDSCAPE = "landscape"; //$NON-NLS-1$
- public final static String V_LARGE = "large"; //$NON-NLS-1$
- public final static String V_LARGER = "larger"; //$NON-NLS-1$
- public final static String V_LEFT = "left"; //$NON-NLS-1$
- public final static String V_LEFT_SIDE = "left-side"; //$NON-NLS-1$
- public final static String V_LEFTWARDS = "leftwards"; //$NON-NLS-1$
- public final static String V_LEVEL = "level"; //$NON-NLS-1$
- public final static String V_LIGHTER = "lighter"; //$NON-NLS-1$
- public final static String V_LIME = "lime"; //$NON-NLS-1$
- public final static String V_LINE_THROUGH = "line-through"; //$NON-NLS-1$
- public final static String V_LIST_ITEM = "list-item"; //$NON-NLS-1$
- public final static String V_LOUD = "loud"; //$NON-NLS-1$
- public final static String V_LOW = "low"; //$NON-NLS-1$
- public final static String V_LOWER = "lower"; //$NON-NLS-1$
- public final static String V_LOWER_ALPHA = "lower-alpha"; //$NON-NLS-1$
- public final static String V_LOWER_GREEK = "lower-greek"; //$NON-NLS-1$
- public final static String V_LOWER_LATIN = "lower-latin"; //$NON-NLS-1$
- public final static String V_LOWER_ROMAN = "lower-roman"; //$NON-NLS-1$
- public final static String V_LOWERCASE = "lowercase"; //$NON-NLS-1$
- public final static String V_LTR = "ltr"; //$NON-NLS-1$
- public final static String V_MALE = "male"; //$NON-NLS-1$
- public final static String V_MARKER = "marker"; //$NON-NLS-1$
- public final static String V_MAROON = "maroon"; //$NON-NLS-1$
- public final static String V_MEDIUM = "medium"; //$NON-NLS-1$
- public final static String V_MENU = "menu"; //$NON-NLS-1$
- public final static String V_MENUTEXT = "MenuText"; //$NON-NLS-1$
- public final static String V_MESSAGE_BOX = "message-box"; //$NON-NLS-1$
- public final static String V_MIDDLE = "middle"; //$NON-NLS-1$
- public final static String V_MIX = "mix"; //$NON-NLS-1$
- public final static String V_MONOSPACE = "monospace"; //$NON-NLS-1$
- public final static String V_MOVE = "move"; //$NON-NLS-1$
- public final static String V_N_RESIZE = "n-resize"; //$NON-NLS-1$
- public final static String V_NARROWER = "narrower"; //$NON-NLS-1$
- public final static String V_NAVY = "navy"; //$NON-NLS-1$
- public final static String V_NE_RESIZE = "ne-resize"; //$NON-NLS-1$
- public final static String V_NO_CLOSE_QUOTE = "no-close-quote"; //$NON-NLS-1$
- public final static String V_NO_OPEN_QUOTE = "no-open-quote"; //$NON-NLS-1$
- public final static String V_NO_REPEAT = "no-repeat"; //$NON-NLS-1$
- public final static String V_NONE = "none"; //$NON-NLS-1$
- public final static String V_NORMAL = "normal"; //$NON-NLS-1$
- public final static String V_NOWRAP = "nowrap"; //$NON-NLS-1$
- public final static String V_NW_RESIZE = "nw-resize"; //$NON-NLS-1$
- public final static String V_OBLIQUE = "oblique"; //$NON-NLS-1$
- public final static String V_OLIVE = "olive"; //$NON-NLS-1$
- public final static String V_ONCE = "once"; //$NON-NLS-1$
- public final static String V_OPEN_QUOTE = "open-quote"; //$NON-NLS-1$
- public final static String V_OUTSET = "outset"; //$NON-NLS-1$
- public final static String V_OUTSIDE = "outside"; //$NON-NLS-1$
- public final static String V_OVERLINE = "overline"; //$NON-NLS-1$
- public final static String V_POINTER = "pointer"; //$NON-NLS-1$
- public final static String V_PORTRAIT = "portrait"; //$NON-NLS-1$
- public final static String V_PRE = "pre"; //$NON-NLS-1$
- public final static String V_PURPLE = "purple"; //$NON-NLS-1$
- public final static String V_RED = "red"; //$NON-NLS-1$
- public final static String V_RELATIVE = "relative"; //$NON-NLS-1$
- public final static String V_REPEAT = "repeat"; //$NON-NLS-1$
- public final static String V_REPEAT_X = "repeat-x"; //$NON-NLS-1$
- public final static String V_REPEAT_Y = "repeat-y"; //$NON-NLS-1$
- public final static String V_RIDGE = "ridge"; //$NON-NLS-1$
- public final static String V_RIGHT = "right"; //$NON-NLS-1$
- public final static String V_RIGHT_SIDE = "right-side"; //$NON-NLS-1$
- public final static String V_RIGHTWARDS = "rightwards"; //$NON-NLS-1$
- public final static String V_RTL = "rtl"; //$NON-NLS-1$
- public final static String V_RUN_IN = "run-in"; //$NON-NLS-1$
- public final static String V_S_RESIZE = "s-resize"; //$NON-NLS-1$
- public final static String V_SANS_SERIF = "sans-serif"; //$NON-NLS-1$
- public final static String V_SCROLL = "scroll"; //$NON-NLS-1$
- public final static String V_SCROLLBAR = "Scrollbar"; //$NON-NLS-1$
- public final static String V_SE_RESIZE = "se-resize"; //$NON-NLS-1$
- public final static String V_SEMI_CONDENSED = "semi-condensed"; //$NON-NLS-1$
- public final static String V_SEMI_EXPANDED = "semi-expanded"; //$NON-NLS-1$
- public final static String V_SEPARATE = "separate"; //$NON-NLS-1$
- public final static String V_SERIF = "serif"; //$NON-NLS-1$
- public final static String V_SHOW = "show"; //$NON-NLS-1$
- public final static String V_SILENT = "silent"; //$NON-NLS-1$
- public final static String V_SILVER = "silver"; //$NON-NLS-1$
- public final static String V_SLOW = "slow"; //$NON-NLS-1$
- public final static String V_SLOWER = "slower"; //$NON-NLS-1$
- public final static String V_SMALL = "small"; //$NON-NLS-1$
- public final static String V_SMALL_CAPS = "small-caps"; //$NON-NLS-1$
- public final static String V_SMALL_CAPTION = "small-caption"; //$NON-NLS-1$
- public final static String V_SMALLER = "smaller"; //$NON-NLS-1$
- public final static String V_SOFT = "soft"; //$NON-NLS-1$
- public final static String V_SOLID = "solid"; //$NON-NLS-1$
- public final static String V_SPELL_OUT = "spell-out"; //$NON-NLS-1$
- public final static String V_SQUARE = "square"; //$NON-NLS-1$
- public final static String V_STATIC = "static"; //$NON-NLS-1$
- public final static String V_STATUS_BAR = "status-bar"; //$NON-NLS-1$
- public final static String V_SUB = "sub"; //$NON-NLS-1$
- public final static String V_SUPER = "super"; //$NON-NLS-1$
- public final static String V_SW_RESIZE = "sw-resize"; //$NON-NLS-1$
- public final static String V_TABLE = "table"; //$NON-NLS-1$
- public final static String V_TABLE_CAPTION = "table-caption"; //$NON-NLS-1$
- public final static String V_TABLE_CELL = "table-cell"; //$NON-NLS-1$
- public final static String V_TABLE_COLUMN = "table-column"; //$NON-NLS-1$
- public final static String V_TABLE_COLUMN_GROUP = "table-column-group"; //$NON-NLS-1$
- public final static String V_TABLE_FOOTER_GROUP = "table-footer-group"; //$NON-NLS-1$
- public final static String V_TABLE_HEADER_GROUP = "table-header-group"; //$NON-NLS-1$
- public final static String V_TABLE_ROW = "table-row"; //$NON-NLS-1$
- public final static String V_TABLE_ROW_GROUP = "table-row-group"; //$NON-NLS-1$
- public final static String V_TEAL = "teal"; //$NON-NLS-1$
- public final static String V_TEXT = "text"; //$NON-NLS-1$
- public final static String V_TEXT_TOP = "text-top"; //$NON-NLS-1$
- public final static String V_TEXT_BOTTOM = "text-bottom"; //$NON-NLS-1$
- public final static String V_THICK = "thick"; //$NON-NLS-1$
- public final static String V_THIN = "thin"; //$NON-NLS-1$
- public final static String V_THREEDDARKSHADOW = "ThreeDDarkShadow"; //$NON-NLS-1$
- public final static String V_THREEDFACE = "ThreeDFace"; //$NON-NLS-1$
- public final static String V_THREEDHIGHLIGHT = "ThreeDHighlight"; //$NON-NLS-1$
- public final static String V_THREEDLIGHTSHADOW = "ThreeDLightShadow"; //$NON-NLS-1$
- public final static String V_THREEDSHADOW = "ThreeDShadow"; //$NON-NLS-1$
- public final static String V_TOP = "top"; //$NON-NLS-1$
- public final static String V_TRANSPARENT = "transparent"; //$NON-NLS-1$
- public final static String V_ULTRA_CONDENSED = "ultra-condensed"; //$NON-NLS-1$
- public final static String V_ULTRA_EXPANDED = "ultra-expanded"; //$NON-NLS-1$
- public final static String V_UNDERLINE = "underline"; //$NON-NLS-1$
- public final static String V_UPPER_ALPHA = "upper-alpha"; //$NON-NLS-1$
- public final static String V_UPPER_LATIN = "upper-latin"; //$NON-NLS-1$
- public final static String V_UPPER_ROMAN = "upper-roman"; //$NON-NLS-1$
- public final static String V_UPPERCASE = "uppercase"; //$NON-NLS-1$
- public final static String V_VISIBLE = "visible"; //$NON-NLS-1$
- public final static String V_W_RESIZE = "w-resize"; //$NON-NLS-1$
- public final static String V_WAIT = "wait"; //$NON-NLS-1$
- public final static String V_WHITE = "white"; //$NON-NLS-1$
- public final static String V_WIDER = "wider"; //$NON-NLS-1$
- public final static String V_WINDOW = "Window"; //$NON-NLS-1$
- public final static String V_WINDOWFRAME = "WindowFrame"; //$NON-NLS-1$
- public final static String V_WINDOWTEXT = "WindowText"; //$NON-NLS-1$
- public final static String V_X_FAST = "x-fast"; //$NON-NLS-1$
- public final static String V_X_HIGH = "x-high"; //$NON-NLS-1$
- public final static String V_X_LARGE = "x-large"; //$NON-NLS-1$
- public final static String V_X_LOUD = "x-loud"; //$NON-NLS-1$
- public final static String V_X_LOW = "x-low"; //$NON-NLS-1$
- public final static String V_X_SLOW = "x-slow"; //$NON-NLS-1$
- public final static String V_X_SMALL = "x-small"; //$NON-NLS-1$
- public final static String V_X_SOFT = "x-soft"; //$NON-NLS-1$
- public final static String V_XX_SMALL = "xx-small"; //$NON-NLS-1$
- public final static String V_XX_LARGE = "xx-large"; //$NON-NLS-1$
- public final static String V_YELLOW = "yellow"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java
deleted file mode 100644
index d013f7ca6e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- *
- */
-public class PropCMContainer extends PropCMNode {
-
- private java.util.Vector nodes = new Vector();
- private static java.util.Hashtable instances = null;
- public final static String VAL_ABSOLUTE_SIZE = "absolute-size";//$NON-NLS-1$
- public final static String VAL_BORDER_STYLE = "border-style";//$NON-NLS-1$
- public final static String VAL_BORDER_WIDTH = "border-width";//$NON-NLS-1$
- public final static String VAL_COLOR = "color";//$NON-NLS-1$
- public final static String VAL_SYSTEM_COLOR = "system-color";//$NON-NLS-1$
- public final static String VAL_GENERIC_FAMILY = "generic-family";//$NON-NLS-1$
- public final static String VAL_GENERIC_VOICE = "generic-voice";//$NON-NLS-1$
- public final static String VAL_MARGIN_WIDTH = "margin-width";//$NON-NLS-1$
- public final static String VAL_PADDING_WIDTH = "padding-width";//$NON-NLS-1$
- public final static String VAL_RELATIVE_SIZE = "relative-size";//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMContainer(String name) {
- super(name);
- }
-
- /**
- *
- */
- Object appendChild(Object node) {
- if (!nodes.contains(node))
- nodes.add(node);
- return node;
- }
-
- /**
- *
- */
- public boolean canHave(String identifier) {
- int nChild = getNumChild();
- for (int i = 0; i < nChild; i++) {
- Object child = getChildAt(i);
- if (child instanceof String && identifier.equalsIgnoreCase((String) child))
- return true;
- if (child instanceof PropCMContainer && ((PropCMContainer) child).canHave(identifier))
- return true;
- }
- return false;
- }
-
- /**
- *
- */
- public Object getChildAt(int index) {
- if (nodes == null || index < 0 || nodes.size() <= index)
- return null;
- return nodes.elementAt(index);
- }
-
- /**
- *
- */
- static PropCMContainer getContInstanceOf(String name) {
- if (name == null)
- return null;
-
- // initialize
- if (instances == null)
- instances = new Hashtable(20);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMContainer) node;
-
- if (PropCMNode.isLoading()) {
- // register
- node = new PropCMContainer(name);
- instances.put(name, node);
- }
-
- return (PropCMContainer) node;
- }
-
- /**
- *
- */
- void getIdentifiers(Set idents) {
- if (idents == null)
- return;
- int nChildren = nodes.size();
- for (int i = 0; i < nChildren; i++) {
- Object node = nodes.elementAt(i);
- if (node instanceof PropCMNode)
- ((PropCMNode) node).getIdentifiers(idents);
- else if (node instanceof String)
- idents.add(node);
- }
- }
-
- /**
- *
- */
- public int getNumChild() {
- if (nodes == null)
- return 0;
- return nodes.size();
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_CONTAINER;
- }
-
- /**
- *
- */
- void getValues(Collection values) {
- if (values == null)
- return;
- int nChildren = nodes.size();
- for (int i = 0; i < nChildren; i++) {
- Object node = nodes.elementAt(i);
- if (node instanceof PropCMNode)
- ((PropCMNode) node).getValues(values);
- else if (node instanceof String) {
- if (!values.contains(node))
- values.add(node);
- }
- }
- }
-
- /**
- *
- */
- Object removeChild(Object node) {
- nodes.remove(node);
- return node;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java
deleted file mode 100644
index a28e21da9f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-/**
- *
- */
-public class PropCMFontProperty extends PropCMProperty {
-
- // static fields
- private static java.util.Hashtable instances = null;
- private static java.util.Hashtable cachedIdMap = null;
- // selecting properties
- public final static String PF_FONT_FAMILY = "font-family";//$NON-NLS-1$
- public final static String PF_FONT_STYLE = "font-style";//$NON-NLS-1$
- public final static String PF_FONT_VARIANT = "font-variant";//$NON-NLS-1$
- public final static String PF_FONT_WEIGHT = "font-weight";//$NON-NLS-1$
- public final static String PF_FONT_STRETCH = "font-stretch";//$NON-NLS-1$
- public final static String PF_FONT_SIZE = "font-size";//$NON-NLS-1$
- // qualification properties
- public final static String PF_UNICODE_RANGE = "unicode-range";//$NON-NLS-1$
- // numeric properties
- public final static String PF_UNITS_PER_EM = "units-per-em";//$NON-NLS-1$
- // referencing properties
- public final static String PF_SRC = "src";//$NON-NLS-1$
- // matching properties
- public final static String PF_PANOSE_1 = "panose-1";//$NON-NLS-1$
- public final static String PF_STEMV = "stemv";//$NON-NLS-1$
- public final static String PF_STEMH = "stemh";//$NON-NLS-1$
- public final static String PF_SLOPE = "slope";//$NON-NLS-1$
- public final static String PF_CAP_HEIGHT = "cap-height";//$NON-NLS-1$
- public final static String PF_X_HEIGHT = "x-height";//$NON-NLS-1$
- public final static String PF_ASCENT = "ascent";//$NON-NLS-1$
- public final static String PF_DESCENT = "descent";//$NON-NLS-1$
- // synthesis properties
- public final static String PF_WIDTHS = "widths";//$NON-NLS-1$
- public final static String PF_BBOX = "bbox";//$NON-NLS-1$
- public final static String PF_DEFINITION_SRC = "definition-src";//$NON-NLS-1$
- // alignment properties
- public final static String PF_BASELINE = "baseline";//$NON-NLS-1$
- public final static String PF_CENTERLINE = "centerline";//$NON-NLS-1$
- public final static String PF_MATHLINE = "mathline";//$NON-NLS-1$
- public final static String PF_TOPLINE = "topline";//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMFontProperty(String name) {
- super(name);
- }
-
- /**
- *
- */
- public static PropCMProperty getInstanceOf(String name) {
- // initialize
- if (instances == null)
- instances = new Hashtable(10);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMProperty) node;
-
- // register
- if (PropCMNode.isLoading()) {
- node = new PropCMFontProperty(name);
- instances.put(name, node);
- }
-
- return (PropCMProperty) node;
- }
-
- /**
- *
- */
- public static Enumeration getNameEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.keys();
- }
-
- /**
- *
- */
- public static Enumeration getPropertyEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.elements();
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_FONTPROPERTY;
- }
-
- /**
- *
- */
- public static Vector names() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return new Vector(instances.keySet());
- }
-
- /**
- *
- */
- public static List names(Object mediaGroup) {
- if (mediaGroup == null)
- return names();
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- Vector properties = new Vector();
-
- Iterator it = instances.values().iterator();
- while (it.hasNext()) {
- PropCMProperty prop = (PropCMProperty) it.next();
- if (prop.getMediaGroups().contains(mediaGroup))
- properties.add(prop.getName());
- }
-
- return properties;
- }
-
- /**
- * If itentifier is null, get all properties
- */
- public static Vector propertiesFor(String identifier, boolean shorthands) {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // if identifier is null, get all properties
- if (identifier == null)
- return new Vector(instances.values());
-
- if (cachedIdMap == null) {
- // start cacheing
- cachedIdMap = new Hashtable();
- }
- else {
- // search cached
- Object ret = cachedIdMap.get(identifier + String.valueOf(shorthands));
- if (ret != null)
- return new Vector((Collection) ret);
- }
-
- // create
- Enumeration properties = getPropertyEnum();
- HashSet set = new HashSet();
- while (properties.hasMoreElements()) {
- PropCMProperty prop = (PropCMProperty) properties.nextElement();
- if (!shorthands && prop.isShorthand())
- continue;
- if (prop.canHave(identifier))
- set.add(prop);
- }
-
- // cache
- cachedIdMap.put(identifier + String.valueOf(shorthands), set);
-
- return new Vector(set);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java
deleted file mode 100644
index 03efc91c06..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-
-/**
- *
- */
-public class PropCMFunction extends PropCMNode {
-
- private static java.util.Hashtable instances = null;
- public final static String VAL_ATTR = "attr";//$NON-NLS-1$
- public final static String VAL_COUNTER = "counter";//$NON-NLS-1$
- public final static String VAL_RGB = "rgb";//$NON-NLS-1$
- public final static String VAL_SHAPE = "rect";//$NON-NLS-1$
- public final static String VAL_URI = "url";//$NON-NLS-1$
- public final static String VAL_FORMAT = "format";//$NON-NLS-1$
- public final static String VAL_LOCAL = "local";//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMFunction(String name) {
- super(name);
- }
-
- /**
- *
- */
- void getIdentifiers(Set indents) {
- }
-
- /**
- *
- */
- static public PropCMFunction getInstanceOf(String name) {
- if (name == null)
- return null;
-
- // initialize
- if (instances == null)
- instances = new Hashtable(10);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMFunction) node;
-
- // register
- if (PropCMNode.isLoading()) {
- node = new PropCMFunction(name);
- instances.put(name, node);
- }
-
- return (PropCMFunction) node;
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_FUNC;
- }
-
- /**
- *
- */
- void getValues(Collection values) {
- if (values != null && !values.contains(this))
- values.add(this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java
deleted file mode 100644
index 52a84df134..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java
+++ /dev/null
@@ -1,1369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- *
- */
-public abstract class PropCMNode {
-
- public final static short VAL_IDENTIFIER = 0;
- public final static short VAL_PROPERTY = 1;
- public final static short VAL_NUMBER = 2;
- public final static short VAL_STRING = 3;
- public final static short VAL_FUNC = 4;
- public final static short VAL_CONTAINER = 5;
- public final static short VAL_SUBPROPERTY = 6;
- public final static short VAL_FONTPROPERTY = 7;
- public final static short VAL_UNICODE_RANGE = 8;
- protected java.lang.String name = null;
- private static short LOADING = 0; // 0 : not initialized, 1 : under
- // initializing, 2 : initialize-done
- // and fix DB
-
- /**
- *
- */
- public PropCMNode(String name) {
- super();
- this.name = name;
- }
-
- /**
- *
- */
- public Set getIdentifiers() {
- HashSet ids = new HashSet();
- getIdentifiers(ids);
- return ids;
- }
-
- /**
- *
- */
- abstract void getIdentifiers(Set indents);
-
- /**
- *
- */
- public String getName() {
- return name;
- }
-
- /**
- *
- */
- public abstract short getType();
-
- /**
- *
- */
- public Collection getValues() {
- Vector vals = new Vector();
- getValues(vals);
- return vals;
- }
-
- /**
- *
- */
- abstract void getValues(Collection values);
-
- /**
- *
- */
- protected static void initPropertyCM() {
- if (!isNeedInitialize())
- return;
- LOADING = 1;
-
- PropCMNumber.initNumberCMDim();
-
- // azimuth
- PropCMProperty prop = PropCMProperty.getInstanceOf(PropCMProperty.P_AZIMUTH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_ANGLE));
- prop.appendChild(IValID.V_LEFT_SIDE);
- prop.appendChild(IValID.V_FAR_LEFT);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_CENTER_LEFT);
- prop.appendChild(IValID.V_CENTER);
- prop.appendChild(IValID.V_CENTER_RIGHT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendChild(IValID.V_FAR_RIGHT);
- prop.appendChild(IValID.V_RIGHT_SIDE);
- prop.appendChild(IValID.V_BEHIND);
- prop.appendChild(IValID.V_LEFTWARDS);
- prop.appendChild(IValID.V_RIGHTWARDS);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
- prop.setMaxValueCount(2);
-
- // background
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.setMaxValueCount(6);
-
- // background-attachment
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT);
- prop.appendChild(IValID.V_SCROLL);
- prop.appendChild(IValID.V_FIXED);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(IValID.V_TRANSPARENT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-image
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-position ---- sub-properties horizontal
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_CENTER);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-position ---- sub-properties vertical
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_TOP);
- prop.appendChild(IValID.V_CENTER);
- prop.appendChild(IValID.V_BOTTOM);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-position
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION);
- prop.appendChild(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X));
- prop.appendChild(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y));
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-repeat
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT);
- prop.appendChild(IValID.V_REPEAT);
- prop.appendChild(IValID.V_REPEAT_X);
- prop.appendChild(IValID.V_REPEAT_Y);
- prop.appendChild(IValID.V_NO_REPEAT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE));
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR));
- prop.setMaxValueCount(9);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-collapse
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLLAPSE);
- prop.appendChild(IValID.V_COLLAPSE);
- prop.appendChild(IValID.V_SEPARATE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR));
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(IValID.V_TRANSPARENT);
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-spacing
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_SPACING);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE));
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-top
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-right
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-bottom
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-left
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-top-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-top-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-top-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-right-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-right-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-right-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-bottom-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-bottom-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-bottom-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-left-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-left-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-left-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH);
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH));
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // bottom
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BOTTOM);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // caption-side
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CAPTION_SIDE);
- prop.appendChild(IValID.V_TOP);
- prop.appendChild(IValID.V_BOTTOM);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clear
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CLEAR);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendChild(IValID.V_BOTH);
- prop.appendChild(IValID.V_STATIC);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clip ---- sub-properties top
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- ((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clip ---- sub-properties right
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- ((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clip ---- sub-properties bottom
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- ((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clip ---- sub-properties left
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- ((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clip
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_SHAPE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // content
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CONTENT);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_ANY));
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_COUNTER));
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_ATTR));
- prop.appendChild(IValID.V_OPEN_QUOTE);
- prop.appendChild(IValID.V_CLOSE_QUOTE);
- prop.appendChild(IValID.V_NO_OPEN_QUOTE);
- prop.appendChild(IValID.V_NO_CLOSE_QUOTE);
- prop.setMaxValueCount(-1); // infinite
- prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
- // counter-increment
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_INCREMENT);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_COUNTER_ID));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
- // counter-reset
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_RESET);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_COUNTER_ID));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
- // cue
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CUE);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_BEFORE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_AFTER));
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // cue-after
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_AFTER);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // cue-before
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_BEFORE);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // cursor
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CURSOR);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_CROSSHAIR);
- prop.appendChild(IValID.V_DEFAULT);
- prop.appendChild(IValID.V_POINTER);
- prop.appendChild(IValID.V_MOVE);
- prop.appendChild(IValID.V_E_RESIZE);
- prop.appendChild(IValID.V_NE_RESIZE);
- prop.appendChild(IValID.V_NW_RESIZE);
- prop.appendChild(IValID.V_N_RESIZE);
- prop.appendChild(IValID.V_SE_RESIZE);
- prop.appendChild(IValID.V_SW_RESIZE);
- prop.appendChild(IValID.V_S_RESIZE);
- prop.appendChild(IValID.V_W_RESIZE);
- prop.appendChild(IValID.V_TEXT);
- prop.appendChild(IValID.V_WAIT);
- prop.appendChild(IValID.V_HELP);
- prop.setMaxValueCount(-1); // infinite
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
- // direction
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_DIRECTION);
- prop.appendChild(IValID.V_LTR);
- prop.appendChild(IValID.V_RTL);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // display
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_DISPLAY);
- prop.appendChild(IValID.V_INLINE);
- prop.appendChild(IValID.V_BLOCK);
- prop.appendChild(IValID.V_LIST_ITEM);
- prop.appendChild(IValID.V_RUN_IN);
- prop.appendChild(IValID.V_COMPACT);
- prop.appendChild(IValID.V_MARKER);
- prop.appendChild(IValID.V_TABLE);
- prop.appendChild(IValID.V_INLINE_TABLE);
- prop.appendChild(IValID.V_TABLE_ROW_GROUP);
- prop.appendChild(IValID.V_TABLE_HEADER_GROUP);
- prop.appendChild(IValID.V_TABLE_FOOTER_GROUP);
- prop.appendChild(IValID.V_TABLE_ROW);
- prop.appendChild(IValID.V_TABLE_COLUMN_GROUP);
- prop.appendChild(IValID.V_TABLE_COLUMN);
- prop.appendChild(IValID.V_TABLE_CELL);
- prop.appendChild(IValID.V_TABLE_CAPTION);
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
- // elevation
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_ELEVATION);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_ANGLE));
- prop.appendChild(IValID.V_BELOW);
- prop.appendChild(IValID.V_LEVEL);
- prop.appendChild(IValID.V_ABOVE);
- prop.appendChild(IValID.V_HIGHER);
- prop.appendChild(IValID.V_LOWER);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // empty-cells
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_EMPTY_CELLS);
- prop.appendChild(IValID.V_SHOW);
- prop.appendChild(IValID.V_HIDE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // float
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FLOAT);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY));
- prop.appendChild(IValID.V_CAPTION);
- prop.appendChild(IValID.V_ICON);
- prop.appendChild(IValID.V_MENU);
- prop.appendChild(IValID.V_MESSAGE_BOX);
- prop.appendChild(IValID.V_SMALL_CAPTION);
- prop.appendChild(IValID.V_STATUS_BAR);
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-family
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_FONT));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_FAMILY));
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-size
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_ABSOLUTE_SIZE));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_RELATIVE_SIZE));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-size-adjust
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE_ADJUST);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-stretch
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STRETCH);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_WIDER);
- prop.appendChild(IValID.V_NARROWER);
- prop.appendChild(IValID.V_ULTRA_CONDENSED);
- prop.appendChild(IValID.V_EXTRA_CONDENSED);
- prop.appendChild(IValID.V_CONDENSED);
- prop.appendChild(IValID.V_SEMI_CONDENSED);
- prop.appendChild(IValID.V_SEMI_EXPANDED);
- prop.appendChild(IValID.V_EXPANDED);
- prop.appendChild(IValID.V_EXTRA_EXPANDED);
- prop.appendChild(IValID.V_ULTRA_EXPANDED);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE);
- prop.appendChild(IValID.V_ITALIC);
- prop.appendChild(IValID.V_OBLIQUE);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-variant
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT);
- prop.appendChild(IValID.V_SMALL_CAPS);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-weight
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT);
- prop.appendChild(IValID.V_BOLD);
- prop.appendChild(IValID.V_100);
- prop.appendChild(IValID.V_200);
- prop.appendChild(IValID.V_300);
- prop.appendChild(IValID.V_400);
- prop.appendChild(IValID.V_500);
- prop.appendChild(IValID.V_600);
- prop.appendChild(IValID.V_700);
- prop.appendChild(IValID.V_800);
- prop.appendChild(IValID.V_900);
- prop.appendChild(IValID.V_LIGHTER);
- prop.appendChild(IValID.V_BOLDER);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // height
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_HEIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // leftt
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LEFT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // letter-spacing
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LETTER_SPACING);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // line-height
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // list-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // list-style-image
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // list-style-position
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION);
- prop.appendChild(IValID.V_INSIDE);
- prop.appendChild(IValID.V_OUTSIDE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // list-style-type
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE);
- prop.appendChild(IValID.V_DISC);
- prop.appendChild(IValID.V_CIRCLE);
- prop.appendChild(IValID.V_SQUARE);
- prop.appendChild(IValID.V_DECIMAL);
- prop.appendChild(IValID.V_DECIMAL_LEADING_ZERO);
- prop.appendChild(IValID.V_LOWER_ROMAN);
- prop.appendChild(IValID.V_UPPER_ROMAN);
- prop.appendChild(IValID.V_LOWER_GREEK);
- prop.appendChild(IValID.V_LOWER_ALPHA);
- prop.appendChild(IValID.V_LOWER_LATIN);
- prop.appendChild(IValID.V_UPPER_ALPHA);
- prop.appendChild(IValID.V_UPPER_LATIN);
- prop.appendChild(IValID.V_HEBREW);
- prop.appendChild(IValID.V_ARMENIAN);
- prop.appendChild(IValID.V_GEORGIAN);
- prop.appendChild(IValID.V_CJK_IDEOGRAPHIC);
- prop.appendChild(IValID.V_HIRAGANA);
- prop.appendChild(IValID.V_KATAKANA);
- prop.appendChild(IValID.V_HIRAGANA_IROHA);
- prop.appendChild(IValID.V_KATAKANA_IROHA);
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // margin
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN);
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_TOP));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_RIGHT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_BOTTOM));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_LEFT));
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // margin-top
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_TOP);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // margin-right
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_RIGHT);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // margin-bottom
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_BOTTOM);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // margin-left
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_LEFT);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // marker-offset
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARKER_OFFSET);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // marks
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARKS);
- prop.appendChild(IValID.V_CROP);
- prop.appendChild(IValID.V_CROSS);
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // max-height
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_HEIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // max-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_WIDTH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // min-height
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_HEIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // min-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_WIDTH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // orphans
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_ORPHANS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // outline
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_WIDTH));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
- // outline-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(IValID.V_INVERT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
- // outline-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
- // outline-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
- // overflow
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OVERFLOW);
- prop.appendChild(IValID.V_VISIBLE);
- prop.appendChild(IValID.V_HIDDEN);
- prop.appendChild(IValID.V_SCROLL);
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // padding
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING);
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_TOP));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_RIGHT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_BOTTOM));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_LEFT));
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // padding-top
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_TOP);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // padding-right
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_RIGHT);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // padding-bottom
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_BOTTOM);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // padding-left
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_LEFT);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // page
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_PAGE_ID));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // page-break-after
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_AFTER);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_ALWAYS);
- prop.appendChild(IValID.V_AVOID);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // page-break-before
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_BEFORE);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_ALWAYS);
- prop.appendChild(IValID.V_AVOID);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // page-break-inside
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_INSIDE);
- prop.appendChild(IValID.V_AVOID);
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // pause
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_TIME));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // pause-after
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_AFTER);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_TIME));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // pause-before
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_BEFORE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_TIME));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // pitch
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_FREQUENCY));
- prop.appendChild(IValID.V_X_LOW);
- prop.appendChild(IValID.V_LOW);
- prop.appendChild(IValID.V_MEDIUM);
- prop.appendChild(IValID.V_HIGH);
- prop.appendChild(IValID.V_X_HIGH);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // pitch-range
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH_RANGE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // play-during
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PLAY_DURING);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_MIX);
- prop.appendChild(IValID.V_REPEAT);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // position
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_POSITION);
- prop.appendChild(IValID.V_ABSOLUTE);
- prop.appendChild(IValID.V_RELATIVE);
- prop.appendChild(IValID.V_FIXED);
- prop.appendChild(IValID.V_STATIC);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // quotes
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_QUOTES);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_ANY));
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // richness
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_RICHNESS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // right
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_RIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // size
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SIZE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_PORTRAIT);
- prop.appendChild(IValID.V_LANDSCAPE);
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // speak
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_NONE);
- prop.appendChild(IValID.V_SPELL_OUT);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // speak-header
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_HEADER);
- prop.appendChild(IValID.V_ONCE);
- prop.appendChild(IValID.V_ALWAYS);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // speak-numeral
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_NUMERAL);
- prop.appendChild(IValID.V_DIGITS);
- prop.appendChild(IValID.V_CONTINUOUS);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // speak-punctuation
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_PUNCTUATION);
- prop.appendChild(IValID.V_CODE);
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // speech-rate
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEECH_RATE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendChild(IValID.V_X_SLOW);
- prop.appendChild(IValID.V_SLOW);
- prop.appendChild(IValID.V_MEDIUM);
- prop.appendChild(IValID.V_FAST);
- prop.appendChild(IValID.V_X_FAST);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // stress
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_STRESS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // table-layout
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TABLE_LAYOUT);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_FIXED);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // text-align
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_ALIGN);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_CENTER);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendChild(IValID.V_JUSTIFY);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_ANY));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // text-decoration
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_DECORATION);
- prop.appendChild(IValID.V_UNDERLINE);
- prop.appendChild(IValID.V_OVERLINE);
- prop.appendChild(IValID.V_LINE_THROUGH);
- prop.appendChild(IValID.V_BLINK);
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // text-indent
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_INDENT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // text-shadow
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_SHADOW);
- prop.appendChild(IValID.V_NONE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // text-transform
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_TRANSFORM);
- prop.appendChild(IValID.V_CAPITALIZE);
- prop.appendChild(IValID.V_UPPERCASE);
- prop.appendChild(IValID.V_LOWERCASE);
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // top
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TOP);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // unicode-bidi
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_UNICODE_BIDI);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_EMBED);
- prop.appendChild(IValID.V_BIDI_OVERRIDE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // vertical-align
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VERTICAL_ALIGN);
- prop.appendChild(IValID.V_BOTTOM);
- prop.appendChild(IValID.V_TEXT_BOTTOM);
- prop.appendChild(IValID.V_SUB);
- prop.appendChild(IValID.V_BASELINE);
- prop.appendChild(IValID.V_MIDDLE);
- prop.appendChild(IValID.V_SUPER);
- prop.appendChild(IValID.V_TEXT_TOP);
- prop.appendChild(IValID.V_TOP);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // visibility
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VISIBILITY);
- prop.appendChild(IValID.V_VISIBLE);
- prop.appendChild(IValID.V_HIDDEN);
- prop.appendChild(IValID.V_COLLAPSE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // voice-family
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VOICE_FAMILY);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_VOICE));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_VOICE));
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // volume
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VOLUME);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_SILENT);
- prop.appendChild(IValID.V_X_SOFT);
- prop.appendChild(IValID.V_SOFT);
- prop.appendChild(IValID.V_MEDIUM);
- prop.appendChild(IValID.V_LOUD);
- prop.appendChild(IValID.V_X_LOUD);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // white-space
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WHITE_SPACE);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_PRE);
- prop.appendChild(IValID.V_NOWRAP);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // widows
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WIDOWS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WIDTH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // word-spacing
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WORD_SPACING);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // z-index
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_Z_INDEX);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- /** ******** font properties ********* */
- // font-family
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_FAMILY);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_FONT));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_FAMILY));
- prop.setMaxValueCount(-1);
-
- // font-style
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_STYLE);
- prop.appendChild(IValID.V_ITALIC);
- prop.appendChild(IValID.V_OBLIQUE);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_ALL);
- prop.setMaxValueCount(-1);
-
- // font-variant
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_VARIANT);
- prop.appendChild(IValID.V_SMALL_CAPS);
- prop.appendChild(IValID.V_NORMAL);
- prop.setMaxValueCount(-1);
-
- // font-weight
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_WEIGHT);
- prop.appendChild(IValID.V_BOLD);
- prop.appendChild(IValID.V_100);
- prop.appendChild(IValID.V_200);
- prop.appendChild(IValID.V_300);
- prop.appendChild(IValID.V_400);
- prop.appendChild(IValID.V_500);
- prop.appendChild(IValID.V_600);
- prop.appendChild(IValID.V_700);
- prop.appendChild(IValID.V_800);
- prop.appendChild(IValID.V_900);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_ALL);
- prop.setMaxValueCount(-1);
-
- // font-stretch
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_STRETCH);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_ULTRA_CONDENSED);
- prop.appendChild(IValID.V_EXTRA_CONDENSED);
- prop.appendChild(IValID.V_CONDENSED);
- prop.appendChild(IValID.V_SEMI_CONDENSED);
- prop.appendChild(IValID.V_SEMI_EXPANDED);
- prop.appendChild(IValID.V_EXPANDED);
- prop.appendChild(IValID.V_EXTRA_EXPANDED);
- prop.appendChild(IValID.V_ULTRA_EXPANDED);
- prop.appendChild(IValID.V_ALL);
- prop.setMaxValueCount(-1);
-
- // font-size
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_SIZE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_ABSOLUTE_SIZE));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_RELATIVE_SIZE));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_ALL);
- prop.setMaxValueCount(-1);
-
- // unicode-range
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_UNICODE_RANGE);
- prop.appendChild(PropCMURange.getInstanceOf(PropCMURange.VAL_URANGE));
- prop.setMaxValueCount(-1);
-
- // units-per-em
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_UNITS_PER_EM);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // src
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_SRC);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_FORMAT));
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_LOCAL));
- prop.setMaxValueCount(-1);
-
- // panose-1
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_PANOSE_1);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.setMaxValueCount(10);
-
- // stemv
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_STEMV);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // stemh
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_STEMH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // slope
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_SLOPE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // cap-height
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_CAP_HEIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // x-height
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_X_HEIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // ascent
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_ASCENT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // descent
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_DESCENT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // widths
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_WIDTHS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendChild(PropCMURange.getInstanceOf(PropCMURange.VAL_URANGE));
- prop.setMaxValueCount(-1);
-
- // bbox
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_BBOX);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.setMaxValueCount(4);
- prop.setMaxValueCount(4);
-
- // definition-src
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_DEFINITION_SRC);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-
- // baseline
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_BASELINE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // centerline
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_CENTERLINE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // mathline
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_MATHLINE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // topline
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_TOPLINE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- /** ******** containers ********* */
-
- // absolute-size
- PropCMContainer cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_ABSOLUTE_SIZE);
- cont.appendChild(IValID.V_XX_SMALL);
- cont.appendChild(IValID.V_X_SMALL);
- cont.appendChild(IValID.V_SMALL);
- cont.appendChild(IValID.V_MEDIUM);
- cont.appendChild(IValID.V_LARGE);
- cont.appendChild(IValID.V_X_LARGE);
- cont.appendChild(IValID.V_XX_LARGE);
-
- // border-style
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE);
- cont.appendChild(IValID.V_SOLID);
- cont.appendChild(IValID.V_DASHED);
- cont.appendChild(IValID.V_DOTTED);
- cont.appendChild(IValID.V_DOUBLE);
- cont.appendChild(IValID.V_GROOVE);
- cont.appendChild(IValID.V_RIDGE);
- cont.appendChild(IValID.V_INSET);
- cont.appendChild(IValID.V_OUTSET);
- cont.appendChild(IValID.V_HIDDEN);
- cont.appendChild(IValID.V_NONE);
-
- // border-width
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH);
- cont.appendChild(IValID.V_THIN);
- cont.appendChild(IValID.V_MEDIUM);
- cont.appendChild(IValID.V_THICK);
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-
- // color
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR);
- cont.appendChild(IValID.V_AQUA);
- cont.appendChild(IValID.V_BLACK);
- cont.appendChild(IValID.V_BLUE);
- cont.appendChild(IValID.V_FUCHSIA);
- cont.appendChild(IValID.V_GRAY);
- cont.appendChild(IValID.V_GREEN);
- cont.appendChild(IValID.V_LIME);
- cont.appendChild(IValID.V_MAROON);
- cont.appendChild(IValID.V_NAVY);
- cont.appendChild(IValID.V_OLIVE);
- cont.appendChild(IValID.V_PURPLE);
- cont.appendChild(IValID.V_RED);
- cont.appendChild(IValID.V_SILVER);
- cont.appendChild(IValID.V_TEAL);
- cont.appendChild(IValID.V_WHITE);
- cont.appendChild(IValID.V_YELLOW);
- cont.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_SYSTEM_COLOR));
- cont.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_RGB));
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_HASH));
-
- // system color
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_SYSTEM_COLOR);
- cont.appendChild(IValID.V_ACTIVEBORDER);
- cont.appendChild(IValID.V_ACTIVECAPTION);
- cont.appendChild(IValID.V_APPWORKSPACE);
- cont.appendChild(IValID.V_BACKGROUND);
- cont.appendChild(IValID.V_BUTTONFACE);
- cont.appendChild(IValID.V_BUTTONHIGHLIGHT);
- cont.appendChild(IValID.V_BUTTONSHADOW);
- cont.appendChild(IValID.V_BUTTONTEXT);
- cont.appendChild(IValID.V_CAPTIONTEXT);
- cont.appendChild(IValID.V_GRAYTEXT);
- cont.appendChild(IValID.V_HIGHLIGHT);
- cont.appendChild(IValID.V_HIGHLIGHTTEXT);
- cont.appendChild(IValID.V_INACTIVEBORDER);
- cont.appendChild(IValID.V_INACTIVECAPTION);
- cont.appendChild(IValID.V_INACTIVECAPTIONTEXT);
- cont.appendChild(IValID.V_INFOBACKGROUND);
- cont.appendChild(IValID.V_INFOTEXT);
- cont.appendChild(IValID.V_MENU);
- cont.appendChild(IValID.V_MENUTEXT);
- cont.appendChild(IValID.V_SCROLLBAR);
- cont.appendChild(IValID.V_THREEDDARKSHADOW);
- cont.appendChild(IValID.V_THREEDFACE);
- cont.appendChild(IValID.V_THREEDHIGHLIGHT);
- cont.appendChild(IValID.V_THREEDLIGHTSHADOW);
- cont.appendChild(IValID.V_THREEDSHADOW);
- cont.appendChild(IValID.V_WINDOW);
- cont.appendChild(IValID.V_WINDOWFRAME);
- cont.appendChild(IValID.V_WINDOWTEXT);
-
- // generic-family
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_FAMILY);
- cont.appendChild(IValID.V_SERIF);
- cont.appendChild(IValID.V_SANS_SERIF);
- cont.appendChild(IValID.V_CURSIVE);
- cont.appendChild(IValID.V_FANTASY);
- cont.appendChild(IValID.V_MONOSPACE);
-
- // generic-voice
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_VOICE);
- cont.appendChild(IValID.V_MALE);
- cont.appendChild(IValID.V_FEMALE);
- cont.appendChild(IValID.V_CHILD);
-
- // margin-width
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH);
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- cont.appendChild(IValID.V_AUTO);
-
- // padding-width
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH);
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-
- // relative-size
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_RELATIVE_SIZE);
- cont.appendChild(IValID.V_SMALLER);
- cont.appendChild(IValID.V_LARGER);
-
- LOADING = 2;
- }
-
- /**
- *
- */
- protected static boolean isLoading() {
- return LOADING == 1;
- }
-
- /**
- *
- */
- protected static boolean isNeedInitialize() {
- return LOADING == 0;
- }
-
- /**
- *
- */
- public String toString() {
- return getName();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java
deleted file mode 100644
index 2d13122c4f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.document.ICSSPrimitiveValue;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- *
- */
-public class PropCMNumber extends PropCMNode {
-
- private static java.util.Hashtable instances = null;
- public final static java.lang.String VAL_ANGLE = "angle";//$NON-NLS-1$
- public final static java.lang.String VAL_FREQUENCY = "frequency";//$NON-NLS-1$
- public final static java.lang.String VAL_INTEGER = "integer";//$NON-NLS-1$
- public final static java.lang.String VAL_LENGTH = "length";//$NON-NLS-1$
- public final static java.lang.String VAL_PERCENTAGE = "percentage";//$NON-NLS-1$
- public final static java.lang.String VAL_TIME = "time";//$NON-NLS-1$
- public final static java.lang.String VAL_HASH = "hash"; // for
- // hex-color//$NON-NLS-1$
- public final static java.lang.String VAL_NUM = "number";//$NON-NLS-1$
- public final static String DIM_CM = "cm";//$NON-NLS-1$
- public final static String DIM_DEG = "deg";//$NON-NLS-1$
- public final static String DIM_EMS = "em";//$NON-NLS-1$
- public final static String DIM_EXS = "ex";//$NON-NLS-1$
- public final static String DIM_GRAD = "grad";//$NON-NLS-1$
- public final static String DIM_HASH = "#";//$NON-NLS-1$
- public final static String DIM_HZ = "Hz";//$NON-NLS-1$
- public final static String DIM_IN = "in";//$NON-NLS-1$
- public final static String DIM_INTEGER = "INTEGER";//$NON-NLS-1$
- public final static String DIM_KHZ = "kHz";//$NON-NLS-1$
- public final static String DIM_MM = "mm";//$NON-NLS-1$
- public final static String DIM_MS = "ms";//$NON-NLS-1$
- public final static String DIM_NUMBER = "NUMBER";//$NON-NLS-1$
- public final static String DIM_PC = "pc";//$NON-NLS-1$
- public final static String DIM_PERCENTAGE = "%";//$NON-NLS-1$
- public final static String DIM_PT = "pt";//$NON-NLS-1$
- public final static String DIM_PX = "px";//$NON-NLS-1$
- public final static String DIM_RAD = "rad";//$NON-NLS-1$
- public final static String DIM_S = "s";//$NON-NLS-1$
- private java.util.Vector fDims = new Vector();
-
- /**
- *
- */
- protected PropCMNumber(String name) {
- super(name);
- }
-
- /**
- *
- */
- public static String getDimension(short primitiveType) {
- switch (primitiveType) {
- case CSSPrimitiveValue.CSS_CM :
- return DIM_CM;
- case CSSPrimitiveValue.CSS_DEG :
- return DIM_DEG;
- case CSSPrimitiveValue.CSS_EMS :
- return DIM_EMS;
- case CSSPrimitiveValue.CSS_EXS :
- return DIM_EXS;
- case CSSPrimitiveValue.CSS_GRAD :
- return DIM_GRAD;
- case ICSSPrimitiveValue.CSS_HASH :
- return DIM_HASH; // prefix dimension ....
- case CSSPrimitiveValue.CSS_HZ :
- return DIM_HZ;
- case CSSPrimitiveValue.CSS_IN :
- return DIM_IN;
- case ICSSPrimitiveValue.CSS_INTEGER :
- return "";//$NON-NLS-1$
- case CSSPrimitiveValue.CSS_KHZ :
- return DIM_KHZ;
- case CSSPrimitiveValue.CSS_MM :
- return DIM_MM;
- case CSSPrimitiveValue.CSS_MS :
- return DIM_MS;
- case CSSPrimitiveValue.CSS_NUMBER :
- return "";//$NON-NLS-1$
- case CSSPrimitiveValue.CSS_PC :
- return DIM_PC;
- case CSSPrimitiveValue.CSS_PERCENTAGE :
- return DIM_PERCENTAGE;
- case CSSPrimitiveValue.CSS_PT :
- return DIM_PT;
- case CSSPrimitiveValue.CSS_PX :
- return DIM_PX;
- case CSSPrimitiveValue.CSS_RAD :
- return DIM_RAD;
- case CSSPrimitiveValue.CSS_S :
- return DIM_S;
- }
-
- return null;
- }
-
- /**
- *
- */
- public Set getDimensions() {
- HashSet vals = new HashSet();
- Iterator it = fDims.iterator();
- while (it.hasNext()) {
- vals.add(it.next());
- }
-
- return vals;
- }
-
- /**
- *
- */
- void getIdentifiers(Set indents) {
- }
-
- /**
- *
- */
- static public PropCMNumber getInstanceOf(String name) {
- if (name == null)
- return null;
-
- // initialize
- if (instances == null)
- instances = new Hashtable(20);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMNumber) node;
-
- // register
- if (PropCMNode.isLoading()) {
- node = new PropCMNumber(name);
- instances.put(name, node);
- }
-
- return (PropCMNumber) node;
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_NUMBER;
- }
-
- /**
- *
- */
- void getValues(Collection values) {
- if (values != null && !values.contains(this))
- values.add(this);
- }
-
- /**
- *
- */
- static void initNumberCMDim() {
- PropCMNumber num = getInstanceOf(VAL_ANGLE);
- num.fDims.add(DIM_DEG);
- num.fDims.add(DIM_GRAD);
- num.fDims.add(DIM_RAD);
-
- num = getInstanceOf(VAL_FREQUENCY);
- num.fDims.add(DIM_HZ);
- num.fDims.add(DIM_KHZ);
-
- num = getInstanceOf(VAL_HASH);
- num.fDims.add(DIM_HASH);
-
- // num = getInstanceOf(VAL_INTEGER);
- // num.fDims.add(DIM_INTEGER);
-
- num = getInstanceOf(VAL_LENGTH);
- num.fDims.add(DIM_CM);
- num.fDims.add(DIM_EMS);
- num.fDims.add(DIM_EXS);
- num.fDims.add(DIM_IN);
- num.fDims.add(DIM_MM);
- num.fDims.add(DIM_PC);
- num.fDims.add(DIM_PT);
- num.fDims.add(DIM_PX);
-
- // num = getInstanceOf(VAL_NUMBER);
- // num.fDims.add(DIM_NUMBER);
-
- num = getInstanceOf(VAL_PERCENTAGE);
- num.fDims.add(DIM_PERCENTAGE);
-
- num = getInstanceOf(VAL_TIME);
- num.fDims.add(DIM_MS);
- num.fDims.add(DIM_S);
-
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java
deleted file mode 100644
index bbab38f642..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-/**
- *
- */
-public class PropCMProperty extends PropCMContainer {
-
- // static fields
- private static java.util.Hashtable instances = null;
- private static java.util.Hashtable cachedIdMap = null;
- public final static String P_AZIMUTH = "azimuth";//$NON-NLS-1$
- public final static String P_BG = "background";//$NON-NLS-1$
- public final static String P_BG_ATTACHMENT = "background-attachment";//$NON-NLS-1$
- public final static String P_BG_COLOR = "background-color";//$NON-NLS-1$
- public final static String P_BG_IMAGE = "background-image";//$NON-NLS-1$
- public final static String P_BG_POSITION = "background-position";//$NON-NLS-1$
- public final static String P_BG_REPEAT = "background-repeat";//$NON-NLS-1$
- public final static String P_BORDER = "border";//$NON-NLS-1$
- public final static String P_BORDER_COLLAPSE = "border-collapse";//$NON-NLS-1$
- public final static String P_BORDER_COLOR = "border-color";//$NON-NLS-1$
- public final static String P_BORDER_SPACING = "border-spacing";//$NON-NLS-1$
- public final static String P_BORDER_STYLE = "border-style";//$NON-NLS-1$
- public final static String P_BORDER_TOP = "border-top";//$NON-NLS-1$
- public final static String P_BORDER_RIGHT = "border-right";//$NON-NLS-1$
- public final static String P_BORDER_BOTTOM = "border-bottom";//$NON-NLS-1$
- public final static String P_BORDER_LEFT = "border-left";//$NON-NLS-1$
- public final static String P_BORDER_TOP_COLOR = "border-top-color";//$NON-NLS-1$
- public final static String P_BORDER_RIGHT_COLOR = "border-right-color";//$NON-NLS-1$
- public final static String P_BORDER_BOTTOM_COLOR = "border-bottom-color";//$NON-NLS-1$
- public final static String P_BORDER_LEFT_COLOR = "border-left-color";//$NON-NLS-1$
- public final static String P_BORDER_TOP_STYLE = "border-top-style";//$NON-NLS-1$
- public final static String P_BORDER_RIGHT_STYLE = "border-right-style";//$NON-NLS-1$
- public final static String P_BORDER_BOTTOM_STYLE = "border-bottom-style";//$NON-NLS-1$
- public final static String P_BORDER_LEFT_STYLE = "border-left-style";//$NON-NLS-1$
- public final static String P_BORDER_TOP_WIDTH = "border-top-width";//$NON-NLS-1$
- public final static String P_BORDER_RIGHT_WIDTH = "border-right-width";//$NON-NLS-1$
- public final static String P_BORDER_BOTTOM_WIDTH = "border-bottom-width";//$NON-NLS-1$
- public final static String P_BORDER_LEFT_WIDTH = "border-left-width";//$NON-NLS-1$
- public final static String P_BORDER_WIDTH = "border-width";//$NON-NLS-1$
- public final static String P_BOTTOM = "bottom";//$NON-NLS-1$
- public final static String P_CAPTION_SIDE = "caption-side";//$NON-NLS-1$
- public final static String P_CLEAR = "clear";//$NON-NLS-1$
- public final static String P_CLIP = "clip";//$NON-NLS-1$
- public final static String P_COLOR = "color";//$NON-NLS-1$
- public final static String P_CONTENT = "content";//$NON-NLS-1$
- public final static String P_COUNTER_INCREMENT = "counter-increment";//$NON-NLS-1$
- public final static String P_COUNTER_RESET = "counter-reset";//$NON-NLS-1$
- public final static String P_CUE = "cue";//$NON-NLS-1$
- public final static String P_CUE_AFTER = "cue-after";//$NON-NLS-1$
- public final static String P_CUE_BEFORE = "cue-before";//$NON-NLS-1$
- public final static String P_CURSOR = "cursor";//$NON-NLS-1$
- public final static String P_DIRECTION = "direction";//$NON-NLS-1$
- public final static String P_DISPLAY = "display";//$NON-NLS-1$
- public final static String P_ELEVATION = "elevation";//$NON-NLS-1$
- public final static String P_EMPTY_CELLS = "empty-cells";//$NON-NLS-1$
- public final static String P_FLOAT = "float";//$NON-NLS-1$
- public final static String P_FONT = "font";//$NON-NLS-1$
- public final static String P_FONT_FAMILY = "font-family";//$NON-NLS-1$
- public final static String P_FONT_SIZE = "font-size";//$NON-NLS-1$
- public final static String P_FONT_SIZE_ADJUST = "font-size-adjust";//$NON-NLS-1$
- public final static String P_FONT_STRETCH = "font-stretch";//$NON-NLS-1$
- public final static String P_FONT_STYLE = "font-style";//$NON-NLS-1$
- public final static String P_FONT_VARIANT = "font-variant";//$NON-NLS-1$
- public final static String P_FONT_WEIGHT = "font-weight";//$NON-NLS-1$
- public final static String P_HEIGHT = "height";//$NON-NLS-1$
- public final static String P_LEFT = "left";//$NON-NLS-1$
- public final static String P_LETTER_SPACING = "letter-spacing";//$NON-NLS-1$
- public final static String P_LINE_HEIGHT = "line-height";//$NON-NLS-1$
- public final static String P_LIST_STYLE = "list-style";//$NON-NLS-1$
- public final static String P_LIST_STYLE_IMAGE = "list-style-image";//$NON-NLS-1$
- public final static String P_LIST_STYLE_POSITION = "list-style-position";//$NON-NLS-1$
- public final static String P_LIST_STYLE_TYPE = "list-style-type";//$NON-NLS-1$
- public final static String P_MARGIN = "margin";//$NON-NLS-1$
- public final static String P_MARGIN_TOP = "margin-top";//$NON-NLS-1$
- public final static String P_MARGIN_RIGHT = "margin-right";//$NON-NLS-1$
- public final static String P_MARGIN_BOTTOM = "margin-bottom";//$NON-NLS-1$
- public final static String P_MARGIN_LEFT = "margin-left";//$NON-NLS-1$
- public final static String P_MARKER_OFFSET = "marker-offset";//$NON-NLS-1$
- public final static String P_MARKS = "marks";//$NON-NLS-1$
- public final static String P_MAX_HEIGHT = "max-height";//$NON-NLS-1$
- public final static String P_MAX_WIDTH = "max-width";//$NON-NLS-1$
- public final static String P_MIN_HEIGHT = "min-height";//$NON-NLS-1$
- public final static String P_MIN_WIDTH = "min-width";//$NON-NLS-1$
- public final static String P_ORPHANS = "orphans";//$NON-NLS-1$
- public final static String P_OUTLINE = "outline";//$NON-NLS-1$
- public final static String P_OUTLINE_COLOR = "outline-color";//$NON-NLS-1$
- public final static String P_OUTLINE_STYLE = "outline-style";//$NON-NLS-1$
- public final static String P_OUTLINE_WIDTH = "outline-width";//$NON-NLS-1$
- public final static String P_OVERFLOW = "overflow";//$NON-NLS-1$
- public final static String P_PADDING = "padding";//$NON-NLS-1$
- public final static String P_PADDING_TOP = "padding-top";//$NON-NLS-1$
- public final static String P_PADDING_RIGHT = "padding-right";//$NON-NLS-1$
- public final static String P_PADDING_BOTTOM = "padding-bottom";//$NON-NLS-1$
- public final static String P_PADDING_LEFT = "padding-left";//$NON-NLS-1$
- public final static String P_PAGE = "page";//$NON-NLS-1$
- public final static String P_PAGE_BREAK_AFTER = "page-break-after";//$NON-NLS-1$
- public final static String P_PAGE_BREAK_BEFORE = "page-break-before";//$NON-NLS-1$
- public final static String P_PAGE_BREAK_INSIDE = "page-break-inside";//$NON-NLS-1$
- public final static String P_PAUSE = "pause";//$NON-NLS-1$
- public final static String P_PAUSE_AFTER = "pause-after";//$NON-NLS-1$
- public final static String P_PAUSE_BEFORE = "pause-before";//$NON-NLS-1$
- public final static String P_PITCH = "pitch";//$NON-NLS-1$
- public final static String P_PITCH_RANGE = "pitch-range";//$NON-NLS-1$
- public final static String P_PLAY_DURING = "play-during";//$NON-NLS-1$
- public final static String P_POSITION = "position";//$NON-NLS-1$
- public final static String P_QUOTES = "quotes";//$NON-NLS-1$
- public final static String P_RICHNESS = "richness";//$NON-NLS-1$
- public final static String P_RIGHT = "right";//$NON-NLS-1$
- public final static String P_SIZE = "size";//$NON-NLS-1$
- public final static String P_SPEAK = "speak";//$NON-NLS-1$
- public final static String P_SPEAK_HEADER = "speak-header";//$NON-NLS-1$
- public final static String P_SPEAK_NUMERAL = "speak-numeral";//$NON-NLS-1$
- public final static String P_SPEAK_PUNCTUATION = "speak-punctuation";//$NON-NLS-1$
- public final static String P_SPEECH_RATE = "speech-rate";//$NON-NLS-1$
- public final static String P_STRESS = "stress";//$NON-NLS-1$
- public final static String P_TABLE_LAYOUT = "table-layout";//$NON-NLS-1$
- public final static String P_TEXT_ALIGN = "text-align";//$NON-NLS-1$
- public final static String P_TEXT_DECORATION = "text-decoration";//$NON-NLS-1$
- public final static String P_TEXT_INDENT = "text-indent";//$NON-NLS-1$
- public final static String P_TEXT_SHADOW = "text-shadow";//$NON-NLS-1$
- public final static String P_TEXT_TRANSFORM = "text-transform";//$NON-NLS-1$
- public final static String P_TOP = "top";//$NON-NLS-1$
- public final static String P_UNICODE_BIDI = "unicode-bidi";//$NON-NLS-1$
- public final static String P_VERTICAL_ALIGN = "vertical-align";//$NON-NLS-1$
- public final static String P_VISIBILITY = "visibility";//$NON-NLS-1$
- public final static String P_VOICE_FAMILY = "voice-family";//$NON-NLS-1$
- public final static String P_VOLUME = "volume";//$NON-NLS-1$
- public final static String P_WHITE_SPACE = "white-space";//$NON-NLS-1$
- public final static String P_WIDOWS = "widows";//$NON-NLS-1$
- public final static String P_WIDTH = "width";//$NON-NLS-1$
- public final static String P_WORD_SPACING = "word-spacing";//$NON-NLS-1$
- public final static String P_Z_INDEX = "z-index";//$NON-NLS-1$
- // instance fields
- private int fMinValueCount = 1;
- private int fMaxValueCount = 1;
- private Object[] mediaGroups;
- protected List containers;
-
- /**
- *
- */
- protected PropCMProperty(String name) {
- super(name);
- }
-
- /**
- *
- */
- Object appendChild(Object node) {
- Object ret = super.appendChild(node);
- if (node instanceof PropCMProperty) {
- // register shorthand container
- PropCMProperty cm = (PropCMProperty) node;
- if (cm.containers == null)
- cm.containers = new Vector();
- if (!cm.containers.contains(this))
- cm.containers.add(this);
- }
- return ret;
- }
-
- /**
- *
- */
- void appendMediaGroup(Object mg) {
- if (mediaGroups == null)
- mediaGroups = new Object[1];
- else {
- Object[] oldMediaGroups = mediaGroups;
- mediaGroups = new Object[oldMediaGroups.length + 1];
- System.arraycopy(oldMediaGroups, 0, mediaGroups, 0, oldMediaGroups.length);
- }
- mediaGroups[mediaGroups.length - 1] = mg;
- }
-
- /**
- *
- */
- public static PropCMProperty getInstanceOf(String name) {
- // initialize
- if (instances == null)
- instances = new Hashtable(200);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMProperty) node;
-
- // register
- if (PropCMNode.isLoading()) {
- node = new PropCMProperty(name);
- instances.put(name, node);
- }
-
- return (PropCMProperty) node;
- }
-
- /**
- *
- */
- public int getMaxValueCount() {
- return fMaxValueCount;
- }
-
- /**
- *
- */
- public List getMediaGroups() {
- if (mediaGroups != null)
- return Arrays.asList(mediaGroups);
- else
- return new ArrayList();
- }
-
- /**
- *
- */
- public int getMinValueCount() {
- return fMinValueCount;
- }
-
- /**
- *
- */
- public static Enumeration getNameEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.keys();
- }
-
- /**
- *
- */
- public static Enumeration getPropertyEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.elements();
- }
-
- /**
- *
- */
- public int getShorthandContainerCount() {
- return (containers == null) ? 0 : containers.size();
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_PROPERTY;
- }
-
- /**
- *
- */
- public boolean isShorthand() {
- int nChild = getNumChild();
- for (int i = 0; i < nChild; i++) {
- Object obj = getChildAt(i);
- if (obj instanceof PropCMProperty && !(obj instanceof PropCMSubProperty))
- return true;
- }
- return false;
- }
-
- /**
- *
- */
- public static Vector names() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return new Vector(instances.keySet());
- }
-
- /**
- *
- */
- public static List names(Object mediaGroup) {
- if (mediaGroup == null)
- return names();
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- Vector properties = new Vector();
-
- Iterator it = instances.values().iterator();
- while (it.hasNext()) {
- PropCMProperty prop = (PropCMProperty) it.next();
- if (prop.getMediaGroups().contains(mediaGroup))
- properties.add(prop.getName());
- }
-
- return properties;
- }
-
- /**
- * If identifier is null, get all properties
- */
- public static Vector propertiesFor(String identifier, boolean shorthands) {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // if identifier is null, get all properties
- if (identifier == null)
- return new Vector(instances.values());
-
- if (cachedIdMap == null) {
- // start cacheing
- cachedIdMap = new Hashtable();
- }
- else {
- // search cached
- Object ret = cachedIdMap.get(identifier + String.valueOf(shorthands));
- if (ret != null)
- return new Vector((Collection) ret);
- }
-
- // create
- Enumeration propertyEnum = getPropertyEnum();
- HashSet set = new HashSet();
- while (propertyEnum.hasMoreElements()) {
- PropCMProperty prop = (PropCMProperty) propertyEnum.nextElement();
- if (!shorthands && prop.isShorthand())
- continue;
- if (prop.canHave(identifier))
- set.add(prop);
- }
-
- // cache
- cachedIdMap.put(identifier + String.valueOf(shorthands), set);
-
- return new Vector(set);
- }
-
- /**
- *
- */
- protected void setMaxValueCount(int newMaxValueCount) {
- fMaxValueCount = newMaxValueCount;
- }
-
- /**
- *
- */
- protected void setMinValueCount(int newMinValueCount) {
- fMinValueCount = newMinValueCount;
- }
-
- /**
- *
- */
- public PropCMProperty shorthandContainerAt(int i) {
- if (containers == null)
- return null;
- if (i < 0 || containers.size() <= i)
- return null;
- return (PropCMProperty) containers.get(i);
- }
-
- /**
- *
- */
- public Iterator shorthandContainerIterator() {
- if (containers == null) {
- return new Iterator() {
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- return null;
- }
-
- public void remove() {
- }
- };
- }
- else
- return containers.iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java
deleted file mode 100644
index a60b57844e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-
-/**
- *
- */
-public class PropCMString extends PropCMNode {
-
- private static java.util.Hashtable instances = null;
- public final static java.lang.String VAL_FONT = "font";//$NON-NLS-1$
- public final static java.lang.String VAL_COUNTER_ID = "counterId";//$NON-NLS-1$
- public final static java.lang.String VAL_PAGE_ID = "pageId";//$NON-NLS-1$
- public final static java.lang.String VAL_VOICE = "voice";//$NON-NLS-1$
- public final static java.lang.String VAL_ANY = "any"; // reserved
- // name//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMString(String name) {
- super(name);
- }
-
- /**
- *
- */
- void getIdentifiers(Set indents) {
- }
-
- /**
- *
- */
- static public PropCMString getInstanceOf(String name) {
- if (name == null)
- return null;
-
- // initialize
- if (instances == null)
- instances = new Hashtable(10);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMString) node;
-
- // register
- node = new PropCMString(name);
- instances.put(name, node);
-
- return (PropCMString) node;
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_STRING;
- }
-
- /**
- *
- */
- void getValues(Collection values) {
- if (values != null && !values.contains(this))
- values.add(this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java
deleted file mode 100644
index 81ebb3733d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-/**
- *
- */
-public class PropCMSubProperty extends PropCMProperty {
-
- // static fields
- private static java.util.Hashtable instances = null;
- public final static String PSUB_BG_POSITION_X = "background-positionH";//$NON-NLS-1$
- public final static String PSUB_BG_POSITION_Y = "background-positionV";//$NON-NLS-1$
- public final static String PSUB_CLIP_TOP = "clipTop";//$NON-NLS-1$
- public final static String PSUB_CLIP_RIGHT = "clipRight";//$NON-NLS-1$
- public final static String PSUB_CLIP_BOTTOM = "clipBottom";//$NON-NLS-1$
- public final static String PSUB_CLIP_LEFT = "clipLeft";//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMSubProperty(String name) {
- super(name);
- }
-
- /**
- *
- */
- public PropCMProperty getContainer() {
- return shorthandContainerAt(0);
- }
-
- /**
- *
- */
- public static PropCMProperty getInstanceOf(String name) {
- // initialize
- if (instances == null)
- instances = new Hashtable(10);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMProperty) node;
-
- // register
- if (PropCMNode.isLoading()) {
- node = new PropCMSubProperty(name);
- instances.put(name, node);
- }
-
- return (PropCMProperty) node;
- }
-
- /**
- *
- */
- public static Enumeration getNameEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.keys();
- }
-
- /**
- *
- */
- public static Enumeration getPropertyEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.elements();
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_SUBPROPERTY;
- }
-
- /**
- *
- */
- public static Vector names() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return new Vector(instances.keySet());
- }
-
- /**
- *
- */
- public void setContainer(PropCMProperty prop) {
- if (containers == null)
- containers = new Vector();
- containers.clear();
- containers.add(prop);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java
deleted file mode 100644
index 3375715d5e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-
-/**
- *
- */
-public class PropCMURange extends PropCMNode {
-
- private static java.util.Hashtable instances = null;
- public final static String VAL_URANGE = "urange";//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMURange(String name) {
- super(name);
- }
-
- /**
- *
- */
- void getIdentifiers(Set indents) {
- }
-
- /**
- *
- */
- public static PropCMURange getInstanceOf(String name) {
- if (name == null)
- return null;
-
- // initialize
- if (instances == null)
- instances = new Hashtable(10);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMURange) node;
-
- // register
- node = new PropCMURange(name);
- instances.put(name, node);
-
- return (PropCMURange) node;
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_UNICODE_RANGE;
- }
-
- /**
- *
- */
- void getValues(Collection values) {
- if (values != null && !values.contains(this))
- values.add(this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java
deleted file mode 100644
index 816ba377c6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- *
- */
-public class PropCMUtil {
-
- /**
- *
- */
- public static void minus(Collection src, Collection ref) {
- Iterator it = ref.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (src.contains(obj))
- src.remove(obj);
- }
- return;
- }
-
- /**
- *
- */
- public static void plus(Collection src, Collection ref) {
- Iterator it = ref.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (!src.contains(obj))
- src.add(obj);
- }
- return;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java
deleted file mode 100644
index eb10e00def..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-
-
-/**
- *
- */
-abstract class AbstractCSSNodeList {
-
- protected Vector nodes = null;
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param ndoe
- * com.ibm.sed.css.interfaces.CSSNode
- */
- ICSSNode appendNode(ICSSNode node) {
- if (node == null)
- return null;
- if (this.nodes == null)
- this.nodes = new Vector();
- this.nodes.addElement(node);
- return node;
- }
-
- /**
- * @return int
- */
- public int getLength() {
- if (this.nodes == null)
- return 0;
- return this.nodes.size();
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param index
- * int
- */
- protected ICSSNode itemImpl(int index) {
- if (this.nodes == null)
- return null;
- if (index < 0 || index >= this.nodes.size())
- return null;
- return (ICSSNode) this.nodes.elementAt(index);
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param index
- * com.ibm.sed.css.interfaces.CSSNode
- */
- ICSSNode removeNode(int index) {
- if (this.nodes == null)
- return null; // no node
- if (index < 0 || index >= this.nodes.size())
- return null; // invalid parameter
-
- ICSSNode removed = (ICSSNode) this.nodes.elementAt(index);
- this.nodes.removeElementAt(index);
- return removed;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java
deleted file mode 100644
index 92d03de02e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import org.eclipse.wst.css.core.document.ICSSAttr;
-import org.eclipse.wst.css.core.document.ICSSDocument;
-import org.eclipse.wst.css.core.document.ICSSNamedNodeMap;
-import org.eclipse.wst.css.core.document.ICSSNode;
-
-/**
- *
- */
-class CSSAttrImpl extends CSSRegionContainer implements ICSSAttr {
-
- private String fName = null;
- private String fValue = null;
- private CSSNodeImpl ownerCSSNode = null;
-
- /**
- * CSSAttrImpl constructor comment.
- *
- * @param that
- * com.ibm.sed.css.treemodel.CSSRegionContainer
- */
- CSSAttrImpl(CSSAttrImpl that) {
- super(that);
- this.fName = that.fName;
- this.setValue(that.fValue);
- }
-
- /**
- * CSSAttr constructor comment.
- */
- CSSAttrImpl(String name) {
- super();
- this.fName = name;
- }
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- return new CSSAttrImpl(this);
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNamedNodeMap
- */
- public ICSSNamedNodeMap getAttributes() {
- return null;
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getName() {
- return fName;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return ATTR_NODE;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNodeImpl
- */
- public ICSSNode getOwnerCSSNode() {
- return ownerCSSNode;
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getValue() {
- return fValue;
- }
-
- /**
- * @return boolean
- * @param name
- * java.lang.String
- */
- protected boolean matchName(String name) {
- if (name == null)
- return /* (this.name == null) */false;
- if (this.fName == null)
- return false;
- return this.fName.equals(name);
- }
-
- /**
- *
- */
- protected void notifyValueChanged(String oldValue) {
- if (this.ownerCSSNode == null)
- return;
-
- // for model
- ICSSDocument doc = ownerCSSNode.getContainerDocument();
- if (doc == null)
- return;
- CSSModelImpl model = (CSSModelImpl) doc.getModel();
- if (model == null)
- return;
- model.valueChanged(this, oldValue);
-
- // for adapters
- String value = getValue();
- this.ownerCSSNode.notify(CHANGE, this, oldValue, value, this.ownerCSSNode.getStartOffset());
- }
-
- /**
- * @param newName
- * java.lang.String
- */
- protected void setName(java.lang.String newName) {
- fName = newName;
- }
-
- /**
- * @param newOwnerCSSNode
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- */
- protected void setOwnerCSSNode(CSSNodeImpl newOwnerCSSNode) {
- ownerCSSNode = newOwnerCSSNode;
- }
-
- /**
- * @param newValue
- * java.lang.String
- */
- public void setValue(java.lang.String newValue) {
- String oldValue = fValue;
- fValue = newValue;
-
- notifyValueChanged(oldValue);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java
deleted file mode 100644
index 6fa883655b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.preferences.CSSPreferenceHelper;
-import org.eclipse.wst.css.core.util.CSSUtil;
-
-
-/**
- *
- */
-class CSSCharsetRuleImpl extends CSSRuleImpl implements ICSSCharsetRule {
-
- /**
- *
- */
- CSSCharsetRuleImpl() {
- super();
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSCharsetRuleImpl
- */
- CSSCharsetRuleImpl(CSSCharsetRuleImpl that) {
- super(that);
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSCharsetRuleImpl cloned = new CSSCharsetRuleImpl(this);
-
- return cloned;
- }
-
- /**
- * The encoding information used in this <code>@charset</code> rule.
- * @exception org.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the specified encoding value has a
- * syntax error and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding
- * rule is readonly.
- */
- public String getEncoding() {
- return CSSUtil.extractStringContents(getAttribute(ENCODING));
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return CHARSETRULE_NODE;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return CHARSET_RULE;
- }
-
- /**
- *
- */
- public void setEncoding(String encoding) throws org.w3c.dom.DOMException {
- // pa_TODO css pref
- // String quote =
- // com.ibm.sse.editor.css.preferences.CSSPreferenceHelper.getInstance().getQuoteString((ICSSModel)getOwnerDocument().getModel());
- String quote = CSSPreferenceHelper.getInstance().getQuoteString(null);
- String enc = CSSUtil.extractStringContents(encoding);
- quote = CSSUtil.detectQuote(enc, quote);
- setAttribute(ENCODING, quote + enc + quote);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
deleted file mode 100644
index aa99414765..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
+++ /dev/null
@@ -1,1077 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.document.ICSSDocument;
-import org.eclipse.wst.css.core.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.document.ICounter;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.util.CSSUtil;
-import org.eclipse.wst.sse.core.internal.text.TextRegionListImpl;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- *
- */
-class CSSDeclarationItemParser {
- /**
- *
- */
- final class FloatInfo {
- /**
- *
- */
- FloatInfo(String text) {
- parse(text);
- }
-
- /**
- *
- */
- void parse(String text) {
- StringBuffer bufValue = new StringBuffer();
- StringBuffer bufIdent = new StringBuffer();
- boolean bNum = true;
- int len = text.length();
- for (int i = 0; i < len; i++) {
- char c = text.charAt(i);
- if (bNum) {
- if ('0' <= c && c <= '9' || c == '.' || c == '+' || c == '-') {
- bufValue.append(c);
- }
- else {
- bufIdent.append(c);
- bNum = false;
- }
- }
- else {
- bufIdent.append(c);
- }
- }
- String valueStr = bufValue.toString();
- fValue = Float.valueOf(valueStr).floatValue();
- fIdentifier = bufIdent.toString();
- fType = getFloatValueType(valueStr, fIdentifier);
- }
-
- /**
- *
- */
- float getValue() {
- return fValue;
- }
-
- /**
- *
- */
- String getIdentifier() {
- return fIdentifier;
- }
-
- /**
- *
- */
- short getValueType() {
- return fType;
- }
-
- private float fValue = 0.0f;
- private String fIdentifier = null;
- private short fType = CSSPrimitiveValue.CSS_UNKNOWN;
- }
-
- final static int S_NORMAL = 0;
- final static int S_FUNCTION = 1;
- final static int S_FONT_SLASH = 2;
- final static int S_COMMA_SEPARATION = 3;
- private ICSSDocument fDocument = null;
- private IStructuredDocumentRegion fParentRegion = null;
- private boolean fTempStructuredDocument = false;
- private CSSModelUpdateContext fUpdateContext = null;
-
- /**
- * CSSDeclarationItemParser constructor comment.
- */
- CSSDeclarationItemParser(ICSSDocument doc) {
- super();
- fDocument = doc;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createAttrValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("attr")) { //$NON-NLS-1$
- return null;
- }
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- if (valueRegions.size() != 1) {
- return null;
- }
-
- CSSPrimitiveValueImpl value = getCSSPrimitiveValue(CSSPrimitiveValue.CSS_ATTR);
- if (value == null) {
- return null;
- }
-
- ITextRegion region = valueRegions.get(0);
- value.setValue(getText(region));
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createCountersValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("counters")) { //$NON-NLS-1$
- return null;
- }
-
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, CSSRegionContexts.CSS_DECLARATION_VALUE_STRING};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- int size = valueRegions.size();
- if (size != 2 && size != 3) {
- return null;
- }
-
- CounterImpl value = getCounter();
- if (value == null) {
- return null;
- }
-
- for (int i = 0; i < size; i++) {
- ITextRegion region = valueRegions.get(i);
- String text = getText(region);
- CSSAttrImpl attr = null;
- switch (i) {
- case 0 :
- value.setIdentifier(text);
- attr = value.getAttributeNode(ICounter.IDENTIFIER);
- break;
- case 1 :
- value.setSeparator(text);
- attr = value.getAttributeNode(ICounter.SEPARATOR);
- break;
- case 2 :
- value.setListStyle(text);
- attr = value.getAttributeNode(ICounter.LISTSTYLE);
- break;
- default :
- break;
- }
- if (attr != null) {
- attr.setRangeRegion(fParentRegion, region, region);
- }
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createCounterValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("counter")) { //$NON-NLS-1$
- return null;
- }
-
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- int size = valueRegions.size();
- if (size != 1 && size != 2) {
- return null;
- }
-
- CounterImpl value = getCounter();
- if (value == null) {
- return null;
- }
-
- for (int i = 0; i < size; i++) {
- ITextRegion region = valueRegions.get(i);
- String text = getText(region);
- CSSAttrImpl attr = null;
- switch (i) {
- case 0 :
- value.setIdentifier(text);
- attr = value.getAttributeNode(ICounter.IDENTIFIER);
- break;
- case 1 :
- value.setListStyle(text);
- attr = value.getAttributeNode(ICounter.LISTSTYLE);
- break;
- default :
- break;
- }
- if (attr != null) {
- attr.setRangeRegion(fParentRegion, region, region);
- }
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSStyleDeclItemImpl createDeclarationItem(ITextRegionList nodeRegions) {
- CSSStyleDeclItemImpl item = null;
- String name = getPropertyName(nodeRegions);
- if (name != null) {
- item = getCSSStyleDeclItem(name);
- }
- return item;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createFloatValue(String text, String type) {
- FloatInfo info = new FloatInfo(text);
- CSSPrimitiveValueImpl value = getCSSPrimitiveValue(info.getValueType());
- if (value != null) {
- value.setValue(info.getValue());
- }
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createFormatValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("format")) { //$NON-NLS-1$
- return null;
- }
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_STRING};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- // format can take variable args.
- if (valueRegions.size() == 0) {
- return null;
- }
-
- CSSPrimitiveValueImpl value = getCSSPrimitiveValue(ICSSPrimitiveValue.CSS_FORMAT);
- if (value == null) {
- return null;
- }
-
- ITextRegion region = valueRegions.get(0);
- value.setValue(CSSUtil.extractStringContents(getText(region)));
-
- return value;
-
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createLocalValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("local")) { //$NON-NLS-1$
- return null;
- }
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_STRING};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- if (valueRegions.size() != 1) {
- return null;
- }
-
- CSSPrimitiveValueImpl value = getCSSPrimitiveValue(ICSSPrimitiveValue.CSS_LOCAL);
- if (value == null) {
- return null;
- }
-
- ITextRegion region = valueRegions.get(0);
- value.setValue(CSSUtil.extractStringContents(getText(region)));
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createPrimitiveValue(ITextRegion region) {
- if (region == null) {
- return null;
- }
- CSSPrimitiveValueImpl value = null;
- String type = region.getType();
- String text = getText(region);
- if (isBlank(type)) {
- value = null;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE) {
- value = createFloatValue(text, type);
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_STRING || type == CSSRegionContexts.CSS_DECLARATION_VALUE_URI || type == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || type == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- value = createStringValue(text, type);
- }
-
- if (value == null) {
- value = createStringValue(text, type);
- }
-
- if (!fTempStructuredDocument && value != null) {
- value.setRangeRegion(fParentRegion, region, region);
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createPrimitiveValue(ITextRegionList regions) {
- CSSPrimitiveValueImpl value = null;
- CSSUtil.stripSurroundingSpace(regions);
- if (regions.isEmpty()) {
- return null;
- }
- ITextRegion region = regions.get(0);
- if (region == null) {
- return null;
- }
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- String text = getText(region).toLowerCase();
- if (text.equals("rgb(")) { //$NON-NLS-1$
- value = createRgbValue(regions);
- }
- else if (text.equals("counter(")) { //$NON-NLS-1$
- value = createCounterValue(regions);
- }
- else if (text.equals("counters(")) { //$NON-NLS-1$
- value = createCountersValue(regions);
- }
- else if (text.equals("attr(")) { //$NON-NLS-1$
- value = createAttrValue(regions);
- }
- else if (text.equals("format(")) { //$NON-NLS-1$
- value = createFormatValue(regions);
- }
- else if (text.equals("local(")) { //$NON-NLS-1$
- value = createLocalValue(regions);
- }
- else if (text.equals("rect(")) { //$NON-NLS-1$
- value = createRectValue(regions);
- }
- if (value == null) {
- value = createStringValue(regions);
- }
- }
- else {
- value = createStringValue(regions);
- }
-
- if (!fTempStructuredDocument && value != null) {
- value.setRangeRegion(fParentRegion, regions.get(0), regions.get(regions.size() - 1));
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createRectValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("rect")) { //$NON-NLS-1$
- return null;
- }
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION, CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT}; // IDENT:
- // for
- // 'auto'
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- if (valueRegions.size() != 4) {
- return null;
- }
-
- RectImpl value = getRect();
- if (value == null) {
- return null;
- }
-
- for (int i = 0; i < 4; i++) {
- ITextRegion region = valueRegions.get(i);
- CSSPrimitiveValueImpl childValue = null;
- switch (i) {
- case 0 :
- childValue = (CSSPrimitiveValueImpl) value.getTop();
- break;
- case 1 :
- childValue = (CSSPrimitiveValueImpl) value.getRight();
- break;
- case 2 :
- childValue = (CSSPrimitiveValueImpl) value.getBottom();
- break;
- case 3 :
- childValue = (CSSPrimitiveValueImpl) value.getLeft();
- break;
- default :
- break;
- }
- if (childValue == null) {
- return null;
- }
- String text = getText(region);
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- setStringValue(childValue, text, type);
- }
- else {
- setFloatValue(childValue, text, type);
- }
- if (!fTempStructuredDocument) {
- childValue.setRangeRegion(fParentRegion, region, region);
- }
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createRgbValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("rgb")) { //$NON-NLS-1$
- return null;
- }
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- if (valueRegions.size() != 3) {
- return null;
- }
-
- RGBColorImpl value = getRGBColor();
- if (value == null) {
- return null;
- }
-
- for (int i = 0; i < 3; i++) {
- ITextRegion region = valueRegions.get(i);
- CSSPrimitiveValueImpl childValue = null;
- switch (i) {
- case 0 :
- childValue = (CSSPrimitiveValueImpl) value.getRed();
- break;
- case 1 :
- childValue = (CSSPrimitiveValueImpl) value.getGreen();
- break;
- case 2 :
- childValue = (CSSPrimitiveValueImpl) value.getBlue();
- break;
- default :
- break;
- }
- if (childValue == null) {
- return null;
- }
- setFloatValue(childValue, getText(region), region.getType());
- if (!fTempStructuredDocument) {
- childValue.setRangeRegion(fParentRegion, region, region);
- }
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createStringValue(String text, String type) {
- short valueType = getStringValueType(text, type);
- CSSPrimitiveValueImpl value = getCSSPrimitiveValue(valueType);
- if (value != null) {
- if (valueType == CSSPrimitiveValue.CSS_URI) {
- text = CSSUtil.extractUriContents(text);
- }
- else if (valueType == CSSPrimitiveValue.CSS_STRING) {
- text = CSSUtil.extractStringContents(text);
- }
- value.setValue(text);
- }
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createStringValue(ITextRegionList regions) {
- String type = CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT;
- if (regions.size() == 1) {
- ITextRegion region = regions.get(0);
- type = region.getType();
- }
- return createStringValue(makeString(regions), type);
- }
-
- /**
- *
- */
- private CounterImpl getCounter() {
- CounterImpl node;
- if (fUpdateContext != null && fUpdateContext.isActive()) {
- node = fUpdateContext.getCounter();
- }
- else {
- node = (CounterImpl) fDocument.createCSSPrimitiveValue(CSSPrimitiveValue.CSS_COUNTER);
- }
- return node;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl getCSSPrimitiveValue(short type) {
- CSSPrimitiveValueImpl node;
- if (fUpdateContext != null && fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSPrimitiveValue(type);
- }
- else {
- node = (CSSPrimitiveValueImpl) fDocument.createCSSPrimitiveValue(type);
- }
- return node;
- }
-
- /**
- *
- */
- private CSSStyleDeclItemImpl getCSSStyleDeclItem(String propertyName) {
- CSSStyleDeclItemImpl node;
- if (fUpdateContext != null && fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSStyleDeclItem(propertyName);
- }
- else {
- node = (CSSStyleDeclItemImpl) fDocument.createCSSStyleDeclItem(propertyName);
- }
- return node;
- }
-
- /**
- *
- */
- static short getFloatValueType(String ident) {
- ident = ident.toLowerCase();
- short valueType;
- if (ident.length() == 0) {
- valueType = CSSPrimitiveValue.CSS_NUMBER;
- }
- else if (ident.equals("%")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PERCENTAGE;
- }
- else if (ident.equalsIgnoreCase("em")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_EMS;
- }
- else if (ident.equalsIgnoreCase("ex")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_EXS;
- }
- else if (ident.equalsIgnoreCase("px")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PX;
- }
- else if (ident.equalsIgnoreCase("cm")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_CM;
- }
- else if (ident.equalsIgnoreCase("mm")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_MM;
- }
- else if (ident.equalsIgnoreCase("in")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_IN;
- }
- else if (ident.equalsIgnoreCase("pt")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PT;
- }
- else if (ident.equalsIgnoreCase("pc")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PC;
- }
- else if (ident.equalsIgnoreCase("deg")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_DEG;
- }
- else if (ident.equalsIgnoreCase("rad")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_RAD;
- }
- else if (ident.equalsIgnoreCase("grad")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_GRAD;
- }
- else if (ident.equalsIgnoreCase("ms")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_MS;
- }
- else if (ident.equalsIgnoreCase("s")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_S;
- }
- else if (ident.equalsIgnoreCase("hz")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_HZ;
- }
- else if (ident.equalsIgnoreCase("khz")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_KHZ;
- }
- else {
- valueType = CSSPrimitiveValue.CSS_DIMENSION;
- }
- return valueType;
- }
-
- /**
- *
- */
- static short getFloatValueType(String value, String ident) {
- ident = ident.toLowerCase();
- short valueType;
- if (ident.length() == 0) {
- if (0 <= value.indexOf('.')) {
- valueType = CSSPrimitiveValue.CSS_NUMBER;
- }
- else {
- valueType = ICSSPrimitiveValue.CSS_INTEGER;
- }
- }
- else if (ident.equals("%")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PERCENTAGE;
- }
- else if (ident.equalsIgnoreCase("em")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_EMS;
- }
- else if (ident.equalsIgnoreCase("ex")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_EXS;
- }
- else if (ident.equalsIgnoreCase("px")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PX;
- }
- else if (ident.equalsIgnoreCase("cm")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_CM;
- }
- else if (ident.equalsIgnoreCase("mm")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_MM;
- }
- else if (ident.equalsIgnoreCase("in")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_IN;
- }
- else if (ident.equalsIgnoreCase("pt")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PT;
- }
- else if (ident.equalsIgnoreCase("pc")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PC;
- }
- else if (ident.equalsIgnoreCase("deg")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_DEG;
- }
- else if (ident.equalsIgnoreCase("rad")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_RAD;
- }
- else if (ident.equalsIgnoreCase("grad")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_GRAD;
- }
- else if (ident.equalsIgnoreCase("ms")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_MS;
- }
- else if (ident.equalsIgnoreCase("s")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_S;
- }
- else if (ident.equalsIgnoreCase("hz")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_HZ;
- }
- else if (ident.equalsIgnoreCase("khz")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_KHZ;
- }
- else {
- valueType = CSSPrimitiveValue.CSS_DIMENSION;
- }
- return valueType;
- }
-
- /**
- *
- */
- private String getFunctionName(ITextRegionList regions) {
- if (regions == null || regions.size() < 2) {
- return null;
- }
- ITextRegion firstRegion = regions.get(0);
- if (firstRegion.getType() != CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- return null;
- }
- ITextRegion lastRegion = regions.get(regions.size() - 1);
- if (lastRegion.getType() != CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
- return null;
- }
- String text = getText(firstRegion);
- return text.substring(0, text.length() - 1);
- }
-
- /**
- * this method has no validation check, then regions must be passed
- * getFunctionName()...
- */
- private ITextRegionList getFunctionParameters(ITextRegionList regions, String[] accepts) {
- ITextRegionList newRegions = new TextRegionListImpl();
- int nAccepts = (accepts != null) ? accepts.length : 0;
- Iterator i = regions.iterator();
- i.next(); // skip FUNCTION
- while (i.hasNext()) {
- ITextRegion region = (ITextRegion) i.next();
- if (region == null) {
- continue;
- }
- String type = region.getType();
- if (isBlank(type)) {
- continue;
- }
- if (nAccepts == 0) {
- newRegions.add(region);
- }
- else {
- for (int iAccept = 0; iAccept < nAccepts; iAccept++) {
- if (type == accepts[iAccept]) {
- newRegions.add(region);
- break;
- }
- }
- }
- }
- return newRegions;
- }
-
- /**
- *
- */
- // private String getPropertyName(IStructuredDocumentRegion flatNode) {
- // Vector nodeRegions = new Vector(flatNode.getRegions());
- // return getPropertyName(nodeRegions);
- // }
- /**
- *
- */
- private String getPropertyName(ITextRegionList nodeRegions) {
- ITextRegionList nameRegions = new TextRegionListImpl();
- String name = null;
- while (!nodeRegions.isEmpty()) {
- ITextRegion region = nodeRegions.remove(0);
- if (region == null) {
- continue;
- }
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- CSSUtil.stripSurroundingSpace(nameRegions);
- name = makeString(nameRegions);
- break;
- }
- else {
- nameRegions.add(region);
- }
- }
- return name;
- }
-
- /**
- *
- */
- private RectImpl getRect() {
- RectImpl node;
- if (fUpdateContext != null && fUpdateContext.isActive()) {
- node = fUpdateContext.getRect();
- }
- else {
- node = (RectImpl) fDocument.createCSSPrimitiveValue(CSSPrimitiveValue.CSS_RECT);
- }
- return node;
- }
-
- /**
- *
- */
- private RGBColorImpl getRGBColor() {
- RGBColorImpl node;
- if (fUpdateContext != null && fUpdateContext.isActive()) {
- node = fUpdateContext.getRGBColor();
- }
- else {
- node = (RGBColorImpl) fDocument.createCSSPrimitiveValue(CSSPrimitiveValue.CSS_RGBCOLOR);
- }
- return node;
- }
-
- /**
- *
- */
- private short getStringValueType(String text, String type) {
- short valueType;
- if (text.toLowerCase().equals("inherit")) { //$NON-NLS-1$
- valueType = ICSSPrimitiveValue.CSS_INHERIT_PRIMITIVE;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
- valueType = CSSPrimitiveValue.CSS_URI;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_STRING) {
- valueType = CSSPrimitiveValue.CSS_STRING;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- valueType = ICSSPrimitiveValue.CSS_HASH;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && text.equals(",")) { //$NON-NLS-1$
- valueType = ICSSPrimitiveValue.CSS_COMMA;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && text.equals("/")) { //$NON-NLS-1$
- valueType = ICSSPrimitiveValue.CSS_SLASH;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE) {
- valueType = ICSSPrimitiveValue.CSS_URANGE;
- }
- else {
- valueType = CSSPrimitiveValue.CSS_IDENT;
- }
- return valueType;
- }
-
- /**
- *
- */
- private String makeString(ITextRegionList regions) {
- StringBuffer buf = new StringBuffer();
- boolean bSpace = false;
- for (Iterator i = regions.iterator(); i.hasNext();) {
- ITextRegion region = (ITextRegion) i.next();
- String type = region.getType();
- if (!bSpace && isBlank(type)) {
- buf.append(" "); //$NON-NLS-1$
- bSpace = true;
- }
- else {
- buf.append(getText(region));
- bSpace = false;
- }
- }
-
- return buf.toString();
- }
-
- /**
- *
- */
- void setStructuredDocumentTemporary(boolean bTemp) {
- fTempStructuredDocument = bTemp;
- }
-
- /**
- *
- */
- private void setFloatValue(CSSPrimitiveValueImpl value, String text, String type) {
- FloatInfo info = new FloatInfo(text);
- value.setFloatValue(info.getValueType(), info.getValue());
- }
-
- /**
- *
- */
- private void setStringValue(CSSPrimitiveValueImpl value, String text, String type) {
- short valueType = getStringValueType(text, type);
- value.setStringValue(valueType, text);
- }
-
- /**
- * @param item
- * org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclItem
- * @param nodeRegions
- * java.util.Vector
- */
- private void setupImportantAttribute(ICSSStyleDeclItem item, ITextRegionList nodeRegions) {
- if (item == null || nodeRegions == null || nodeRegions.isEmpty()) {
- return;
- }
- ITextRegion region = nodeRegions.get(nodeRegions.size() - 1);
- if (region != null && region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT) {
- item.setPriority(getText(region));
- CSSAttrImpl attr = ((CSSStyleDeclItemImpl) item).getAttributeNode(ICSSStyleDeclItem.IMPORTANT);
- attr.setRangeRegion(fParentRegion, region, region);
- nodeRegions.remove(region);
- }
- }
-
- /**
- *
- */
- void setUpdateContext(CSSModelUpdateContext updateContext) {
- fUpdateContext = updateContext;
- }
-
- /**
- *
- */
- public static boolean hasColonSeparator(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return false;
- }
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null || regions.size() == 0) {
- return false;
- }
-
- for (Iterator i = regions.iterator(); i.hasNext();) {
- ITextRegion region = (ITextRegion) i.next();
- if (region == null) {
- continue;
- }
- if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- *
- */
- CSSStyleDeclItemImpl setupDeclarationItem(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return null;
- }
- if (!hasColonSeparator(flatNode)) {
- return null;
- }
-
- fParentRegion = flatNode;
-
- ITextRegionList nodeRegions = new TextRegionListImpl(flatNode.getRegions()); // make
- // copy
- CSSStyleDeclItemImpl newItem = createDeclarationItem(nodeRegions);
- if (newItem == null) {
- return null;
- }
- if (!fTempStructuredDocument && flatNode != null) {
- newItem.setRangeStructuredDocumentRegion(flatNode, flatNode);
- }
-
- CSSUtil.stripSurroundingSpace(nodeRegions);
- setupImportantAttribute(newItem, nodeRegions);
- // Now, nodeRegions just has regions for value.
- setupValues(newItem, nodeRegions);
- return newItem;
- }
-
- void setupValues(ICSSStyleDeclItem item, IStructuredDocumentRegion parentRegion, ITextRegionList nodeRegions) {
- fParentRegion = parentRegion;
- setupValues(item, nodeRegions);
- }
-
- /**
- * nodeRegions must be broken. If you need after, make copy of them.
- */
- private void setupValues(ICSSStyleDeclItem item, ITextRegionList nodeRegions) {
- if (item == null) {
- return;
- }
-
- ICSSPrimitiveValue value;
- ITextRegionList regionBuf = new TextRegionListImpl();
-
- String propertyName = item.getPropertyName().toLowerCase();
- boolean bFont = (propertyName.equals(PropCMProperty.P_FONT));
- // (short-hand) font
- int status = (propertyName.equals(PropCMProperty.P_VOICE_FAMILY) || propertyName.equals(PropCMProperty.P_FONT_FAMILY)) ? S_COMMA_SEPARATION : S_NORMAL;
- while (!nodeRegions.isEmpty()) {
- value = null;
- ITextRegion region = nodeRegions.remove(0);
- if (region == null) {
- continue;
- }
- String type = region.getType();
- // if (type == CSSRegionContexts.CSS_DECLARATION_DELIMITER || type
- // == CSSRegionContexts.CSS_RBRACE) {
- // break;
- // }
- switch (status) {
- case S_NORMAL :
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- regionBuf.add(region);
- status = S_FUNCTION;
- }
- else if (bFont && type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && fParentRegion.getText(region).equals("/")) { //$NON-NLS-1$
- value = createPrimitiveValue(region);
- status = S_FONT_SLASH;
- }
- else if (!isBlank(type)) {
- value = createPrimitiveValue(region);
- }
- break;
- case S_FUNCTION :
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
- regionBuf.add(region);
- value = createPrimitiveValue(regionBuf);
- regionBuf.clear();
- status = S_NORMAL;
- }
- else if (!isBlank(type)) {
- regionBuf.add(region);
- }
- break;
- case S_FONT_SLASH :
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION) {
- value = createPrimitiveValue(region);
- status = S_COMMA_SEPARATION;
- }
- else if (!isBlank(type)) {
- value = createPrimitiveValue(region);
- }
- break;
- case S_COMMA_SEPARATION :
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && fParentRegion.getText(region).equals(",")) { //$NON-NLS-1$
- value = createPrimitiveValue(regionBuf);
- regionBuf.clear();
- if (value != null) {
- if (fUpdateContext == null || !fUpdateContext.isActive()) {
- item.appendValue(value);
- }
- }
- value = createPrimitiveValue(region);
- }
- else {
- regionBuf.add(region);
- }
- break;
- default :
- break;
- }
- if (value != null) {
- if (fUpdateContext == null || !fUpdateContext.isActive()) {
- item.appendValue(value);
- }
- }
- }
- if (!regionBuf.isEmpty()) {
- value = createPrimitiveValue(regionBuf);
- if (fUpdateContext == null || !fUpdateContext.isActive()) {
- item.appendValue(value);
- }
- }
- }
-
- private String getText(ITextRegion region) {
- return (fParentRegion != null) ? fParentRegion.getText(region) : ""; //$NON-NLS-1$
- }
-
- private static boolean isBlank(String type) {
- return (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT || type == CSSRegionContexts.CSS_DECLARATION_VALUE_S);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java
deleted file mode 100644
index c3bb647e9f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.document.ICSSDocument;
-import org.eclipse.wst.css.core.document.ICSSImportRule;
-import org.eclipse.wst.css.core.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSPageRule;
-import org.eclipse.wst.css.core.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.document.ICSSStyleRule;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSUnknownRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- *
- */
-abstract class CSSDocumentImpl extends CSSStructuredDocumentRegionContainer implements ICSSDocument {
-
- private CSSModelImpl fModel = null;
-
- /**
- * CSSDocumentImpl constructor comment.
- */
- CSSDocumentImpl() {
- super();
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSDocumentImpl
- */
- CSSDocumentImpl(CSSDocumentImpl that) {
- super(that);
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSNode
- * @param name
- * java.lang.String
- */
- ICSSNode createCSSAttr(String name) {
- CSSAttrImpl attr = new CSSAttrImpl(name);
- attr.setOwnerDocument(this);
-
- return attr;
- }
-
- /**
- * @return org.w3c.dom.css.CSSCharsetRule
- */
- public ICSSCharsetRule createCSSCharsetRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSFontFaceRule
- */
- public CSSFontFaceRule createCSSFontFaceRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSImportRule
- */
- public ICSSImportRule createCSSImportRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.ICSSMediaRule
- */
- public ICSSMediaRule createCSSMediaRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPageRule
- */
- public ICSSPageRule createCSSPageRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- */
- public ICSSPrimitiveValue createCSSPrimitiveValue(short primitiveType) {
- CSSPrimitiveValueImpl value = null;
- if (primitiveType == CSSPrimitiveValue.CSS_COUNTER)
- value = new CounterImpl();
- else if (primitiveType == CSSPrimitiveValue.CSS_RECT)
- value = new RectImpl();
- else if (primitiveType == CSSPrimitiveValue.CSS_RGBCOLOR)
- value = new RGBColorImpl();
- else
- value = new CSSPrimitiveValueImpl(primitiveType);
- value.setOwnerDocument(this);
-
- return value;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * java.lang.String
- */
- public CSSRule createCSSRule(String rule) {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSStyleDeclaration
- */
- public ICSSStyleDeclaration createCSSStyleDeclaration() {
- return null;
- }
-
- /**
- * @return com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @param propertyName
- * java.lang.String
- */
- public ICSSStyleDeclItem createCSSStyleDeclItem(String propertyName) {
- CSSStyleDeclItemImpl item = new CSSStyleDeclItemImpl(propertyName);
- item.setOwnerDocument(this);
-
- return item;
- }
-
- /**
- * @return org.w3c.dom.css.CSSStyleRule
- */
- public ICSSStyleRule createCSSStyleRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSUnknownRule
- */
- public CSSUnknownRule createCSSUnknownRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.stylesheets.MediaList
- */
- public MediaList createMediaList() {
- return null;
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSModel
- */
- public ICSSModel getModel() {
- return fModel;
- }
-
- /**
- * @param model
- * com.ibm.sed.css.treemodel.CSSModelImpl
- */
- void setModel(CSSModelImpl model) {
- this.fModel = model;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java
deleted file mode 100644
index c3bdf63fe1..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.w3c.dom.css.CSSFontFaceRule;
-
-
-/**
- *
- */
-class CSSFontFaceRuleImpl extends CSSRuleDeclContainer implements CSSFontFaceRule {
-
- /**
- *
- */
- CSSFontFaceRuleImpl() {
- super();
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSFontFaceRuleImpl
- */
- CSSFontFaceRuleImpl(CSSFontFaceRuleImpl that) {
- super(that);
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSFontFaceRuleImpl cloned = new CSSFontFaceRuleImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return java.lang.String
- */
- String extractPreString() {
- return "@font-face";//$NON-NLS-1$
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return FONTFACERULE_NODE;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return FONT_FACE_RULE;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java
deleted file mode 100644
index bf99f11560..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.document.ICSSImportRule;
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.util.CSSLinkConverter;
-import org.eclipse.wst.css.core.util.CSSUtil;
-import org.eclipse.wst.css.core.util.URLModelProviderCSS;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- *
- */
-class CSSImportRuleImpl extends CSSRuleImpl implements ICSSImportRule {
-
- private boolean fDirty = true;
- private ICSSStyleSheet fStyleSheet;
-
- /**
- *
- */
- CSSImportRuleImpl() {
- super();
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSImportRuleImpl
- */
- CSSImportRuleImpl(CSSImportRuleImpl that) {
- super(that);
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSImportRuleImpl cloned = new CSSImportRuleImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- *
- */
- void closeStyleSheet() {
- if (fStyleSheet != null) {
- ICSSStyleSheet sheet = fStyleSheet;
- fStyleSheet = null; // to prevent loop, we must reset fStyleSheet
- // before all closing action
-
- sheet.getModel().removeStyleListener(getOwnerDocument().getModel());
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) getAdapterFor(IModelProvideAdapter.class);
- // if (getOwnerDocument().getModel().getStyleSheetType() ==
- // ICSSModel.EMBEDDED) { // case STYLE tag
- // adapter = (ModelProvideAdapter)
- // ((INodeNotifier)getOwnerDocument().getModel().getOwnerDOMNode()).getAdapterFor(ModelProvideAdapter.class);
- // }
- if (adapter != null)
- adapter.modelRemoved(sheet.getModel());
-
- sheet.getModel().releaseFromRead();
- }
- }
-
- /**
- * The location of the style sheet to be imported. The attribute will not
- * contain the <code>"url(...)"</code> specifier around the URI.
- */
- public String getHref() {
- return CSSUtil.extractUriContents(getAttribute(HREF));
- }
-
- /**
- * A list of media types for which this style sheet may be used.
- */
- public org.w3c.dom.stylesheets.MediaList getMedia() {
- ICSSNode media = getFirstChild();
- if (media != null) {
- if (media instanceof MediaList) {
- return (MediaList) media;
- }
- }
-
- // THIS CASE IS ERROR CASE
- return null;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return IMPORTRULE_NODE;
- }
-
- /**
- * The style sheet referred to by this rule, if it has been loaded. The
- * value of this attribute is <code>null</code> if the style sheet has
- * not yet been loaded or if it will not be loaded (e.g. if the style
- * sheet is for a media type not supported by the user agent).
- */
- public CSSStyleSheet getStyleSheet() {
-
- if (fDirty) {
- // NOTE: try/catch block is a TEMP fix to avoid compile errors:
- try {
- closeStyleSheet();
-
- if (getHref() == null || getHref().length() <= 0) {
- fDirty = false;
- return null;
- }
-
- IStructuredModel baseModel = getOwnerDocument().getModel();
- if (getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED) { // case
- // STYLE
- // tag
- baseModel = ((XMLNode) getOwnerDocument().getModel().getOwnerDOMNode()).getModel();
- }
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) getAdapterFor(IModelProvideAdapter.class);
- // if (getOwnerDocument().getModel().getStyleSheetType() ==
- // ICSSModel.EMBEDDED) { // case STYLE tag
- // adapter = (ModelProvideAdapter)
- // ((INodeNotifier)getOwnerDocument().getModel().getOwnerDOMNode()).getAdapterFor(ModelProvideAdapter.class);
- // }
-
- // load model from IModelManager
- URLModelProviderCSS provider = new URLModelProviderCSS();
- IStructuredModel newModel = provider.getModelForRead(baseModel, getHref());
- fDirty = false;
-
- if (newModel == null)
- return null;
- if (!(newModel instanceof ICSSModel)) {
- newModel.releaseFromRead();
- return null;
- }
-
- // notify adapter
- if (adapter != null)
- adapter.modelProvided(newModel);
-
- fStyleSheet = (ICSSStyleSheet) ((ICSSModel) newModel).getDocument();
- if (fStyleSheet != null)
- fStyleSheet.getModel().addStyleListener(getOwnerDocument().getModel());
- }
- catch (java.io.IOException e) {
- Logger.logException(e);
- }
- }
- return fStyleSheet;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return IMPORT_RULE;
- }
-
- /**
- *
- */
- public void refreshStyleSheet() {
- if (!fDirty) {
- closeStyleSheet();
- fDirty = true;
- notify(INodeNotifier.CHANGE, getAttributeNode(HREF), null, null, getStartOffset());
- }
- }
-
- /**
- */
- void releaseRule() {
- if (fStyleSheet != null) {
- ICSSStyleSheet sheet = fStyleSheet;
- fStyleSheet = null; // to prevent loop, we must reset fStyleSheet
- // before all closing action
-
- sheet.getModel().removeStyleListener(getOwnerDocument().getModel());
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) getAdapterFor(IModelProvideAdapter.class);
- // if (getOwnerDocument().getModel().getStyleSheetType() ==
- // ICSSModel.EMBEDDED) { // case STYLE tag
- // adapter = (ModelProvideAdapter)
- // ((INodeNotifier)getOwnerDocument().getModel().getOwnerDOMNode()).getAdapterFor(ModelProvideAdapter.class);
- // }
- if (adapter != null)
- adapter.modelReleased(sheet.getModel());
-
- sheet.getModel().releaseFromRead();
- }
- }
-
- /**
- * @param href
- * java.lang.String
- */
- public void setHref(String href) throws DOMException {
- fDirty = true;
- setAttribute(HREF, CSSLinkConverter.addFunc(href));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java
deleted file mode 100644
index d71bfaf055..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- *
- */
-class CSSMediaRuleImpl extends CSSRuleImpl implements ICSSMediaRule {
-
- /**
- *
- */
- CSSMediaRuleImpl() {
- super();
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSMediaRuleImpl
- */
- CSSMediaRuleImpl(CSSMediaRuleImpl that) {
- super(that);
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule appendRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
- if (rule == null)
- return null;
-
- CSSRule ret = (CSSRule) appendChild((CSSNodeImpl) rule);
- return ret;
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSMediaRuleImpl cloned = new CSSMediaRuleImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * Used to delete a rule from the media block.
- *
- * @param index
- * The index within the media block's rule collection of the
- * rule to remove.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index does not
- * correspond to a rule in the media rule list. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule
- * is readonly.
- */
- public void deleteRule(int index) throws DOMException {
- CSSNodeImpl node = getIndexedRule(index);
- if (node != null)
- removeChild(node);
- }
-
- /**
- * A list of all CSS rules contained within the media block.
- */
- public CSSRuleList getCssRules() {
- CSSRuleListImpl list = new CSSRuleListImpl();
-
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSRule)
- list.appendNode(node);
- }
-
- return list;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSRuleImpl
- * @param index
- * int
- */
- CSSRuleImpl getIndexedRule(int index) {
- if (index < 0)
- return null;
-
- int i = 0;
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSRule) {
- if (i++ == index)
- return (CSSRuleImpl) node;
- }
- }
- return null;
- }
-
- /**
- * A list of media types for this rule.
- */
- public MediaList getMedia() {
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof MediaListImpl)
- return (MediaList) node;
- }
-
- return null;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return MEDIARULE_NODE;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return MEDIA_RULE;
- }
-
- /**
- * Used to insert a new rule into the media block.
- *
- * @param rule
- * The parsable text representing the rule. For rule sets this
- * contains both the selector and the style declaration. For
- * at-rules, this specifies both the at-identifier and the rule
- * content.
- * @param index
- * The index within the media block's rule collection of the
- * rule before which to insert the specified rule. If the
- * specified index is equal to the length of the media blocks's
- * rule collection, the rule will be added to the end of the
- * media block.
- * @return The index within the media block's rule collection of the newly
- * inserted rule.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be
- * inserted at the specified index, e.g., if an
- * <code>@import</code> rule is inserted after a standard rule set or other
- * at-rule. <br>
- * INDEX_SIZE_ERR: Raised if the specified index is not a valid
- * insertion point. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is
- * readonly. <br>
- * SYNTAX_ERR: Raised if the specified rule has a syntax error and
- * is unparsable.
- */
- public int insertRule(String rule, int index) throws DOMException {
- int length = getCssRules().getLength();
- if (index < 0 || length < index)
- throw new DOMException(DOMException.INDEX_SIZE_ERR, "");//$NON-NLS-1$
-
- CSSRuleImpl refRule = (length != index) ? getIndexedRule(index) : null;
-
- CSSRuleImpl newRule = (CSSRuleImpl) getOwnerDocument().createCSSRule(rule);
-
- // prevent from nesting @media rule
- if (newRule.getType() == CSSRule.MEDIA_RULE)
- throw new DOMException(DOMException.SYNTAX_ERR, "");//$NON-NLS-1$
-
- insertBefore(newRule, refRule);
-
- return index;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newRule
- * org.w3c.dom.css.CSSRule
- * @param refRule
- * org.w3c.dom.css.CSSRule
- */
- public org.w3c.dom.css.CSSRule insertRuleBefore(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule refRule) throws org.w3c.dom.DOMException {
- if (newRule == null && refRule == null)
- return null;
-
- CSSRule ret = (CSSRule) insertBefore((CSSNodeImpl) newRule, (CSSNodeImpl) refRule);
- return ret;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule removeRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
- if (rule == null)
- return null;
-
- CSSRule ret = (CSSRule) removeChild((CSSNodeImpl) rule);
- return ret;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newChild
- * org.w3c.dom.css.CSSRule
- * @param oldChild
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule replaceRule(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule oldRule) throws org.w3c.dom.DOMException {
- if (newRule == null && oldRule == null)
- return null;
-
- CSSRule ret = (CSSRule) replaceChild((CSSNodeImpl) newRule, (CSSNodeImpl) oldRule);
- return ret;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java
deleted file mode 100644
index bc640da725..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-
-
-/**
- *
- */
-class CSSModelCreationContext {
-
- private CSSNodeImpl fRootNode = null;
- private CSSNodeImpl fTargetNode = null;
- private CSSNodeImpl fNextNode = null;
- private int fReparseStart = -1;
- private int fReparseEnd = -1;
-
- /**
- * CSSModelContext constructor comment.
- */
- CSSModelCreationContext(CSSNodeImpl rootNode) {
- super();
-
- fRootNode = rootNode;
- }
-
- /**
- *
- */
- void clear() {
- fNextNode = null;
- fTargetNode = null;
- resetReparseRange();
- }
-
- /**
- *
- */
- CSSNodeImpl getNextNode() {
- return fNextNode;
- }
-
- /**
- *
- */
- int getReparseEnd() {
- return fReparseEnd;
- }
-
- /**
- *
- */
- int getReparseStart() {
- return fReparseStart;
- }
-
- /**
- *
- */
- CSSNodeImpl getRootNode() {
- return fRootNode;
- }
-
- /**
- *
- */
- CSSNodeImpl getTargetNode() {
- return fTargetNode;
- }
-
- /**
- *
- */
- boolean isToReparse() {
- return (0 <= getReparseStart() && 0 <= getReparseEnd());
- }
-
- /**
- *
- */
- void resetReparseRange() {
- fReparseStart = fReparseEnd = -1;
- }
-
- /**
- *
- */
- void setLast() {
- fNextNode = null;
-
- if (!(fRootNode instanceof CSSStructuredDocumentRegionContainer)) {
- fTargetNode = fRootNode;
- }
- else {
- IStructuredDocumentRegion lastStructuredDocumentRegion = ((CSSStructuredDocumentRegionContainer) fRootNode).getLastStructuredDocumentRegion();
- CSSNodeImpl node = fRootNode;
- while (node != null) {
- ICSSNode lastChild = node.getLastChild();
- if (lastChild instanceof CSSStructuredDocumentRegionContainer && ((CSSStructuredDocumentRegionContainer) lastChild).getLastStructuredDocumentRegion() == lastStructuredDocumentRegion) {
- node = (CSSNodeImpl) lastChild;
- }
- else {
- break;
- }
- }
- fTargetNode = node;
- }
- }
-
- /**
- *
- */
- void setNextNode(ICSSNode node) {
- fNextNode = (CSSNodeImpl) node;
- if (fNextNode != null) {
- fTargetNode = (CSSNodeImpl) fNextNode.getParentNode();
- }
- }
-
- /**
- *
- */
- void setReparseEnd(int end) {
- fReparseEnd = end;
- }
-
- /**
- *
- */
- void setReparseStart(int start) {
- fReparseStart = start;
- }
-
- /**
- *
- */
- void setTargetNode(ICSSNode node) {
- fTargetNode = (CSSNodeImpl) node;
- if (fNextNode != null && fNextNode.getParentNode() != fTargetNode) {
- fNextNode = null;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java
deleted file mode 100644
index ee63966d4b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.util.CSSUtil;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegionList;
-
-
-/**
- *
- */
-class CSSModelDeletionContext {
-
- private int fOldStart = -1;
- private int fOldLength = 0;
- private int fNewStart = -1;
- private int fNewLength = 0;
- private int fLengthDifference = 0;
- private IStructuredDocumentRegionList fOldStructuredDocumentRegions = null;
- // private ICSSNode fRootNode = null;
- private int fRemovedRangeBegin = -1;
- private int fRemovedRangeEnd = -1;
- private CSSNodeListImpl fNodesToBeRemoved = new CSSNodeListImpl();
-
- /**
- * CSSModelDeletionContext constructor comment.
- */
- CSSModelDeletionContext(ICSSNode rootNode) {
- super();
-
- // fRootNode = rootNode;
- }
-
- /**
- *
- */
- boolean addNodeToBeRemoved(ICSSNode node) {
- int nNodes = fNodesToBeRemoved.getLength();
- for (int i = 0; i < nNodes; i++) {
- ICSSNode parent = fNodesToBeRemoved.item(i);
- if (CSSModelUtil.isParentOf(parent, node)) {
- return false;
- }
- }
- fNodesToBeRemoved.appendNode(node);
- return true;
- }
-
- /**
- *
- */
- void expandRemovedRangeBegin(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return;
- }
- int newBegin = flatNode.getStart(); // fOldStart == fNewStart, right??
- if (fRemovedRangeBegin < 0 || newBegin < fRemovedRangeBegin) {
- fRemovedRangeBegin = newBegin;
- }
- }
-
- /**
- *
- */
- void expandRemovedRangeEnd(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return;
- }
- int newEnd = flatNode.getEnd() + ((isOldNode(flatNode)) ? fLengthDifference : 0);
- if (fRemovedRangeEnd < 0 || fRemovedRangeEnd < newEnd) {
- fRemovedRangeEnd = newEnd;
- }
- }
-
- /**
- *
- */
- private CSSStructuredDocumentRegionContainer findContainer(CSSNodeImpl parent, IStructuredDocumentRegion flatNode) {
- if (parent instanceof CSSStructuredDocumentRegionContainer) {
- // Am i a container of flatNode?
- IStructuredDocumentRegion firstNode = ((CSSStructuredDocumentRegionContainer) parent).getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion lastNode = ((CSSStructuredDocumentRegionContainer) parent).getLastStructuredDocumentRegion();
- int firstStart = getOriginalOffset(firstNode);
- int lastStart = getOriginalOffset(lastNode);
- int start = flatNode.getStart();
-
- if (firstStart <= start && start <= lastStart) {
- // I am a container, is my child a container ?
- for (ICSSNode node = parent.getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSNodeImpl) {
- CSSStructuredDocumentRegionContainer container = findContainer((CSSNodeImpl) node, flatNode);
- if (container != null) {
- return container;
- }
- }
- }
- return (CSSStructuredDocumentRegionContainer) parent;
- }
- }
-
- return null;
- }
-
- /**
- *
- */
- CSSStructuredDocumentRegionContainer findDeletionTarget(CSSNodeImpl parent, IStructuredDocumentRegion flatNode) {
- CSSStructuredDocumentRegionContainer target = findContainer(parent, flatNode);
- if (target == null) {
- return null;
- }
-
- // System.out.print(flatNode.toString() + ": ");
-
- // child a(=====)b(=====)c
- // parent (================) a,c can remove parent, but b cannot.
-
- ICSSNode child;
-
- for (child = target.getFirstChild(); child != null && !(child instanceof CSSStructuredDocumentRegionContainer); child = child.getNextSibling()) {
- // just advancing
- }
-
- if (child == null) {
- // System.out.println("target has no children."); // TESTBYCOZY
- return target; // has no child containers.
- }
- else {
- IStructuredDocumentRegion firstNode = ((CSSStructuredDocumentRegionContainer) child).getFirstStructuredDocumentRegion();
- if (flatNode.getStart() < getOriginalOffset(firstNode)) {
- // System.out.println("flatNode is in front of first child");
- // // TESTBYCOZY
- return target; // a
- }
- }
-
- for (child = target.getLastChild(); child != null && !(child instanceof CSSStructuredDocumentRegionContainer); child = child.getPreviousSibling()) {
- // just advancing
- }
-
- if (child == null) {
- // System.out.println("target has no children."); // TESTBYCOZY
- return target; // has no child containers.
- }
- else {
- IStructuredDocumentRegion firstNode = ((CSSStructuredDocumentRegionContainer) child).getFirstStructuredDocumentRegion();
- if (getOriginalOffset(firstNode) < flatNode.getStart()) {
- // System.out.println("flatNode is in after of last child");
- // // TESTBYCOZY
- return target; // c
- }
- }
-
- // System.out.println("flatNode inner of children"); // TESTBYCOZY
- return null; // b
- }
-
- /**
- *
- */
- Iterator getNodesToBeRemoved() {
- Collection nodes = new ArrayList();
- int nNodes = fNodesToBeRemoved.getLength();
- for (int i = 0; i < nNodes; i++) {
- nodes.add(fNodesToBeRemoved.item(i));
- }
- return nodes.iterator();
- }
-
- /**
- *
- */
- private int getOriginalOffset(IStructuredDocumentRegion flatNode) {
- int offset = 0;
- if (flatNode != null) {
- offset = flatNode.getStart();
- if (0 <= fLengthDifference) {
- if (fNewStart + fNewLength < offset) {
- offset -= fLengthDifference;
- }
- }
- else {
- if (fOldStart + fOldLength <= offset || (fNewStart < 0 && fOldStart <= offset && !isOldNode(flatNode)) || (0 <= fNewStart && fNewStart + fNewLength <= offset && !isOldNode(flatNode))) {
- offset -= fLengthDifference;
- }
- }
- }
-
- return offset;
- }
-
- /**
- *
- */
- int getRemovedRangeBegin() {
- return fRemovedRangeBegin;
- }
-
- /**
- *
- */
- int getRemovedRangeEnd() {
- return fRemovedRangeEnd;
- }
-
- /**
- *
- */
- private boolean isOldNode(IStructuredDocumentRegion flatNode) {
- if (fOldStructuredDocumentRegions != null) {
- for (Enumeration e = fOldStructuredDocumentRegions.elements(); e.hasMoreElements();) {
- if (e.nextElement() == flatNode) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- *
- */
- void setupContext(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
- IStructuredDocumentRegion flatNode = null;
- fOldLength = CSSUtil.getTextLength(oldStructuredDocumentRegions);
- if (oldStructuredDocumentRegions != null && 0 < oldStructuredDocumentRegions.getLength() && (flatNode = oldStructuredDocumentRegions.item(0)) != null) {
- fOldStart = flatNode.getStart();
- }
- else {
- fOldStart = -1;
- }
- fNewLength = CSSUtil.getTextLength(newStructuredDocumentRegions);
- if (newStructuredDocumentRegions != null && 0 < newStructuredDocumentRegions.getLength() && (flatNode = newStructuredDocumentRegions.item(0)) != null) {
- fNewStart = flatNode.getStart();
- fRemovedRangeBegin = fNewStart;
- fRemovedRangeEnd = fNewStart + fNewLength;
- }
- else {
- fNewStart = -1;
- fRemovedRangeBegin = fRemovedRangeEnd = -1;
- }
- fLengthDifference = fNewLength - fOldLength;
- fOldStructuredDocumentRegions = oldStructuredDocumentRegions;
-
- // cleanup nodes
- while (0 < fNodesToBeRemoved.getLength()) {
- fNodesToBeRemoved.removeNode(0);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java
deleted file mode 100644
index 1d98f57a45..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java
+++ /dev/null
@@ -1,677 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.document.ICSSAttr;
-import org.eclipse.wst.css.core.document.ICSSDocument;
-import org.eclipse.wst.css.core.document.ICSSImportRule;
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSSelector;
-import org.eclipse.wst.css.core.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.document.ICSSValue;
-import org.eclipse.wst.css.core.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.event.CSSEmbededStyleNotifyAdapter;
-import org.eclipse.wst.css.core.internal.event.CSSStyleNotifyAdapter;
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.util.ImportRuleCollector;
-import org.eclipse.wst.css.core.util.ImportedCollector;
-import org.eclipse.wst.css.core.util.SelectorsCollector;
-import org.eclipse.wst.sse.core.AbstractStructuredModel;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.core.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.events.NewDocumentEvent;
-import org.eclipse.wst.sse.core.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.events.RegionsReplacedEvent;
-import org.eclipse.wst.sse.core.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.exceptions.ResourceInUse;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-import org.eclipse.wst.sse.core.util.Assert;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-
-public class CSSModelImpl extends AbstractStructuredModel implements ICSSModel, IStructuredDocumentListener {
-
- private CSSDocumentImpl document = null;
- private org.w3c.dom.Node ownerNode = null;
- private CSSStyleNotifyAdapter styleNotifier = null;
- private CSSModelParser fParser = null;
- private CSSModelUpdater fUpdater = null;
- private boolean fStructuredDocumentUpdate = false;
- private final static String ID_NON_EXTERNAL_CSS = "**_NON_EXTERNAL_CSS_***";//$NON-NLS-1$
-
- /**
- * CSSModelImpl constructor comment.
- *
- */
- public CSSModelImpl() {
- super();
- }
-
- /**
- * @param listener
- * org.eclipse.wst.css.core.event.CSSStyleListener
- */
- public void addStyleListener(ICSSStyleListener listener) {
- getStyleNotifier().addStyleListener(listener);
- }
-
- /**
- * @param parentNode
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param newAttr
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param oldAttr
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- */
- void attrReplaced(CSSNodeImpl parentNode, CSSNodeImpl newAttr, CSSNodeImpl oldAttr) {
- if (!fStructuredDocumentUpdate) {
- CSSModelUpdater updater = getUpdater();
- updater.attrReplaced(parentNode, newAttr, oldAttr);
- }
-
- ICSSSelector removed[] = null, added[] = null;
- if (oldAttr != null && oldAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) oldAttr).getName().equals(ICSSStyleRule.SELECTOR)) {
- CSSAttrImpl attr = (CSSAttrImpl) oldAttr;
- // collect changed selector
- ICSSSelectorList list = new CSSSelectorListImpl(attr.getValue());
- removed = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- removed[i] = list.getSelector(i);
- }
- if (newAttr != null && newAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) newAttr).getName().equals(ICSSStyleRule.SELECTOR)) {
- CSSAttrImpl attr = (CSSAttrImpl) newAttr;
- // collect changed selector
- ICSSSelectorList list = new CSSSelectorListImpl(attr.getValue());
- added = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- added[i] = list.getSelector(i);
- }
- if (removed != null || added != null || getDocument().getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
- getStyleNotifier().fire(removed, added, null);
- }
- // for href attribute
- if (getStyleListeners() != null && getStyleListeners().size() > 0) {
- boolean update = false;
- if (oldAttr != null && oldAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) oldAttr).getName().equals(ICSSImportRule.HREF)) {
- update = true;
- }
- if (newAttr != null && newAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) newAttr).getName().equals(ICSSImportRule.HREF)) {
- update = true;
- }
- if (update)
- ((ICSSImportRule) parentNode).getStyleSheet();
- }
- }
-
- /**
- *
- */
- public void beginRecording(Object requester, String label, String description) {
- getStyleNotifier().beginRecording();
-
- Node node = getOwnerDOMNode();
- if (node != null && node instanceof XMLNode) {
- IStructuredModel model = ((XMLNode) node).getModel();
- if (model != null) {
- model.beginRecording(requester, label, description);
- return;
- }
- }
- super.beginRecording(requester, label, description);
- }
-
- /**
- * @param parentNode
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param newChild
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param oldChild
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- */
- void childReplaced(CSSNodeImpl parentNode, CSSNodeImpl newChild, CSSNodeImpl oldChild) {
- if (!fStructuredDocumentUpdate) {
- CSSModelUpdater updater = getUpdater();
- updater.childReplaced(parentNode, newChild, oldChild);
- }
-
- // always check and send selector event
- ICSSSelector removed[] = null, added[] = null;
- if (parentNode.getNodeType() == ICSSNode.STYLESHEET_NODE || parentNode.getNodeType() == ICSSNode.MEDIARULE_NODE) {
- // collect old selectors
- SelectorsCollector selTrav = new SelectorsCollector();
- selTrav.apply(oldChild);
- int nSel = selTrav.getSelectors().size();
- if (nSel > 0) {
- removed = new ICSSSelector[nSel];
- for (int i = 0; i < nSel; i++)
- removed[i] = (ICSSSelector) selTrav.getSelectors().get(i);
- }
- // collect new selectors
- selTrav = new SelectorsCollector();
- selTrav.apply(newChild);
- nSel = selTrav.getSelectors().size();
- if (nSel > 0) {
- added = new ICSSSelector[nSel];
- for (int i = 0; i < nSel; i++)
- added[i] = (ICSSSelector) selTrav.getSelectors().get(i);
- }
- }
- else {
- // modification
- ICSSNode rule = parentNode;
- while (rule != null) {
- if (rule instanceof ICSSStyleRule)
- break;
- rule = rule.getParentNode();
- }
- if (rule != null) {
- ICSSSelectorList list = ((ICSSStyleRule) rule).getSelectors();
- added = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- added[i] = list.getSelector(i);
- }
- }
- if (removed != null || added != null || getDocument().getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
- // send selector changed event
- getStyleNotifier().fire(removed, added, null);
- }
- // close removed import-rule's external style sheets
- {
- ImportRuleCollector trav = new ImportRuleCollector();
- trav.apply(oldChild);
- Iterator it = trav.getRules().iterator();
- while (it.hasNext()) {
- ((CSSImportRuleImpl) it.next()).closeStyleSheet();
- }
- }
- // send events to listener for new import-rules
- if (getStyleListeners() != null && getStyleListeners().size() > 0) {
- ImportedCollector trav = new ImportedCollector();
- trav.apply(newChild);
- }
- }
-
- /**
- *
- */
- private void closeImported() {
- if (!isShared()) {
- // release listeners
- if (getStyleListeners() != null) {
- Vector toRemove = new Vector(getStyleListeners());
- Iterator it = toRemove.iterator();
- while (it.hasNext()) {
- removeStyleListener((ICSSStyleListener) it.next());
- }
- }
- // close import rules
- ImportRuleCollector trav = new ImportRuleCollector();
- trav.apply(getDocument());
- Iterator it2 = trav.getRules().iterator();
- while (it2.hasNext()) {
- ((CSSImportRuleImpl) it2.next()).releaseRule();
- }
- }
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSDocumentImpl
- */
- private CSSDocumentImpl createDocument() {
- CSSDocumentImpl doc = null;
- int parserMode = CSSSourceParser.MODE_STYLESHEET;
- if (ownerNode == null) {
- // this case is external CSS file
- doc = (CSSStyleSheetImpl) DOMCSSImpl.createCSSStyleSheet(null, null); // parameters
- // are
- // for
- // STYLE-tag
- parserMode = CSSSourceParser.MODE_STYLESHEET;
- }
- else if (ownerNode instanceof org.w3c.dom.Element && ((Element) ownerNode).getTagName().toUpperCase().equals("STYLE")) {//$NON-NLS-1$
- // this case is STYLE-tag
- Element style = (Element) ownerNode;
- doc = (CSSStyleSheetImpl) DOMCSSImpl.createCSSStyleSheet(style.getAttribute("TITLE"), //$NON-NLS-1$
- style.getAttribute("MEDIA"));//$NON-NLS-1$
- parserMode = CSSSourceParser.MODE_STYLESHEET;
- }
- else if (ownerNode instanceof org.w3c.dom.Element || ownerNode instanceof org.w3c.dom.Attr) {
- // Inline attributes
- doc = (CSSStyleDeclarationImpl) DOMCSSImpl.createCSSStyleDeclaration();
- parserMode = CSSSourceParser.MODE_DECLARATION;
- }
- RegionParser regionParser = getStructuredDocument().getParser();
- if (regionParser instanceof CSSSourceParser) {
- ((CSSSourceParser) regionParser).setParserMode(parserMode);
- }
- return doc;
- }
-
- /**
- *
- */
- public void endRecording(Object requester) {
- Node node = getOwnerDOMNode();
- if (node != null && node instanceof XMLNode) {
- IStructuredModel model = ((XMLNode) node).getModel();
- if (model != null) {
- model.endRecording(requester);
- return;
- }
- }
- super.endRecording(requester);
-
- getStyleNotifier().endRecording();
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSDocument
- */
- public ICSSDocument getDocument() {
- if (document == null) {
- this.document = createDocument();
- this.document.setModel(this);
- }
- return this.document;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.IStructuredDocument
- */
- public IStructuredDocument getStructuredDocument() {
- IStructuredDocument structuredDocument = super.getStructuredDocument();
- if (structuredDocument != null)
- return structuredDocument;
-
- // the first time
- Assert.isNotNull(getModelHandler());
- structuredDocument = (IStructuredDocument) getModelHandler().getDocumentLoader().createNewStructuredDocument();
- // structuredDocument = new
- // com.ibm.sed.structuredDocument.impl.IStructuredDocument(IStructuredModel.CSS);
- // CSSStructuredDocumentReParser reParser = new
- // CSSStructuredDocumentReParser();
- // reParser.setStructuredDocument(structuredDocument);
- // ((com.ibm.sed.structuredDocument.impl.IStructuredDocument)structuredDocument).setReParser(reParser);
-
- setStructuredDocument(structuredDocument);
-
- return structuredDocument;
- }
-
- /**
- * getNode method comment.
- */
- public IndexedRegion getIndexedRegion(int offset) {
- if (getDocument() == null)
- return null;
- return ((CSSStructuredDocumentRegionContainer) getDocument()).getContainerNode(offset);
- }
-
- /**
- * @return org.w3c.dom.Node
- */
- public Node getOwnerDOMNode() {
- return ownerNode;
- }
-
- /**
- * @param ownerNode
- * org.w3c.dom.Node if the case of external CSS model, you
- * should set null, else if internal css, you should set
- * STYLE-tag node, else if inline css, you should set the
- * element that is the owner of style-attribute.
- */
- public void setOwnerDOMNode(Node node) {
- // prohibit owner change
- Assert.isTrue(ownerNode == null);
- ownerNode = node;
- if (ownerNode != null) { // for internal/inline CSS context
- try {
- setId(ID_NON_EXTERNAL_CSS);
- }
- catch (ResourceInUse e) {
- // impossible
- }
- }
- }
-
- /**
- *
- */
- private CSSModelParser getParser() {
- if (fParser == null) {
- if (getDocument() != null) {
- fParser = new CSSModelParser(document);
- }
- }
- return fParser;
- }
-
- /**
- * @return java.util.List
- */
- public List getStyleListeners() {
- return getStyleNotifier().getStyleListeners();
- }
-
- /**
- *
- * @return java.lang.Object
- */
- public java.lang.Object getStyleSheetType() {
- if (getDocument() instanceof ICSSStyleDeclaration)
- return INLINE;
- if (getOwnerDOMNode() != null)
- return EMBEDDED;
- else
- return EXTERNAL;
- }
-
- private CSSStyleNotifyAdapter getStyleNotifier() {
- if (styleNotifier == null) {
- styleNotifier = (ownerNode != null) ? new CSSEmbededStyleNotifyAdapter(this) : new CSSStyleNotifyAdapter(this);
- }
- return styleNotifier;
- }
-
- /**
- *
- */
- private CSSModelUpdater getUpdater() {
- if (fUpdater == null) {
- fUpdater = new CSSModelUpdater(this);
- fUpdater.setParser(getParser());
- }
- return fUpdater;
- }
-
- /**
- */
- public boolean isRecording() {
- return getStyleNotifier().isRecording();
- }
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- */
- public boolean isShared() {
- return (getStyleSheetType() == EXTERNAL) && super.isShared();
- }
-
- /**
- * @param structuredDocumentEvent
- * com.ibm.sed.structuredDocument.events.NewModelEvent
- */
- public void newModel(NewDocumentEvent structuredDocumentEvent) {
- if (structuredDocumentEvent == null)
- return;
- IStructuredDocument structuredDocument = structuredDocumentEvent.getStructuredDocument();
- if (structuredDocument == null)
- return;
- // this should not happen, but for the case
- if (structuredDocument != getStructuredDocument())
- setStructuredDocument(structuredDocument);
- IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
- if (flatNodes == null)
- return;
- if (getDocument() == null)
- return;
-
- fStructuredDocumentUpdate = true;
-
- ((CSSStructuredDocumentRegionContainer) getDocument()).removeChildNodes();
-
- CSSModelParser parser = getParser();
- parser.setStructuredDocumentEvent(structuredDocumentEvent);
- parser.replaceStructuredDocumentRegions(flatNodes, null);
-
- fStructuredDocumentUpdate = false;
- }
-
- /**
- * noChange method comment.
- */
- public void noChange(NoChangeEvent structuredDocumentEvent) {
- // nop
- }
-
- /**
- * @param structuredDocumentEvent
- * com.ibm.sed.structuredDocument.events.StructuredDocumentRegionsReplacedEvent
- */
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
- if (structuredDocumentEvent == null) {
- return;
- }
- IStructuredDocumentRegionList oldStructuredDocumentRegions = structuredDocumentEvent.getOldStructuredDocumentRegions();
- IStructuredDocumentRegionList newStructuredDocumentRegions = structuredDocumentEvent.getNewStructuredDocumentRegions();
- if (oldStructuredDocumentRegions == null && newStructuredDocumentRegions == null) {
- return;
- }
-
- fStructuredDocumentUpdate = true;
-
- CSSModelParser parser = getParser();
- parser.setStructuredDocumentEvent(structuredDocumentEvent);
- parser.replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
-
- fStructuredDocumentUpdate = false;
- }
-
- /**
- * cleanup -> rebuild CSS Nodes This is pre-beta fix for 178176.
- */
- public void refreshNodes() {
- // cleanup old nodes
- fStructuredDocumentUpdate = true;
- ((CSSStructuredDocumentRegionContainer) getDocument()).removeChildNodes();
- fStructuredDocumentUpdate = false;
-
- getParser().cleanupUpdateContext();
-
- IStructuredDocument structuredDocument = getStructuredDocument();
- String source = structuredDocument.getText();
-
- structuredDocument.replaceText(this, 0, source.length(), null);
- structuredDocument.replaceText(this, 0, 0, source);
- }
-
- /**
- * @param structuredDocumentEvent
- * com.ibm.sed.structuredDocument.events.RegionChangedEvent
- */
- public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
- if (structuredDocumentEvent == null) {
- return;
- }
- IStructuredDocumentRegion flatNode = structuredDocumentEvent.getStructuredDocumentRegion();
- if (flatNode == null) {
- return;
- }
- ITextRegion region = structuredDocumentEvent.getRegion();
- if (region == null) {
- return;
- }
-
- fStructuredDocumentUpdate = true;
-
- CSSModelParser parser = getParser();
- parser.setStructuredDocumentEvent(structuredDocumentEvent);
- parser.changeRegion(flatNode, region);
-
- fStructuredDocumentUpdate = false;
- }
-
- /**
- * @param structuredDocumentEvent
- * com.ibm.sed.structuredDocument.events.RegionsReplacedEvent
- */
- public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
- if (structuredDocumentEvent == null)
- return;
- IStructuredDocumentRegion flatNode = structuredDocumentEvent.getStructuredDocumentRegion();
- if (flatNode == null)
- return;
- ITextRegionList oldRegions = structuredDocumentEvent.getOldRegions();
- ITextRegionList newRegions = structuredDocumentEvent.getNewRegions();
- if (oldRegions == null && newRegions == null)
- return;
-
- fStructuredDocumentUpdate = true;
-
- CSSModelParser parser = getParser();
- parser.setStructuredDocumentEvent(structuredDocumentEvent);
- parser.replaceRegions(flatNode, newRegions, oldRegions);
-
- fStructuredDocumentUpdate = false;
-
- }
-
- /**
- *
- */
- public void releaseFromEdit() {
- closeImported();
- if (getStyleSheetType() == EXTERNAL) {
- super.releaseFromEdit();
- }
- }
-
- /**
- *
- */
- public void releaseFromRead() {
- closeImported();
- if (getStyleSheetType() == EXTERNAL) {
- super.releaseFromRead();
- }
- }
-
- /**
- * @param listener
- * org.eclipse.wst.css.core.event.CSSStyleListener
- */
- public void removeStyleListener(ICSSStyleListener listener) {
- getStyleNotifier().removeStyleListener(listener);
- }
-
- /**
- * @param newStructuredDocument
- * com.ibm.sed.structuredDocument.IStructuredDocument
- */
- public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
- IStructuredDocument oldStructuredDocument = super.getStructuredDocument();
- if (newStructuredDocument == oldStructuredDocument)
- return; // noting to do
-
- if (oldStructuredDocument != null)
- oldStructuredDocument.removeDocumentChangingListener(this);
- super.setStructuredDocument(newStructuredDocument);
- if (newStructuredDocument.getLength() > 0) {
- newModel(new NewDocumentEvent(newStructuredDocument, this));
- }
- if (newStructuredDocument != null)
- newStructuredDocument.addDocumentChangingListener(this);
- }
-
- /**
- * @param srcModel
- * com.imb.sed.css.mode.intefaces.ICSSModel
- * @param removed
- * org.eclipse.wst.css.core.model.interfaces.ICSSSelector[]
- * @param added
- * org.eclipse.wst.css.core.model.interfaces.ICSSSelector[]
- */
- public void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
- getStyleNotifier().styleChanged(srcModel, removed, added, media);
- }
-
- /**
- * @param srcModel
- * org.eclipse.wst.css.core.model.interfaces.ICSSModel
- */
- public void styleUpdate(ICSSModel srcModel) {
- getStyleNotifier().styleUpdate(srcModel);
- }
-
- /**
- * @param node
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- */
- void valueChanged(CSSNodeImpl node, String oldValue) {
- if (!fStructuredDocumentUpdate) {
- CSSModelUpdater updater = getUpdater();
- updater.valueChanged(node, oldValue);
- }
-
- ICSSSelector removed[] = null, added[] = null;
- if (node != null) {
- if (node.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) node).getName().equals(ICSSStyleRule.SELECTOR)) {
- CSSAttrImpl attr = (CSSAttrImpl) node;
- // collect changed selector
- ICSSSelectorList list = new CSSSelectorListImpl(attr.getValue());
- added = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- added[i] = list.getSelector(i);
-
- // get old value
- list = new CSSSelectorListImpl(oldValue);
- removed = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- removed[i] = list.getSelector(i);
- }
- else if (node instanceof ICSSValue) {
- ICSSNode rule = node;
- while (rule != null) {
- if (rule instanceof ICSSStyleRule)
- break;
- rule = rule.getParentNode();
- }
- if (rule != null) {
- ICSSSelectorList list = ((ICSSStyleRule) rule).getSelectors();
- added = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- added[i] = list.getSelector(i);
- }
- }
- }
- if (removed != null || added != null || getDocument().getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
- // send selector changed event
- getStyleNotifier().fire(removed, added, null);
- }
- // for href attribute
- if (getStyleListeners() != null && getStyleListeners().size() > 0) {
- if (node != null && node.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) node).getName().equals(ICSSImportRule.HREF)) {
- ((ICSSImportRule) ((ICSSAttr) node).getOwnerCSSNode()).getStyleSheet();
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java
deleted file mode 100644
index 0f50a99cfc..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-/**
- *
- */
-class CSSModelNodeFeeder {
-
- CSSDocumentImpl fDocument = null;
- CSSModelUpdateContext fUpdateContext = null;
-
- /**
- * CSSModelNodeFeeder constructor comment.
- */
- CSSModelNodeFeeder() {
- super();
- }
-
- /**
- * CSSModelNodeFeeder constructor comment.
- */
- CSSModelNodeFeeder(CSSDocumentImpl document, CSSModelUpdateContext updateContext) {
- super();
- fDocument = document;
- fUpdateContext = updateContext;
- }
-
- /**
- *
- */
- CSSCharsetRuleImpl getCSSCharsetRule() {
- CSSCharsetRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSCharsetRule();
- }
- else {
- node = (CSSCharsetRuleImpl) fDocument.createCSSCharsetRule();
- }
- return node;
- }
-
- /**
- *
- */
- CSSFontFaceRuleImpl getCSSFontFaceRule() {
- CSSFontFaceRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSFontFaceRule();
- }
- else {
- node = (CSSFontFaceRuleImpl) fDocument.createCSSFontFaceRule();
- }
- return node;
- }
-
- /**
- *
- */
- CSSImportRuleImpl getCSSImportRule() {
- CSSImportRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSImportRule();
- }
- else {
- node = (CSSImportRuleImpl) fDocument.createCSSImportRule();
- }
- return node;
- }
-
- /**
- *
- */
- CSSMediaRuleImpl getCSSMediaRule() {
- CSSMediaRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSMediaRule();
- }
- else {
- node = (CSSMediaRuleImpl) fDocument.createCSSMediaRule();
- }
- return node;
- }
-
- /**
- *
- */
- CSSPageRuleImpl getCSSPageRule() {
- CSSPageRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSPageRule();
- }
- else {
- node = (CSSPageRuleImpl) fDocument.createCSSPageRule();
- }
- return node;
- }
-
- /**
- *
- */
- CSSStyleRuleImpl getCSSStyleRule() {
- CSSStyleRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSStyleRule();
- }
- else {
- node = (CSSStyleRuleImpl) fDocument.createCSSStyleRule();
- }
- return node;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java
deleted file mode 100644
index c860c508a6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java
+++ /dev/null
@@ -1,1281 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.document.ICSSImportRule;
-import org.eclipse.wst.css.core.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSPageRule;
-import org.eclipse.wst.css.core.document.ICSSRuleContainer;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.text.StructuredDocumentWalker;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.util.CSSUtil;
-import org.eclipse.wst.sse.core.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.CoreNodeList;
-import org.eclipse.wst.sse.core.internal.text.TextRegionListImpl;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-import org.eclipse.wst.sse.core.util.Assert;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-
-/**
- *
- */
-class CSSModelParser {
-
- private CSSDocumentImpl fDocument = null;
- private CSSModelCreationContext fCreationContext = null;
- private CSSModelDeletionContext fDeletionContext = null;
- private CSSModelUpdateContext fUpdateContext = null;
- private CSSModelNodeFeeder fFeeder = null;
- private StructuredDocumentWalker fStructuredDocumentWalker = null;
- private boolean fParseFloating = false;
-
- /**
- * CSSModelParser constructor comment.
- */
- private CSSModelParser() {
- super();
- }
-
- /**
- *
- */
- CSSModelParser(CSSDocumentImpl doc) {
- super();
- fDocument = doc;
- fCreationContext = new CSSModelCreationContext(doc);
- fDeletionContext = new CSSModelDeletionContext(doc);
- fUpdateContext = new CSSModelUpdateContext();
- fFeeder = new CSSModelNodeFeeder(doc, fUpdateContext);
- }
-
- /**
- *
- */
- void changeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- replaceStructuredDocumentRegions(new CoreNodeList(flatNode, flatNode), new CoreNodeList(flatNode, flatNode));
- }
-
- /**
- *
- */
- void changeRegion(IStructuredDocumentRegion flatNode, ITextRegion region) {
- if (flatNode == null || region == null) {
- return;
- }
- if (fDocument == null) {
- return;
- }
-
- changeStructuredDocumentRegion(flatNode);
- }
-
- /**
- *
- */
- private void checkNextNode(IStructuredDocumentRegion flatNode, String type) {
- IStructuredDocumentRegion next = CSSUtil.findNextSignificantNode(flatNode);
- if (CSSUtil.getStructuredDocumentRegionType(next) == type) {
- fCreationContext.setReparseStart(flatNode.getEnd());
- fCreationContext.setReparseEnd(next.getEnd());
- }
- }
-
- /**
- *
- */
- private void cleanupDeletionContext() {
- // setupDeletionContext(null);
- }
-
- /**
- *
- */
- boolean cleanupFirstNode(IStructuredDocumentRegion firstNode, CSSStructuredDocumentRegionContainer target) {
- if (firstNode == null || target == null) {
- return false;
- }
-
- if (firstNode == target.getFirstStructuredDocumentRegion()) {
- IStructuredDocumentRegion nextNode = fStructuredDocumentWalker.getNextNodeInCurrent(firstNode);
- IStructuredDocumentRegion lastNode = target.getLastStructuredDocumentRegion();
- if (lastNode == null || fStructuredDocumentWalker.isOldNode(lastNode) || nextNode == null || lastNode.getStartOffset() < nextNode.getStartOffset()) {
- target.setRangeStructuredDocumentRegion(null, null);
- }
- else {
- target.setFirstStructuredDocumentRegion(nextNode);
- }
- ICSSNode parent = target.getParentNode();
- if (parent instanceof CSSStructuredDocumentRegionContainer) {
- cleanupFirstNode(firstNode, (CSSStructuredDocumentRegionContainer) parent);
- return true;
- }
- }
-
- return false;
- }
-
- /**
- *
- */
- boolean cleanupLastNode(IStructuredDocumentRegion lastNode, CSSStructuredDocumentRegionContainer target) {
- if (lastNode == null || target == null) {
- return false;
- }
-
- if (lastNode == target.getLastStructuredDocumentRegion()) {
- IStructuredDocumentRegion prevNode = fStructuredDocumentWalker.getPrevNodeInCurrent(lastNode);
- IStructuredDocumentRegion firstNode = target.getFirstStructuredDocumentRegion();
- if (firstNode == null || fStructuredDocumentWalker.isOldNode(firstNode) || prevNode == null || prevNode.getStartOffset() < firstNode.getStartOffset()) {
- target.setRangeStructuredDocumentRegion(null, null);
- }
- else {
- target.setLastStructuredDocumentRegion(prevNode);
- }
- ICSSNode parent = target.getParentNode();
- if (parent instanceof CSSStructuredDocumentRegionContainer) {
- cleanupLastNode(lastNode, (CSSStructuredDocumentRegionContainer) parent);
- return true;
- }
- }
-
- return false;
- }
-
- /**
- *
- */
- int cleanupUpdateContext() {
- int remains = fUpdateContext.getNodeCount();
- fUpdateContext.cleanupContext();
- return remains;
- }
-
- /**
- * create floating CSS rule (owner document will be set) this is for
- * CSSStyleSheet.createCSSRule(String)
- *
- * @return org.w3c.dom.css.CSSRule
- * @param flatNodes
- * com.ibm.sed.structuredDocument.IStructuredDocumentRegionList
- */
- CSSRule createCSSRule(IStructuredDocumentRegionList flatNodes) {
- if (flatNodes == null) {
- return null;
- }
-
- fParseFloating = true;
-
- // setup creation context
- fCreationContext.clear();
- fCreationContext.setTargetNode(null);
- fCreationContext.setNextNode(null);
- CSSRuleImpl parentRule = null;
-
- for (Enumeration e = flatNodes.elements(); e.hasMoreElements();) {
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
- if (flatNode == null) {
- continue;
- }
- CSSNodeImpl modified = insertStructuredDocumentRegion(flatNode);
- if (parentRule == null && modified instanceof CSSRuleImpl) {
- parentRule = (CSSRuleImpl) modified;
- }
- }
-
- fParseFloating = false;
-
- if (parentRule != null) {
- CSSModelUtil.cleanupContainer(parentRule);
- }
-
- return parentRule;
- }
-
- /**
- *
- */
- private IStructuredDocumentRegion findBraceClose(int depth, IStructuredDocumentRegion start, boolean bBreakSibling) {
- IStructuredDocumentRegion result = null;
- int braceLevel = 0;
- IStructuredDocumentRegion prevNode = null;
- IStructuredDocumentRegion region = start.getNext();
- for (; region != null; region = region.getNext()) {
- int offset = region.getStart();
- if (offset < 0) {
- Assert.isTrue(false);
- break;
- }
- CSSNodeImpl node = getNodeAt(offset);
- int depthHit = (node != null) ? CSSModelUtil.getDepth(node) : -1;
- if (depth <= depthHit) {
- // sibling is found before "}"
- if (bBreakSibling) {
- CSSNodeImpl parent = (CSSNodeImpl) node.getParentNode();
- while (depth <= CSSModelUtil.getDepth(parent)) {
- node = parent;
- parent = (CSSNodeImpl) parent.getParentNode();
- }
- if (parent != null && node != null) {
- parent.removeChild(node);
- }
- }
- else {
- result = prevNode;
- break;
- }
- }
- String type = CSSUtil.getStructuredDocumentRegionType(region);
- if (type == CSSRegionContexts.CSS_LBRACE) {
- braceLevel++;
- }
- if (type == CSSRegionContexts.CSS_RBRACE) {
- braceLevel--;
- if (braceLevel < 0) {
- result = region;
- break;
- }
- }
- prevNode = region;
- }
-
- if (result == null && region == null) {
- // reach the end of document
- result = prevNode;
- }
-
- return result;
- }
-
- /**
- *
- */
- private IStructuredDocumentRegionList getStructuredDocumentRegionList(int start, int end) {
- IStructuredDocumentRegionList nodeList = null;
- if (0 <= start && start <= end) {
- ICSSModel model = fDocument.getModel();
- if (model instanceof CSSModelImpl) {
- IStructuredDocument structuredDocument = ((CSSModelImpl) model).getStructuredDocument();
- if (structuredDocument != null) {
- IStructuredDocumentRegion startNode = structuredDocument.getRegionAtCharacterOffset(start);
- IStructuredDocumentRegion endNode = structuredDocument.getRegionAtCharacterOffset(end - 1);
- if (startNode != null && endNode != null) {
- nodeList = new CoreNodeList(startNode, endNode);
- }
- }
- }
- }
-
- return nodeList;
- }
-
- /**
- *
- */
- private CSSNodeImpl getNodeAt(int offset) {
- CSSNodeImpl rootNode = fCreationContext.getRootNode();
- ICSSNode target = rootNode.getNodeAt(offset);
- if (target instanceof CSSNodeImpl) {
- return (CSSNodeImpl) target;
- }
- else {
- return null;
- }
- }
-
- /**
- *
- */
- private CSSNodeImpl insertBraceClose(IStructuredDocumentRegion region) {
- ICSSNode target = CSSModelUtil.findBraceContainer(fCreationContext.getTargetNode());
-
- if (!(target instanceof CSSStructuredDocumentRegionContainer)) {
- return null;
- }
-
- CSSStructuredDocumentRegionContainer parent = (CSSStructuredDocumentRegionContainer) target;
- if (CSSModelUtil.isInterruption(parent, region)) {
- ICSSNode node = parent.getParentNode();
- if (node instanceof CSSNodeImpl) {
- fCreationContext.setReparseStart(parent.getStartOffset());
- fCreationContext.setReparseEnd(parent.getEndOffset());
- ((CSSNodeImpl) node).removeChild(parent);
- }
- return null;
- }
-
- if (parent instanceof ICSSPageRule || parent instanceof ICSSMediaRule || parent instanceof CSSFontFaceRule || parent instanceof ICSSStyleRule) {
- CSSModelUtil.expandStructuredDocumentRegionContainer(parent, region);
- if (!CSSModelUtil.isBraceClosed(target)) {
- fCreationContext.setTargetNode(parent.getParentNode());
- fCreationContext.setNextNode(parent.getNextSibling());
- return parent;
- }
- }
-
- return null;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertBraceOpen(IStructuredDocumentRegion region) {
- IStructuredDocumentRegion keyRegion = CSSUtil.findPreviousSignificantNode(region);
- if (keyRegion == null) {
- return null;
- }
- if (!fParseFloating) {
- CSSNodeImpl node = getNodeAt(keyRegion.getStartOffset());
- if (node != null && !(node instanceof ICSSRuleContainer)) {
- return null;
- }
- }
- String type = CSSUtil.getStructuredDocumentRegionType(keyRegion);
-
- CSSNodeImpl inserted = null;
- if (type == CSSRegionContexts.CSS_PAGE) {
- inserted = insertPageRule(keyRegion, region);
- }
- else if (type == CSSRegionContexts.CSS_MEDIA) {
- inserted = insertMediaRule(keyRegion, region);
- }
- else if (type == CSSRegionContexts.CSS_FONT_FACE) {
- inserted = insertFontFaceRule(keyRegion, region);
- }
- else if (CSSUtil.isSelectorText(keyRegion)) {
- inserted = insertStyleRule(keyRegion, region);
- }
-
- if (inserted instanceof CSSStructuredDocumentRegionContainer) {
- // CSSModelUtil.expandStructuredDocumentRegionContainer((CSSStructuredDocumentRegionContainer)inserted,
- // flatNode);
- IStructuredDocumentRegion braceClose = findBraceClose(CSSModelUtil.getDepth(inserted), region, (type == CSSRegionContexts.CSS_MEDIA));
- if (braceClose != null) {
- fCreationContext.setReparseStart(region.getEnd());
- fCreationContext.setReparseEnd(braceClose.getEnd());
- }
- }
-
- return inserted;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertCharsetRule(IStructuredDocumentRegion beginDocRegion, IStructuredDocumentRegion endDocRegion) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- ITextRegionList regions = new TextRegionListImpl(beginDocRegion.getRegions());
- regions.remove(0); // must be "@charset"
- ITextRegion encodingRegion = null;
- while (!regions.isEmpty()) {
- ITextRegion textRegion = regions.remove(0);
- if (textRegion == null) {
- continue;
- }
- String type = textRegion.getType();
- if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
- continue;
- }
- if (type == CSSRegionContexts.CSS_STRING) {
- encodingRegion = textRegion;
- break;
- }
- else {
- break;
- }
- }
- if (encodingRegion == null) {
- return null;
- }
-
- CSSCharsetRuleImpl rule = fFeeder.getCSSCharsetRule();
- if (rule == null) {
- return null;
- }
-
- if (!fUpdateContext.isActive()) {
- rule.setAttribute(ICSSCharsetRule.ENCODING, beginDocRegion.getText(encodingRegion));
- }
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(beginDocRegion, endDocRegion);
- CSSAttrImpl attr = rule.getAttributeNode(ICSSCharsetRule.ENCODING);
- if (attr != null) {
- attr.setRangeRegion(beginDocRegion, encodingRegion, encodingRegion);
- }
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- return rule;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertStructuredDocumentRegion(IStructuredDocumentRegion region) {
- if (fCreationContext == null || region == null) {
- return null;
- }
-
- String type = ((BasicStructuredDocumentRegion) region).getType();
- CSSNodeImpl modified = null;
-
- ICSSNode target = fCreationContext.getTargetNode();
-
- if ((fParseFloating && target == null) || target instanceof ICSSRuleContainer) {
- if (type == CSSRegionContexts.CSS_DELIMITER) {
- modified = insertSemiColonForRule(region);
- }
- else if (type == CSSRegionContexts.CSS_LBRACE) {
- modified = insertBraceOpen(region);
- }
- else if (type == CSSRegionContexts.CSS_RBRACE) {
- modified = insertBraceClose(region);
- }
- else if (type == CSSRegionContexts.CSS_MEDIA || type == CSSRegionContexts.CSS_PAGE || type == CSSRegionContexts.CSS_FONT_FACE || CSSUtil.isSelectorText(region)) {
- checkNextNode(region, CSSRegionContexts.CSS_LBRACE);
- }
- else if (type == CSSRegionContexts.CSS_IMPORT || type == CSSRegionContexts.CSS_CHARSET) {
- checkNextNode(region, CSSRegionContexts.CSS_DELIMITER);
- }
- }
- else if ((target instanceof CSSRuleDeclContainer || target instanceof CSSStyleDeclaration) && type == CSSRegionContexts.CSS_DECLARATION_PROPERTY) {
- modified = insertStyleDeclarationItem(region);
- }
- else if (target instanceof ICSSStyleDeclItem && type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- modified = insertSemiColonForStyleDeclarationItem(region);
- }
- else if (type == CSSRegionContexts.CSS_RBRACE) {
- modified = insertBraceClose(region);
- }
-
- // post process
- if (modified != null) {
- if (modified instanceof CSSStructuredDocumentRegionContainer) {
- ((CSSStructuredDocumentRegionContainer) modified).propagateRangeStructuredDocumentRegion();
- }
- }
-
- return modified;
- }
-
- /**
- *
- */
- private void insertStructuredDocumentRegions(IStructuredDocumentRegionList regionList) {
- for (Enumeration e = regionList.elements(); e.hasMoreElements();) {
- IStructuredDocumentRegion region = (IStructuredDocumentRegion) e.nextElement();
- if (region == null) {
- continue;
- }
- insertStructuredDocumentRegion(region);
- if (fCreationContext.isToReparse()) {
- int origStart = region.getEnd();
- int origEnd = regionList.item(regionList.getLength() - 1).getEnd();
- int newStart = fCreationContext.getReparseStart();
- int newEnd = fCreationContext.getReparseEnd();
- if (newStart < origStart || origEnd < newEnd) {
- IStructuredDocumentRegionList newNodeList = getStructuredDocumentRegionList(newStart, newEnd);
- setupCreationContext(newNodeList.item(0));
- insertStructuredDocumentRegions(newNodeList);
- return;
- }
- else {
- fCreationContext.resetReparseRange();
- }
- }
- }
- }
-
- /**
- *
- */
- private CSSNodeImpl insertFontFaceRule(IStructuredDocumentRegion region, IStructuredDocumentRegion braceNode) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- CSSFontFaceRuleImpl rule = fFeeder.getCSSFontFaceRule();
- if (rule == null) {
- return null;
- }
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(region, braceNode);
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- fCreationContext.setTargetNode(rule);
- // TargetNext is set to null automatically
-
- return rule;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertImportRule(IStructuredDocumentRegion beginDocRegion, IStructuredDocumentRegion endDocRegion) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- ITextRegionList regions = new TextRegionListImpl(beginDocRegion.getRegions());
- regions.remove(0); // must be "@import"
- ITextRegion hrefRegion = null;
- while (!regions.isEmpty()) {
- ITextRegion textRegion = regions.remove(0);
- if (textRegion == null) {
- continue;
- }
- String type = textRegion.getType();
- if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
- continue;
- }
- if (type == CSSRegionContexts.CSS_URI || type == CSSRegionContexts.CSS_STRING) {
- hrefRegion = textRegion;
- break;
- }
- else {
- break;
- }
- }
- if (hrefRegion == null) {
- return null;
- }
-
- CSSImportRuleImpl rule = fFeeder.getCSSImportRule();
- if (rule == null) {
- return null;
- }
-
- CSSUtil.stripSurroundingSpace(regions);
- MediaListImpl mediaList = (MediaListImpl) rule.getMedia();
- setMediaList(mediaList, beginDocRegion, regions);
-
- if (!fUpdateContext.isActive()) {
- rule.setAttribute(ICSSImportRule.HREF, beginDocRegion.getText(hrefRegion));
- }
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(beginDocRegion, endDocRegion);
- CSSAttrImpl attr = rule.getAttributeNode(ICSSImportRule.HREF);
- if (attr != null) {
- attr.setRangeRegion(beginDocRegion, hrefRegion, hrefRegion);
- }
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- return rule;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertMediaRule(IStructuredDocumentRegion flatNode, IStructuredDocumentRegion braceNode) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- CSSMediaRuleImpl rule = fFeeder.getCSSMediaRule();
- if (rule == null) {
- return null;
- }
-
- ITextRegionList regions = new TextRegionListImpl(flatNode.getRegions());
- regions.remove(0); // must be "@media"
-
- CSSUtil.stripSurroundingSpace(regions);
- MediaListImpl mediaList = (MediaListImpl) rule.getMedia();
- setMediaList(mediaList, flatNode, regions);
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(flatNode, braceNode);
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- fCreationContext.setTargetNode(rule);
- // TargetNext is set to null automatically
-
- return rule;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertPageRule(IStructuredDocumentRegion flatNode, IStructuredDocumentRegion braceNode) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- // get selector regions
- ITextRegionList selectorRegions = new TextRegionListImpl(flatNode.getRegions());
- selectorRegions.remove(0); // must be "@page"
- CSSUtil.stripSurroundingSpace(selectorRegions);
-
- CSSPageRuleImpl rule = fFeeder.getCSSPageRule();
- if (rule == null) {
- return null;
- }
-
- if (!fUpdateContext.isActive()) {
- String selectorStr = CSSUtil.getRegionText(flatNode, selectorRegions);
- if (0 < selectorStr.length()) {
- rule.setSelectorText(selectorStr);
- }
- }
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(flatNode, braceNode);
- CSSAttrImpl attr = rule.getAttributeNode(ICSSPageRule.SELECTOR);
- if (attr != null && selectorRegions != null && !selectorRegions.isEmpty()) {
- attr.setRangeRegion(flatNode, selectorRegions.get(0), selectorRegions.get(selectorRegions.size() - 1));
- }
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- fCreationContext.setTargetNode(rule);
- // TargetNext is set to null automatically
-
- return rule;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertSemiColonForRule(IStructuredDocumentRegion region) {
- IStructuredDocumentRegion keyRegion = CSSUtil.findPreviousSignificantNode(region);
- String type = CSSUtil.getStructuredDocumentRegionType(keyRegion);
-
- CSSNodeImpl inserted = null;
- if (type == CSSRegionContexts.CSS_IMPORT) {
- inserted = insertImportRule(keyRegion, region);
- }
- else if (type == CSSRegionContexts.CSS_CHARSET) {
- inserted = insertCharsetRule(keyRegion, region);
- }
-
- return inserted;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertSemiColonForStyleDeclarationItem(IStructuredDocumentRegion region) {
- // only target/net node is changed. nothing to do.
-
- CSSNodeImpl targetNode = fCreationContext.getTargetNode();
- if (targetNode instanceof ICSSStyleDeclItem) {
- int offset = targetNode.getStartOffset();
- // widen document region range
- // ((CSSStyleDeclItemImpl)targetNode).setLastStructuredDocumentRegion(region);
- CSSModelUtil.expandStructuredDocumentRegionContainer((CSSStyleDeclItemImpl) targetNode, region);
- // psStructuredDocumentRegion indicates CSSStyleDeclItem
- ICSSNode parentNode = targetNode.getParentNode();
- fCreationContext.setTargetNode(parentNode);
- ICSSNode next = null;
- if (parentNode.hasChildNodes()) {
- for (ICSSNode child = targetNode.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child instanceof CSSStructuredDocumentRegionContainer && offset < ((CSSStructuredDocumentRegionContainer) child).getStartOffset()) {
- next = child;
- break;
- }
- }
- }
- fCreationContext.setNextNode(next);
-
- return targetNode;
- }
-
- return null;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertStyleDeclarationItem(IStructuredDocumentRegion docRegion) {
- CSSStyleDeclarationImpl parent = null;
- CSSNodeImpl node = fCreationContext.getTargetNode();
- if (node instanceof CSSRuleDeclContainer) {
- CSSRuleDeclContainer declContainer = (CSSRuleDeclContainer) node;
- parent = (CSSStyleDeclarationImpl) declContainer.getStyle();
- }
- else if (node instanceof CSSStyleDeclarationImpl) {
- parent = (CSSStyleDeclarationImpl) node;
- }
-
- CSSDeclarationItemParser itemParser = new CSSDeclarationItemParser(parent.getOwnerDocument());
- itemParser.setStructuredDocumentTemporary(false);
- itemParser.setUpdateContext(fUpdateContext);
- CSSStyleDeclItemImpl declItem = itemParser.setupDeclarationItem(docRegion);
- if (declItem == null) {
- return null;
- }
-
- // setup flat container
- declItem.setRangeStructuredDocumentRegion(docRegion, docRegion);
-
- // insert to tree
- if (!fUpdateContext.isActive()) {
- propagateRangePreInsert(parent, declItem);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(declItem, next);
- }
- else {
- parent.appendChild(declItem);
- }
- }
-
- fCreationContext.setTargetNode(declItem);
- // TargetNext is set to null automatically
-
- return declItem;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertStyleRule(IStructuredDocumentRegion flatNode, IStructuredDocumentRegion braceNode) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- // get selector regions
- ITextRegionList selectorRegions = new TextRegionListImpl(flatNode.getRegions());
- CSSUtil.stripSurroundingSpace(selectorRegions);
-
- CSSStyleRuleImpl rule = fFeeder.getCSSStyleRule();
- if (rule == null) {
- return null;
- }
-
- if (!fUpdateContext.isActive()) {
- String selectorStr = CSSUtil.getRegionText(flatNode, selectorRegions);
- if (selectorStr != null && 0 < selectorStr.length()) {
- rule.setSelectorText(selectorStr);
- }
- }
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(flatNode, braceNode);
- CSSAttrImpl attr = rule.getAttributeNode(ICSSPageRule.SELECTOR);
- if (attr != null && selectorRegions != null && !selectorRegions.isEmpty()) {
- attr.setRangeRegion(flatNode, selectorRegions.get(0), selectorRegions.get(selectorRegions.size() - 1));
- }
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- fCreationContext.setTargetNode(rule);
- // TargetNext is set to null automatically
-
- return rule;
- }
-
- /**
- *
- */
- private void pretendRemoveNode() {
- CSSStructuredDocumentRegionContainer node = (CSSStructuredDocumentRegionContainer) fUpdateContext.getDeletionTarget();
- if (node == null) {
- return;
- }
-
- IStructuredDocumentRegion firstNode = node.getFirstStructuredDocumentRegion();
- if (firstNode != null) {
- fDeletionContext.expandRemovedRangeBegin(firstNode);
- }
- IStructuredDocumentRegion lastNode = node.getLastStructuredDocumentRegion();
- if (lastNode != null) {
- fDeletionContext.expandRemovedRangeEnd(lastNode);
- }
-
- shrinkContainer((CSSStructuredDocumentRegionContainer) fUpdateContext.getDeletionTargetParent(), node);
- }
-
- /**
- * @param parent
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param child
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private void propagateRangePreInsert(CSSNodeImpl parent, CSSNodeImpl child) {
- if (!(child instanceof CSSStructuredDocumentRegionContainer) || !(parent instanceof CSSStructuredDocumentRegionContainer)) {
- return;
- }
-
- CSSStructuredDocumentRegionContainer parentContainer = (CSSStructuredDocumentRegionContainer) parent;
- CSSStructuredDocumentRegionContainer childContainer = (CSSStructuredDocumentRegionContainer) child;
- IStructuredDocumentRegion firstNode = childContainer.getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion lastNode = childContainer.getLastStructuredDocumentRegion();
- if (firstNode == null || lastNode == null) {
- return;
- }
-
- boolean bModified = parentContainer.includeRangeStructuredDocumentRegion(firstNode, lastNode);
- if (bModified) {
- parentContainer.propagateRangeStructuredDocumentRegion();
- }
- }
-
- /**
- *
- */
- private void removeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
- if (type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- do {
- flatNode = fStructuredDocumentWalker.getPrevNode(flatNode);
- type = (flatNode != null) ? CSSUtil.getStructuredDocumentRegionType(flatNode) : null;
- }
- while (type != null && (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT));
- }
- if (flatNode == null) {
- return;
- }
-
- // if (fDeletionContext.isInRemovedRange(flatNode)) { // already
- // removed
- // return;
- // }
-
- CSSStructuredDocumentRegionContainer node = fDeletionContext.findDeletionTarget(fDocument, flatNode);
- if (node == null || node == fDocument) {
- return; // not attached with any treeNode
- }
-
- if (node instanceof CSSStyleDeclarationImpl) {
- ICSSNode rule = node.getParentNode();
- if (rule instanceof CSSStyleRuleImpl) {
- node = (CSSStructuredDocumentRegionContainer) rule;
- }
- else {
- return;
- }
- }
-
- // ICSSNode p = node.getParentNode();
- // if (p == null || ! (p instanceof
- // CSSStructuredDocumentRegionContainer)) {
- // return;
- // }
- // CSSStructuredDocumentRegionContainer parent =
- // (CSSStructuredDocumentRegionContainer)p;
-
- if (fDeletionContext.addNodeToBeRemoved(node)) {
- IStructuredDocumentRegion firstNode = node.getFirstStructuredDocumentRegion();
- if (firstNode != null) {
- fDeletionContext.expandRemovedRangeBegin(firstNode);
- }
- IStructuredDocumentRegion lastNode = node.getLastStructuredDocumentRegion();
- if (lastNode != null) {
- fDeletionContext.expandRemovedRangeEnd(lastNode);
- }
- }
-
- // shrinkContainer(node);
- // parent.removeChild(node);
- }
-
- /**
- *
- */
- private void removeStructuredDocumentRegions(IStructuredDocumentRegionList flatNodes) {
- for (Enumeration e = flatNodes.elements(); e.hasMoreElements();) {
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
- if (flatNode == null) {
- continue;
- }
- removeStructuredDocumentRegion(flatNode);
- }
-
- Iterator i = fDeletionContext.getNodesToBeRemoved();
- while (i.hasNext()) {
- CSSNodeImpl node = (CSSNodeImpl) i.next();
- if (!(node instanceof CSSStructuredDocumentRegionContainer)) {
- continue;
- }
- CSSNodeImpl parent = (CSSNodeImpl) node.getParentNode();
- if (!(parent instanceof CSSStructuredDocumentRegionContainer)) {
- continue;
- }
- shrinkContainer((CSSStructuredDocumentRegionContainer) parent, (CSSStructuredDocumentRegionContainer) node);
- parent.removeChild(node);
- }
- }
-
- /**
- *
- */
- void replaceStructuredDocumentRegions(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
- if (fDocument == null || fCreationContext == null) {
- return;
- }
-
- if (oldStructuredDocumentRegions != null && 0 < oldStructuredDocumentRegions.getLength()) {
- setupDeletionContext(newStructuredDocumentRegions, oldStructuredDocumentRegions);
- short updateMode = fUpdateContext.getUpdateMode();
- if (updateMode == CSSModelUpdateContext.UPDATE_IDLE) {
- removeStructuredDocumentRegions(oldStructuredDocumentRegions);
- }
- else {
- pretendRemoveNode();
- }
- newStructuredDocumentRegions = getStructuredDocumentRegionList(fDeletionContext.getRemovedRangeBegin(), fDeletionContext.getRemovedRangeEnd());
- cleanupDeletionContext();
- }
-
- if (newStructuredDocumentRegions != null && 0 < newStructuredDocumentRegions.getLength()) {
- setupCreationContext(newStructuredDocumentRegions.item(0));
- insertStructuredDocumentRegions(newStructuredDocumentRegions);
- }
-
- // make document hold whole structuredDocument
- /*
- * boolean bUpdate = false; IStructuredDocumentRegion flatNode;
- * flatNode = fDocument.getFirstStructuredDocumentRegion(); bUpdate =
- * bUpdate || (flatNode == null ||
- * fStructuredDocumentWalker.isOldNode(flatNode) ||
- * flatNode.getPrevious() != null); flatNode =
- * fDocument.getLastStructuredDocumentRegion(); bUpdate = bUpdate ||
- * (flatNode == null || fStructuredDocumentWalker.isOldNode(flatNode) ||
- * flatNode.getNext() != null);
- */
- IStructuredDocument structuredDocument = fStructuredDocumentWalker.getStructuredDocument();
- fDocument.setRangeStructuredDocumentRegion(structuredDocument.getFirstStructuredDocumentRegion(), structuredDocument.getLastStructuredDocumentRegion());
- /* } */
-
- // remove in official release
- // CSSModelUtil.diagnoseTree(fDocument,
- // fStructuredDocumentWalker.getStructuredDocument());
- }
-
- /**
- *
- */
- void replaceRegions(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
- if (flatNode == null) {
- return;
- }
- if (newRegions == null || oldRegions == null) {
- return;
- }
- if (fDocument == null) {
- return;
- }
-
- changeStructuredDocumentRegion(flatNode);
- }
-
- /**
- */
- private void resetCreationTarget(IStructuredDocumentRegion newStructuredDocumentRegion) {
- if (newStructuredDocumentRegion == null || newStructuredDocumentRegion.getStartOffset() <= 0) {
- // top of document
- fCreationContext.setTargetNode(fDocument);
- fCreationContext.setNextNode(fDocument.getFirstChild());
- return;
- }
-
- int cursorPos = newStructuredDocumentRegion.getStartOffset();
- CSSNodeImpl cursorNode = getNodeAt(cursorPos);
- if (cursorNode == null) { // end of document
- cursorNode = fDocument;
- }
-
- // find edge of tree node
- CSSNodeImpl node = null;
- // boolean bOverSemiColon = false;
- boolean bOverOpenBrace = false;
- IStructuredDocumentRegion flatNode;
- for (flatNode = newStructuredDocumentRegion; flatNode != null; flatNode = flatNode.getPrevious()) {
- node = getNodeAt(flatNode.getStartOffset());
- if (node == null) {
- node = fDocument;
- }
- if (node != cursorNode || node.getStartOffset() == flatNode.getStartOffset()) {
- break;
- }
- if (flatNode != newStructuredDocumentRegion) {
- String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
- // if (type == CSSRegionContexts.CSS_DELIMITER ||
- // type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- // bOverSemiColon = true;
- // } else
- if (type == CSSRegionContexts.CSS_LBRACE) {
- bOverOpenBrace = true;
- }
- }
- }
-
- CSSNodeImpl targetNode = null;
-
- // if (flatNode == null) {
- // v<--|
- // AAAAAA
- // BBBBBBBBBB cursorNode:A , node:B -> target is A
- // targetNode = (node == null) ? fDocument : node;
- // } else
- if (cursorNode == node) {
- // v<--|
- // AAAAAA
- // BBBBBBBBBB cursorNode:A , node:B -> target is A
- if (bOverOpenBrace && cursorNode instanceof CSSRuleDeclContainer) {
- targetNode = (CSSNodeImpl) ((CSSRuleDeclContainer) cursorNode).getStyle();
- }
- else {
- targetNode = cursorNode;
- }
- }
- else {
- // v<--|
- // AAA
- // BBBBBBBBBB cursorNode:B , node:A -> depend on A's node type
- short nodeType = node.getNodeType();
- if (nodeType == ICSSNode.STYLEDECLITEM_NODE || nodeType == ICSSNode.CHARSETRULE_NODE || nodeType == ICSSNode.IMPORTRULE_NODE) {
- // targetNode = (CSSNodeImpl)((bOverSemiColon) ?
- // node.getParentNode() : node); // NP
- String regionType = CSSUtil.getStructuredDocumentRegionType(flatNode);
- if (regionType == CSSRegionContexts.CSS_DELIMITER || regionType == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- targetNode = (CSSNodeImpl) node.getParentNode();
- }
- else {
- targetNode = node;
- }
- }
- else if (CSSUtil.getStructuredDocumentRegionType(flatNode) == CSSRegionContexts.CSS_RBRACE) {
- targetNode = (CSSNodeImpl) node.getParentNode();
- }
- else {
- targetNode = node;
- }
- }
-
- fCreationContext.setTargetNode(targetNode);
- ICSSNode next = null;
- if (targetNode.hasChildNodes()) {
- for (ICSSNode child = targetNode.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child instanceof CSSStructuredDocumentRegionContainer && cursorPos < ((CSSStructuredDocumentRegionContainer) child).getStartOffset()) {
- next = child;
- break;
- }
- }
- }
- fCreationContext.setNextNode(next);
-
- }
-
- /**
- */
- private void resetReparseRange() {
- fCreationContext.clear();
- }
-
- /**
- * @param event
- * com.ibm.sed.structuredDocument.events.StructuredDocumentEvent
- */
- void setStructuredDocumentEvent(StructuredDocumentEvent event) {
- if (fStructuredDocumentWalker == null) {
- fStructuredDocumentWalker = new StructuredDocumentWalker();
- }
- fStructuredDocumentWalker.initialize(event);
- }
-
- /**
- * regions: surrounding spaces should be removed. Q. Why did you set
- * mediaTable ? A. MediaList may have two or more medium that have same
- * value, then searcing in MediaList is not perfect. Q.
- * fUpdateContext.isActive() is not care. Are you OK? A. OK.
- */
- private void setMediaList(MediaListImpl mediaList, IStructuredDocumentRegion region, ITextRegionList textRegions) {
- if (mediaList == null || textRegions == null) {
- return;
- }
- Collection mediaTable = new HashSet();
- CSSNodeListImpl attrs = mediaList.getMedia();
- for (int i = 0; i != attrs.getLength(); i++) {
- mediaTable.add(attrs.item(i));
- }
-
- ITextRegion start = null;
- ITextRegion end = null;
-
- Iterator i = textRegions.iterator();
- ITextRegion textRegion = (ITextRegion) ((i.hasNext()) ? i.next() : null);
- while (textRegion != null) {
- if (textRegion.getType() == CSSRegionContexts.CSS_MEDIUM) {
- String mediumStr = region.getText(textRegion);
- if (0 < mediumStr.length()) {
- CSSAttrImpl attr = null;
- // is the medium already set ?
- Iterator iTable = mediaTable.iterator();
- while (iTable.hasNext()) {
- CSSAttrImpl cai = (CSSAttrImpl) iTable.next();
- if (mediumStr.equalsIgnoreCase(cai.getValue())) {
- attr = cai;
- mediaTable.remove(cai);
- break;
- }
- }
- if (attr == null) {
- // is not set. create new attribute
- String key = "mediumP" + mediaList.mediumCounter++; //$NON-NLS-1$
- mediaList.setAttribute(key, mediumStr);
- attr = mediaList.getAttributeNode(key);
- }
- attr.setRangeRegion(region, textRegion, textRegion);
- if (start == null) {
- start = textRegion;
- }
- end = textRegion;
- }
- }
- textRegion = (ITextRegion) ((i.hasNext()) ? i.next() : null);
- }
-
- if (start != null && end != null) {
- mediaList.setRangeRegion(region, start, end);
- }
- }
-
- /**
- *
- */
- private void setupCreationContext(IStructuredDocumentRegion region) {
- resetReparseRange();
- resetCreationTarget(region);
- }
-
- /**
- *
- */
- private void setupDeletionContext(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
- fDeletionContext.setupContext(newStructuredDocumentRegions, oldStructuredDocumentRegions);
- }
-
- /**
- *
- */
- void setupUpdateContext(short updateMode, ICSSNode parentNode, ICSSNode targetNode) {
- fUpdateContext.setupContext(updateMode, parentNode, targetNode);
- }
-
- /**
- *
- */
- void shrinkContainer(CSSStructuredDocumentRegionContainer parent, CSSStructuredDocumentRegionContainer child) {
- if (child == null) {
- return;
- }
-
- boolean bModified = false;
- bModified = bModified || cleanupLastNode(child.getLastStructuredDocumentRegion(), parent);
- bModified = bModified || cleanupFirstNode(child.getFirstStructuredDocumentRegion(), parent);
-
- if (bModified) {
- if (parent != null) {
- for (ICSSNode node = parent.getFirstChild(); node != null; node = node.getNextSibling()) {
- if (child != node && node instanceof CSSStructuredDocumentRegionContainer) {
- ((CSSStructuredDocumentRegionContainer) node).propagateRangeStructuredDocumentRegion();
- }
- }
- }
- }
-
- child.setRangeStructuredDocumentRegion(null, null);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java
deleted file mode 100644
index 31018fa4e7..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.LinkedList;
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.util.AbstractCssTraverser;
-import org.eclipse.wst.css.core.util.CSSUtil;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- *
- */
-class CSSModelUpdateContext {
-
-
- class CSSNodeUpdateTraverser extends AbstractCssTraverser {
- public CSSNodeUpdateTraverser() {
- super();
- setTraverseImported(false);
- setTraverseImportFirst(false);
- }
-
- public LinkedList getNodeList() {
- return fTravNodeList;
- }
-
- protected void begin(ICSSNode node) {
- fTravNodeList = new LinkedList();
- }
-
- protected short preNode(ICSSNode node) {
- if (node instanceof CSSStyleDeclarationImpl || node instanceof CSSAttrImpl || node instanceof MediaListImpl) {
- // skip
- }
- else {
- fTravNodeList.add(node);
- }
- if (node instanceof CSSPrimitiveContainer) {
- return TRAV_PRUNE;
- }
- else {
- return TRAV_CONT;
- }
- }
-
- LinkedList fTravNodeList = null;
- }
-
- ICSSNode fLastNode = null;
- ICSSNode fDeletionTargetParent = null;
- ICSSNode fDeletionTarget = null;
- LinkedList fNodeList = null;
- private short fUpdateMode = UPDATE_IDLE;
- static final short UPDATE_IDLE = 0;
- static final short UPDATE_INSERT_FNCONTAINER = 1;
- static final short UPDATE_INSERT_RCONTAINER = 2;
- static final short UPDATE_REMOVE_FNCONTAINER = 3;
- static final short UPDATE_REMOVE_RCONTAINER = 4;
- static final short UPDATE_CHANGE_RCONTAINER = 5;
-
- /**
- * CSSNodeUpdateQueue constructor comment.
- */
- CSSModelUpdateContext() {
- super();
- }
-
- /**
- *
- */
- void cleanupContext() {
- fNodeList = null;
- fDeletionTarget = null;
- fDeletionTargetParent = null;
- fUpdateMode = UPDATE_IDLE;
- }
-
- /**
- *
- */
- CounterImpl getCounter() {
- ICSSNode node = getNode();
- if (node instanceof CounterImpl) {
- return (CounterImpl) node;
- }
- else {
- CSSUtil.debugOut("CounterImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSCharsetRuleImpl getCSSCharsetRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSCharsetRuleImpl) {
- return (CSSCharsetRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSCharsetRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSFontFaceRuleImpl getCSSFontFaceRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSFontFaceRuleImpl) {
- return (CSSFontFaceRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSFontFaceRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSImportRuleImpl getCSSImportRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSImportRuleImpl) {
- return (CSSImportRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSImportRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSMediaRuleImpl getCSSMediaRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSMediaRuleImpl) {
- return (CSSMediaRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSMediaRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSPageRuleImpl getCSSPageRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSPageRuleImpl) {
- return (CSSPageRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSPageRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSPrimitiveValueImpl getCSSPrimitiveValue(short type) {
- ICSSNode node = getNode();
- if (node instanceof CSSPrimitiveValueImpl) {
- short nodeType = ((CSSPrimitiveValueImpl) node).getPrimitiveType();
- if (nodeType == type || ((nodeType == CSSPrimitiveValue.CSS_NUMBER || nodeType == ICSSPrimitiveValue.CSS_INTEGER) && (type == CSSPrimitiveValue.CSS_NUMBER || type == ICSSPrimitiveValue.CSS_INTEGER))) {
- return (CSSPrimitiveValueImpl) node;
- }
- }
-
- if (node instanceof CSSPrimitiveValueImpl) {
- CSSPrimitiveValueImpl value = (CSSPrimitiveValueImpl) node;
- CSSUtil.debugOut("CSSPrimitiveValueImpl [" + type + //$NON-NLS-1$
- "] is expected, but type is [" + //$NON-NLS-1$
- value.getPrimitiveType() + "]: \"" + value.generateSource() + "\"");//$NON-NLS-2$//$NON-NLS-1$
- }
- else {
- CSSUtil.debugOut("CSSPrimitiveValueImpl(" + type + //$NON-NLS-1$
- ") is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- }
-
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
-
- /**
- *
- */
- CSSPrimitiveValueImpl getCSSPrimitiveValueAny() {
- ICSSNode node = getNode();
- if (node instanceof CSSPrimitiveValueImpl) {
- return (CSSPrimitiveValueImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSPrimitiveValueImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSStyleDeclItemImpl getCSSStyleDeclItem(String propertyName) {
- ICSSNode node = getNode();
- if (node instanceof CSSStyleDeclItemImpl && ((CSSStyleDeclItemImpl) node).getPropertyName().equalsIgnoreCase(propertyName)) {
- return (CSSStyleDeclItemImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSStyleDeclItemImpl(" + propertyName + //$NON-NLS-1$
- ") is expected, but " + CSSUtil.getClassString(node));//$NON-NLS-1$
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSStyleRuleImpl getCSSStyleRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSStyleRuleImpl) {
- return (CSSStyleRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSStyleRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- ICSSNode getDeletionTarget() {
- return fDeletionTarget;
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- ICSSNode getDeletionTargetParent() {
- return fDeletionTargetParent;
- }
-
- /**
- *
- */
- private ICSSNode getNode() {
- ICSSNode node = null;
- if (fNodeList != null && 0 < fNodeList.size()) {
- node = (ICSSNode) fNodeList.removeFirst();
- }
- fLastNode = node;
- return node;
- }
-
- /**
- *
- */
- int getNodeCount() {
- if (fNodeList != null) {
- return fNodeList.size();
- }
- else {
- return -1;
- }
- }
-
- /**
- *
- */
- // ICSSNode getParentNode() {
- // return fParentNode;
- // }
- /**
- *
- */
- RectImpl getRect() {
- ICSSNode node = getNode();
- if (node instanceof RectImpl) {
- return (RectImpl) node;
- }
- else {
- CSSUtil.debugOut("RectImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- RGBColorImpl getRGBColor() {
- ICSSNode node = getNode();
- if (node instanceof RGBColorImpl) {
- return (RGBColorImpl) node;
- }
- else {
- CSSUtil.debugOut("RGBColorImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * @return short
- */
- short getUpdateMode() {
- return fUpdateMode;
- }
-
- /**
- *
- */
- boolean isActive() {
- return (fNodeList != null);
- }
-
- /**
- *
- */
- void setupContext(short updateMode, ICSSNode parentNode, ICSSNode targetNode) {
- fUpdateMode = updateMode;
-
- ICSSNode traverseRoot;
- if (updateMode == UPDATE_REMOVE_RCONTAINER || updateMode == UPDATE_INSERT_RCONTAINER || updateMode == UPDATE_CHANGE_RCONTAINER) {
- traverseRoot = parentNode;
- while (traverseRoot instanceof CSSRegionContainer) {
- traverseRoot = traverseRoot.getParentNode();
- }
- }
- else {
- traverseRoot = targetNode;
- }
-
- if (updateMode == UPDATE_REMOVE_RCONTAINER || updateMode == UPDATE_INSERT_RCONTAINER || // region
- // insert
- // =>
- // replace
- // flat
- // node
- updateMode == UPDATE_CHANGE_RCONTAINER || updateMode == UPDATE_REMOVE_FNCONTAINER) {
- fDeletionTarget = traverseRoot;
- if (fDeletionTarget == targetNode) {
- fDeletionTargetParent = parentNode;
- }
- else {
- fDeletionTargetParent = fDeletionTarget.getParentNode();
- }
- }
- else {
- fDeletionTarget = null;
- fDeletionTargetParent = null;
- }
-
- if (updateMode == UPDATE_INSERT_RCONTAINER || updateMode == UPDATE_INSERT_FNCONTAINER || updateMode == UPDATE_REMOVE_RCONTAINER || // region
- // remove
- // =>
- // re-insert
- // flat
- // node
- updateMode == UPDATE_CHANGE_RCONTAINER) {
- CSSNodeUpdateTraverser traverser = new CSSNodeUpdateTraverser();
- traverser.apply(traverseRoot);
- fNodeList = traverser.getNodeList();
- }
- else {
- fNodeList = null;
- }
- }
-
- /**
- *
- */
- private void ungetNode() {
- if (fNodeList != null && fLastNode != null) {
- fNodeList.addFirst(fLastNode);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java
deleted file mode 100644
index b8e740bb6f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java
+++ /dev/null
@@ -1,583 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSAttr;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.formatter.AttrChangeContext;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceGenerator;
-import org.eclipse.wst.css.core.util.CSSUtil;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.w3c.dom.DOMException;
-
-
-/**
- *
- */
-class CSSModelUpdater {
-
- private CSSModelImpl fModel = null;
- private CSSModelParser fParser = null;
-
- /**
- * CSSModelUpdater constructor comment.
- */
- CSSModelUpdater() {
- super();
- }
-
- /**
- *
- */
- CSSModelUpdater(CSSModelImpl model) {
- super();
- fModel = model;
- }
-
- /**
- * @param parentNode
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private void attrInserted(CSSNodeImpl parentNode, CSSAttrImpl attr) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(parentNode);
-
- if (formatter == null) {
- CSSUtil.debugOut("Cannot get format adapter : " + parentNode.getClass().toString());//$NON-NLS-1$
- return;
- }
-
- short updateMode = CSSModelUpdateContext.UPDATE_INSERT_RCONTAINER;
- fParser.setupUpdateContext(updateMode, parentNode, attr);
-
- // get formatted info
- AttrChangeContext region = new AttrChangeContext();
- String text = new String(formatter.formatAttrChanged(parentNode, attr, true, region));
-
- // set text
- StructuredDocumentEvent result = insertText(region.start, region.end - region.start, text);
-
- int nRemains = fParser.cleanupUpdateContext();
-
- if (0 < nRemains && !(result instanceof NoChangeEvent)) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * @param parentNode
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private void attrRemoved(CSSNodeImpl parentNode, CSSAttrImpl attr) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(parentNode);
-
- if (formatter == null) {
- CSSUtil.debugOut("Cannot get format adapter : " + parentNode.getClass().toString());//$NON-NLS-1$
- return;
- }
-
- short updateMode = CSSModelUpdateContext.UPDATE_REMOVE_RCONTAINER;
- fParser.setupUpdateContext(updateMode, parentNode, attr);
-
- // get formatted info
- AttrChangeContext region = new AttrChangeContext();
- String text = new String(formatter.formatAttrChanged(parentNode, attr, false, region));
-
- // set text
- StructuredDocumentEvent result = insertText(region.start, region.end - region.start, text);
-
- int nRemains = fParser.cleanupUpdateContext();
-
- if (0 < nRemains && !(result instanceof NoChangeEvent)) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- void attrReplaced(CSSNodeImpl parentNode, CSSNodeImpl newAttr, CSSNodeImpl oldAttr) {
- if (parentNode == null) {
- return;
- }
-
- if (oldAttr != null) {
- attrRemoved(parentNode, (CSSAttrImpl) oldAttr);
- }
-
- if (newAttr != null) {
- attrInserted(parentNode, (CSSAttrImpl) newAttr);
- }
- }
-
- /**
- *
- */
- private void childInserted(CSSNodeImpl parentNode, CSSNodeImpl node) {
- short updateMode = CSSModelUpdateContext.UPDATE_IDLE;
-
- if (node instanceof CSSStructuredDocumentRegionContainer) {
- updateMode = CSSModelUpdateContext.UPDATE_INSERT_FNCONTAINER;
- }
- else if (node instanceof CSSRegionContainer) {
- updateMode = CSSModelUpdateContext.UPDATE_INSERT_RCONTAINER;
- }
- else {
- CSSUtil.debugOut("What's this node? : " + node.getClass().toString());//$NON-NLS-1$
- return;
- }
-
- fParser.setupUpdateContext(updateMode, parentNode, node);
-
- StructuredDocumentEvent result = defaultInserted(parentNode, node);
-
- int nRemains = fParser.cleanupUpdateContext();
-
- if (0 < nRemains && !(result instanceof NoChangeEvent)) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- private void childRemoved(CSSNodeImpl parentNode, CSSNodeImpl node) {
- short updateMode = CSSModelUpdateContext.UPDATE_IDLE;
-
- if (node instanceof CSSStructuredDocumentRegionContainer) {
- updateMode = CSSModelUpdateContext.UPDATE_REMOVE_FNCONTAINER;
- }
- else if (node instanceof CSSRegionContainer) {
- updateMode = CSSModelUpdateContext.UPDATE_REMOVE_RCONTAINER;
- }
- else {
- CSSUtil.debugOut("What's this node? : " + node.getClass().toString());//$NON-NLS-1$
- return;
- }
-
- fParser.setupUpdateContext(updateMode, parentNode, node);
-
- CSSNodeImpl prev = getOldPrevious(parentNode, node);
- CSSNodeImpl next = getOldNext(parentNode, node);
- int insertPos = -1, endPos = -1;
- String source = "";//$NON-NLS-1$
- if (prev != null) {
- insertPos = prev.getEndOffset();
- }
- else {
- insertPos = node.getStartOffset();
- insertPos -= nearestSpaceLengthBefore(parentNode, insertPos);
- }
- if (next != null) {
- endPos = next.getStartOffset();
- }
- else {
- endPos = node.getEndOffset();
- endPos += nearestSpaceLengthAfter(parentNode, endPos);
- }
- source = getSpaceBefore(parentNode, next, node);
- StructuredDocumentEvent result;
- if (source.length() > 0) {
- result = insertText(insertPos, endPos - insertPos, source);
- }
- else {
- result = removeText(insertPos, endPos - insertPos);
- }
-
- int nRemains = fParser.cleanupUpdateContext();
-
- if (0 < nRemains && !(result instanceof NoChangeEvent)) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
-
- /*
- * int removeStart = -1; int removeEnd = -1; if (node instanceof
- * CSSStructuredDocumentRegionContainer) {
- * CSSStructuredDocumentRegionContainer container =
- * (CSSStructuredDocumentRegionContainer)node;
- * IStructuredDocumentRegion firstNode =
- * container.getFirstStructuredDocumentRegion();
- * IStructuredDocumentRegion lastNode =
- * container.getLastStructuredDocumentRegion(); if (firstNode != null &&
- * lastNode != null) { removeStart = firstNode.getStart(); removeEnd =
- * lastNode.getEnd(); } } else if (node instanceof CSSRegionContainer) {
- * CSSRegionContainer container = (CSSRegionContainer)node;
- * ITextRegion firstRegion = container.getFirstRegion(); ITextRegion
- * lastRegion = container.getLastRegion(); if (firstRegion != null &&
- * lastRegion != null) { removeStart = firstRegion.getStartOffset();
- * removeEnd = lastRegion.getEndOffset(); } } if (0 <= removeStart &&
- * 0 <= removeEnd) { removeText(removeStart, removeEnd - removeStart +
- * 1); }
- */
- }
-
- /**
- *
- */
- void childReplaced(CSSNodeImpl parentNode, CSSNodeImpl newChild, CSSNodeImpl oldChild) {
- if (parentNode == null) {
- return;
- }
-
- if (oldChild != null) {
- childRemoved(parentNode, oldChild);
- }
-
- if (newChild != null) {
- childInserted(parentNode, newChild);
- }
- }
-
- /**
- *
- */
- private StructuredDocumentEvent defaultInserted(CSSNodeImpl parentNode, CSSNodeImpl node) {
- int insertPos = -1;
- ICSSNode sibling;
- String preSpace = "", postSpace = "";//$NON-NLS-2$//$NON-NLS-1$
- int length = 0;
-
- if (insertPos < 0) {
- if ((sibling = node.getPreviousSibling()) != null) {
- // after previous child
- insertPos = getTextEnd(sibling);
- }
- }
-
- if (insertPos < 0) {
- if ((sibling = node.getNextSibling()) != null) {
- // before next child
- insertPos = getTextStart(sibling);
- }
- }
-
- if (insertPos < 0) {
- // position of parent
- insertPos = getChildInsertPos(parentNode);
- }
-
- if (insertPos < 0) {
- // firsttime
- insertPos = 0;
- }
-
- // format previous spaces
- length = nearestSpaceLengthBefore(parentNode, insertPos);
- insertPos -= length;
- preSpace = getSpaceBefore(parentNode, node, null);
- // format post spaces
- length += nearestSpaceLengthAfter(parentNode, insertPos + length);
- postSpace = getSpaceBefore(parentNode, node.getNextSibling(), null);
-
- // set text
- String text = preSpace + node.generateSource().trim() + postSpace;
- return insertText(insertPos, length, text);
- }
-
- /**
- * @return int
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private int getChildInsertPos(CSSNodeImpl node) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(node);
- if (formatter != null)
- return formatter.getChildInsertPos(node);
- else
- return node.getEndOffset();
- }
-
- /**
- *
- */
- // private int getDocumentEnd() {
- // int end = -1;
- // IStructuredDocument structuredDocument =
- // fModel.getStructuredDocument();
- // if (structuredDocument != null) {
- // if (structuredDocument instanceof
- // com.ibm.sed.structured.text.impl.BasicStructuredDocument) {
- // end =
- // ((com.ibm.sed.structured.text.impl.BasicStructuredDocument)structuredDocument).getLength();
- // }
- // }
- // return end;
- // }
- /**
- *
- */
- // private IStructuredDocument getStructuredDocument() {
- // return (fModel != null) ? getStructuredDocument() : null;
- // }
- /**
- * @return org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param parentNode
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private CSSNodeImpl getOldNext(CSSNodeImpl parentNode, CSSNodeImpl node) {
- CSSNodeImpl child = (CSSNodeImpl) parentNode.getLastChild();
- CSSNodeImpl ret = null;
- while (child != null) {
- if (node.getEndOffset() < child.getEndOffset())
- ret = child;
- else
- break;
- child = (CSSNodeImpl) child.getPreviousSibling();
- }
- return ret;
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param parentNode
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private CSSNodeImpl getOldPrevious(CSSNodeImpl parentNode, CSSNodeImpl node) {
- CSSNodeImpl child = (CSSNodeImpl) parentNode.getFirstChild();
- CSSNodeImpl ret = null;
- while (child != null) {
- if (child.getStartOffset() < node.getStartOffset())
- ret = child;
- else
- break;
- child = (CSSNodeImpl) child.getNextSibling();
- }
- return ret;
- }
-
- /**
- * @return java.lang.String
- * @param parentNode
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private String getSpaceBefore(ICSSNode parentNode, ICSSNode node, ICSSNode toRemove) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) parentNode);
-
- if (formatter != null) {
- org.eclipse.jface.text.IRegion exceptFor = null;
- if (toRemove != null) {
- CSSNodeImpl remove = (CSSNodeImpl) toRemove;
- exceptFor = new org.eclipse.jface.text.Region(remove.getStartOffset(), remove.getEndOffset() - remove.getStartOffset());
- }
- return formatter.formatBefore(parentNode, node, exceptFor).toString();
- }
- else
- return "";//$NON-NLS-1$
- }
-
- /**
- *
- */
- private int getTextEnd(ICSSNode node) {
- int end = -1;
- if (node != null) {
- if (node instanceof CSSStructuredDocumentRegionContainer) {
- end = ((CSSStructuredDocumentRegionContainer) node).getEndOffset();
- }
- else if (node instanceof CSSRegionContainer) {
- end = ((CSSRegionContainer) node).getEndOffset();
- }
- }
- return end;
- }
-
- /**
- *
- */
- private int getTextStart(ICSSNode node) {
- int start = -1;
- if (node != null) {
- if (node instanceof CSSStructuredDocumentRegionContainer) {
- start = ((CSSStructuredDocumentRegionContainer) node).getStartOffset();
- }
- else if (node instanceof CSSRegionContainer) {
- start = ((CSSRegionContainer) node).getStartOffset();
- }
- }
- return start;
- }
-
- /**
- *
- */
- private StructuredDocumentEvent insertText(int start, int oldLength, String text) {
- StructuredDocumentEvent result = null;
- BasicStructuredDocument structuredDocument = (BasicStructuredDocument) fModel.getStructuredDocument();
- if (structuredDocument != null) {
- if (text != null && 0 < oldLength && start + oldLength <= structuredDocument.getLength()) {
- // minimize text change
- String delText = structuredDocument.get(start, oldLength);
- int newLength = text.length();
- int shorterLen = Math.min(oldLength, newLength);
- int stMatchLen;
- for (stMatchLen = 0; stMatchLen < shorterLen && text.charAt(stMatchLen) == delText.charAt(stMatchLen); stMatchLen++) {
- //
- }
- if (0 < stMatchLen && stMatchLen < shorterLen && text.charAt(stMatchLen - 1) == 0x000d && (text.charAt(stMatchLen) == 0x000a || delText.charAt(stMatchLen) == 0x000a)) {
- // must not divide 0d->0a sequence
- stMatchLen--;
- }
- if (stMatchLen == shorterLen) {
- if (oldLength < newLength) { // just insert
- oldLength = 0;
- start += stMatchLen;
- text = text.substring(stMatchLen);
- }
- else if (newLength < oldLength) { // just remove
- oldLength -= stMatchLen;
- start += stMatchLen;
- text = null;
- }
- else { // nothing to do
- oldLength = 0;
- text = null;
- }
- }
- else {
- int edMatchLen;
- for (edMatchLen = 0; stMatchLen + edMatchLen < shorterLen && text.charAt(newLength - edMatchLen - 1) == delText.charAt(oldLength - edMatchLen - 1); edMatchLen++) {
- //
- }
- if (0 < edMatchLen && text.charAt(newLength - edMatchLen) == 0x000a && ((edMatchLen < newLength && text.charAt(newLength - edMatchLen - 1) == 0x000d) || (edMatchLen < oldLength && delText.charAt(oldLength - edMatchLen - 1) == 0x000d))) {
- // must not divide 0d->0a sequence
- edMatchLen--;
- }
- oldLength -= stMatchLen + edMatchLen;
- start += stMatchLen;
- if (stMatchLen + edMatchLen < newLength) {
- text = text.substring(stMatchLen, newLength - edMatchLen);
- }
- else {
- text = null;
- }
- }
- }
- if (0 < oldLength || text != null) {
- // String delText = structuredDocument.get(start, oldLength);
- result = structuredDocument.replaceText(fModel, start, oldLength, text);
- }
- }
- return result;
- }
-
- /**
- * @return int
- * @param insertPos
- * int
- */
- private int nearestSpaceLengthAfter(CSSNodeImpl node, int insertPos) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(node);
- if (formatter != null) {
- return formatter.getLengthToReformatAfter(node, insertPos);
- }
- else
- return 0;
- }
-
- /**
- * @return int
- * @param insertPos
- * int
- */
- private int nearestSpaceLengthBefore(CSSNodeImpl node, int insertPos) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(node);
- if (formatter != null) {
- return formatter.getLengthToReformatBefore(node, insertPos);
- }
- else
- return 0;
- }
-
- /**
- *
- */
- private StructuredDocumentEvent removeText(int start, int length) {
- StructuredDocumentEvent result = null;
- IStructuredDocument structuredDocument = fModel.getStructuredDocument();
- if (structuredDocument != null) {
- result = structuredDocument.replaceText(fModel, start, length, new String(""));//$NON-NLS-1$
- }
- return result;
- }
-
- /**
- *
- */
- void setParser(CSSModelParser parser) {
- fParser = parser;
- }
-
- /**
- *
- */
- void valueChanged(CSSNodeImpl node, String oldValue) {
- if (!(node instanceof CSSRegionContainer)) {
- CSSUtil.debugOut("Too Bad.." + //$NON-NLS-1$
- ((node == null) ? "null" : node.getClass().toString()));//$NON-NLS-1$
- return;
- }
-
- int start = node.getStartOffset();
-
- if (node.getNodeType() == ICSSNode.ATTR_NODE) {
- ICSSAttr attr = (ICSSAttr) node;
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) attr.getOwnerCSSNode());
- if (formatter != null)
- start = formatter.getAttrInsertPos(attr.getOwnerCSSNode(), attr.getName());
- }
-
- int oldLength = (oldValue == null) ? 0 : oldValue.length();
- // flash old IStructuredDocumentRegion/ITextRegion
- if (node instanceof CSSStructuredDocumentRegionContainer) {
- ((CSSStructuredDocumentRegionContainer) node).setFirstStructuredDocumentRegion(null);
- ((CSSStructuredDocumentRegionContainer) node).setLastStructuredDocumentRegion(null);
- }
- else if (node instanceof CSSRegionContainer) {
- ((CSSRegionContainer) node).setRangeRegion(null, null, null);
- }
- // generate new source
- String newValue = node.generateSource();
-
- ICSSNode parent;
- if (node.getNodeType() == ICSSNode.ATTR_NODE) {
- parent = ((ICSSAttr) node).getOwnerCSSNode();
- }
- else {
- parent = node.getParentNode();
- }
-
- fParser.setupUpdateContext(CSSModelUpdateContext.UPDATE_CHANGE_RCONTAINER, parent, node);
-
- StructuredDocumentEvent result = insertText(start, oldLength, newValue);
-
- int nRemains = fParser.cleanupUpdateContext();
-
- if (0 < nRemains && !(result instanceof NoChangeEvent)) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java
deleted file mode 100644
index a2efd80e27..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.document.ICSSAttr;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSNodeList;
-import org.eclipse.wst.css.core.document.ICSSRuleContainer;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.util.CSSUtil;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-/**
- *
- */
-class CSSModelUtil {
-
- /**
- *
- */
- static boolean canContainBrace(ICSSNode node) {
- return (node != null && (node instanceof ICSSRuleContainer || node instanceof CSSRuleDeclContainer)) ? true : false;
- }
-
- /**
- * @param parent
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- static void cleanupContainer(ICSSNode parent) {
- if (parent == null) {
- return;
- }
- for (ICSSNode child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- cleanupContainer(child);
- }
- if (parent instanceof CSSStructuredDocumentRegionContainer) {
- ((CSSStructuredDocumentRegionContainer) parent).setRangeStructuredDocumentRegion(null, null);
- }
- else if (parent instanceof CSSRegionContainer) {
- ((CSSRegionContainer) parent).setRangeRegion(null, null, null);
- }
- }
-
- /**
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param structuredDocument
- * com.ibm.sed.structuredDocument.IStructuredDocument
- */
- static boolean diagnoseNode(ICSSNode parent, IStructuredDocument structuredDocument) {
- // check this
- Vector errors = new Vector();
- if (parent instanceof CSSStructuredDocumentRegionContainer) {
- CSSStructuredDocumentRegionContainer node = (CSSStructuredDocumentRegionContainer) parent;
- String nodeText = CSSUtil.getClassString(node) + ": ";//$NON-NLS-1$
- IStructuredDocumentRegion flatNode = node.getFirstStructuredDocumentRegion();
- if (flatNode == null && (!(node instanceof CSSStyleDeclarationImpl || node instanceof CSSStyleSheetImpl) || node.getFirstChild() != null)) {
- errors.add(CSSCorePlugin.getResourceString("%1concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first flat node is null."
- }
- else if (flatNode != null) {
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(flatNode.getStart());
- if (flatNode != modelNode) {
- errors.add(CSSCorePlugin.getResourceString("%2concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first flat node is not in model."
- }
- }
- flatNode = node.getLastStructuredDocumentRegion();
- if (flatNode == null && (!(node instanceof CSSStyleDeclarationImpl || node instanceof CSSStyleSheetImpl) || node.getFirstChild() != null)) {
- errors.add(CSSCorePlugin.getResourceString("%3concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last flat node is null."
- }
- else if (flatNode != null) {
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(flatNode.getStart());
- if (flatNode != modelNode) {
- errors.add(CSSCorePlugin.getResourceString("%4concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last flat node is not in model."
- }
- }
- }
- else if (parent instanceof CSSRegionContainer) {
- CSSRegionContainer node = (CSSRegionContainer) parent;
- String nodeText = CSSUtil.getClassString(node) + ": ";//$NON-NLS-1$
- ITextRegion region = node.getFirstRegion();
- IStructuredDocumentRegion parentRegion = node.getDocumentRegion();
- if (region == null && (!(node instanceof MediaListImpl) || node.getFirstChild() != null)) {
- errors.add(CSSCorePlugin.getResourceString("%25concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is null."
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(CSSCorePlugin.getResourceString("%26concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is not in model."
- }
- }
- region = node.getLastRegion();
- if (region == null && (!(node instanceof MediaListImpl) || node.getFirstChild() != null)) {
- errors.add(CSSCorePlugin.getResourceString("%27concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is null."
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(CSSCorePlugin.getResourceString("%28concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is not in model."
- }
- }
- }
-
- ICSSNodeList attrs = parent.getAttributes();
- int nAttrs = attrs.getLength();
- for (int i = 0; i < nAttrs; i++) {
- ICSSAttr attr = (ICSSAttr) attrs.item(i);
- CSSRegionContainer node = (CSSRegionContainer) attr;
- String nodeText = CSSUtil.getClassString(node) + "(" + attr.getName() + "): ";//$NON-NLS-2$//$NON-NLS-1$
- ITextRegion region = node.getFirstRegion();
- IStructuredDocumentRegion parentRegion = node.getDocumentRegion();
- if (region == null && 0 < attr.getValue().length()) {
- errors.add(CSSCorePlugin.getResourceString("%5concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is null."
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(CSSCorePlugin.getResourceString("%6concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is not in model."
- }
- }
- region = node.getLastRegion();
- if (region == null && 0 < attr.getValue().length()) {
- errors.add(CSSCorePlugin.getResourceString("%7concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is null."
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(CSSCorePlugin.getResourceString("%8concat_ERROR_", (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is not in model."
- }
- }
- }
-
- if (!errors.isEmpty()) {
- Iterator i = errors.iterator();
- while (i.hasNext()) {
- CSSUtil.debugOut((String) i.next());
- }
- return false;
- }
- else {
- return true;
- }
- }
-
- /**
- * @return boolean
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- static boolean diagnoseTree(ICSSNode parent, IStructuredDocument structuredDocument) {
- if (parent == null) {
- return false;
- }
- // check children
- for (ICSSNode child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- diagnoseTree(child, structuredDocument);
- }
-
- diagnoseNode(parent, structuredDocument);
-
- return true;
- }
-
- /**
- * If needed, modify last flat node
- */
- static void expandStructuredDocumentRegionContainer(CSSStructuredDocumentRegionContainer target, IStructuredDocumentRegion flatNode) {
- if (target == null || flatNode == null) {
- return;
- }
-
- IStructuredDocumentRegion lastNode = target.getLastStructuredDocumentRegion();
- if (lastNode == flatNode) {
- return;
- }
- if (lastNode == null || lastNode.getStart() < flatNode.getStart()) {
- target.setLastStructuredDocumentRegion(flatNode);
- }
- }
-
- /*
- *
- */
- static ICSSNode findBraceContainer(ICSSNode node) {
- for (ICSSNode i = node; i != null; i = i.getParentNode()) {
- if (CSSModelUtil.canContainBrace(i)) {
- return i;
- }
- }
- return null;
- }
-
- /**
- *
- */
- static int getDepth(ICSSNode node) {
- int depth = -1;
- while (node != null) {
- depth++;
- node = node.getParentNode();
- }
- return depth;
- }
-
- /**
- *
- */
- static boolean isBraceClosed(ICSSNode node) {
- boolean bClosed = true;
- if (!(node instanceof CSSStructuredDocumentRegionContainer)) {
- return bClosed;
- }
-
- IStructuredDocumentRegion first = ((CSSStructuredDocumentRegionContainer) node).getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion last = ((CSSStructuredDocumentRegionContainer) node).getLastStructuredDocumentRegion();
- if (first == null || last == null) {
- return bClosed;
- }
- if (last.getStart() < first.getStart()) {
- return bClosed;
- }
-
- IStructuredDocumentRegion flatNode = first;
- int nOpen = 0;
- int nClose = 0;
- do {
- String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
- if (type == CSSRegionContexts.CSS_LBRACE) {
- nOpen++;
- }
- else if (type == CSSRegionContexts.CSS_RBRACE) {
- nClose++;
- }
- flatNode = flatNode.getNext();
- }
- while (flatNode != null && flatNode != last);
-
- if ((nOpen == 0 && nClose == 0) || nClose < nOpen) {
- bClosed = false;
- }
-
- return bClosed;
- }
-
- /**
- * only for insertion..
- */
- static boolean isInterruption(CSSStructuredDocumentRegionContainer target, IStructuredDocumentRegion flatNode) {
- if (target == null || flatNode == null) {
- return false;
- }
- int start = flatNode.getStart();
- IStructuredDocumentRegion firstNode = target.getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion lastNode = target.getLastStructuredDocumentRegion();
- if (firstNode != null && firstNode.getStart() < start && lastNode != null && start < lastNode.getStart()) {
- return true;
- }
- return false;
- }
-
- /**
- *
- */
- static boolean isParentOf(ICSSNode parent, ICSSNode child) {
- if (parent == null || child == null) {
- return false;
- }
-
- for (ICSSNode node = child; node != null; node = node.getParentNode()) {
- if (parent == node) {
- return true;
- }
- }
-
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java
deleted file mode 100644
index aa5eb3fc03..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.document.ICSSNamedNodeMap;
-import org.eclipse.wst.css.core.document.ICSSNode;
-
-
-/**
- *
- */
-public class CSSNamedNodeMapImpl extends CSSNodeListImpl implements ICSSNamedNodeMap {
-
- /**
- * CSSNamedNodeMapImpl constructor comment.
- */
- CSSNamedNodeMapImpl() {
- super();
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param name
- * java.lang.String
- */
- public ICSSNode getNamedItem(String name) {
- Iterator it = nodes.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (obj instanceof CSSAttrImpl && ((CSSAttrImpl) obj).getName().compareToIgnoreCase(name) == 0) {
- return (ICSSNode) obj;
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java
deleted file mode 100644
index 431b46008d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java
+++ /dev/null
@@ -1,559 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.document.ICSSDocument;
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSNamedNodeMap;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSNodeList;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceGenerator;
-import org.eclipse.wst.css.core.util.ImportRuleCollector;
-import org.eclipse.wst.sse.core.AbstractNotifier;
-import org.eclipse.wst.sse.core.IFactoryRegistry;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.w3c.dom.DOMException;
-
-
-/**
- *
- */
-abstract class CSSNodeImpl extends AbstractNotifier implements ICSSNode, IndexedRegion {
-
- private CSSDocumentImpl fOwnerDocument = null;
- private CSSNodeImpl fParentNode = null;
- private CSSNodeImpl fNextSibling = null;
- private CSSNodeImpl fPreviousSibling = null;
- private CSSNodeImpl fFirstChild = null;
- private CSSNodeImpl fLastChild = null;
- protected CSSNamedNodeMapImpl fAttrs = null;
-
- /**
- * CSSNodeImpl constructor comment.
- */
- CSSNodeImpl() {
- super();
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- */
- CSSNodeImpl(CSSNodeImpl that) {
- if (that != null) {
- this.fOwnerDocument = that.fOwnerDocument;
- if (that.fAttrs != null) {
- int nAttrs = that.fAttrs.getLength();
- for (int i = 0; i < nAttrs; i++) {
- CSSAttrImpl attr = (CSSAttrImpl) that.fAttrs.item(i);
- setAttribute(attr.getName(), attr.getValue());
- }
- }
- }
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param newChild
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- protected CSSNodeImpl appendChild(CSSNodeImpl newChild) throws org.w3c.dom.DOMException {
- return insertBefore(newChild, null);
- }
-
- /**
- * @param newParent
- * com.ibm.sed.css.interfaces.ICSSNode
- * @param deep
- * boolean
- */
- void cloneChildNodes(ICSSNode newParent, boolean deep) {
- if (newParent == null || newParent == this)
- return;
-
- CSSNodeImpl container = (CSSNodeImpl) newParent;
- container.removeChildNodes();
-
- for (ICSSNode child = getFirstChild(); child != null; child = child.getNextSibling()) {
- CSSNodeImpl cloned = (CSSNodeImpl) child.cloneNode(deep);
- if (cloned != null)
- container.appendChild(cloned);
- }
- }
-
- /**
- * @return boolean
- * @param offset
- * int
- */
- public boolean contains(int offset) {
- return (getStartOffset() <= offset && offset < getEndOffset());
- }
-
- /**
- * @return java.lang.String
- */
- String generateSource() {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(this);
- return formatter.format(this).toString();
- }
-
- /**
- * @return java.lang.String
- * @param name
- * java.lang.String
- */
- String getAttribute(String name) {
- CSSAttrImpl attr = getAttributeNode(name);
- if (attr != null)
- return attr.getValue();
- return null;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSAttrImpl
- * @param name
- * java.lang.String
- */
- protected CSSAttrImpl getAttributeNode(String name) {
- if (fAttrs == null)
- return null;
-
- int nAttrs = fAttrs.getLength();
- for (int i = 0; i < nAttrs; i++) {
- CSSAttrImpl attr = (CSSAttrImpl) fAttrs.item(i);
- if (attr.matchName(name))
- return attr;
- }
- return null;
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNamedNodeMap
- */
- public ICSSNamedNodeMap getAttributes() {
- if (fAttrs == null)
- fAttrs = new CSSNamedNodeMapImpl();
- return fAttrs;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNodeList
- */
- public ICSSNodeList getChildNodes() {
- CSSNodeListImpl list = new CSSNodeListImpl();
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- list.appendNode(node);
- }
- return list;
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSNode
- * @param node
- * com.ibm.sed.css.interfaces.ICSSNode
- */
- ICSSNode getCommonAncestor(ICSSNode node) {
- if (node == null)
- return null;
-
- for (ICSSNode na = node; na != null; na = na.getParentNode()) {
- for (ICSSNode ta = this; ta != null; ta = ta.getParentNode()) {
- if (ta == na)
- return ta;
- }
- }
-
- return null; // not found
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSDocumentImpl
- */
- CSSDocumentImpl getContainerDocument() {
- for (ICSSNode node = this; node != null; node = node.getParentNode()) {
- if (node instanceof CSSDocumentImpl) {
- CSSDocumentImpl doc = (CSSDocumentImpl) node;
- if (doc.isDocument())
- return doc;
- }
- }
- return null;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param offset
- * int
- */
- CSSNodeImpl getContainerNode(int offset) {
- if (!contains(offset))
- return null;
-
- for (ICSSNode child = getFirstChild(); child != null; child = child.getNextSibling()) {
- ICSSNode found = ((CSSNodeImpl) child).getContainerNode(offset);
- if (found != null)
- return (CSSNodeImpl) found;
- }
-
- return this;
- }
-
- /**
- */
- public IFactoryRegistry getFactoryRegistry() {
- ICSSModel model = getOwnerDocument().getModel();
- if (model != null) {
- IFactoryRegistry reg = model.getFactoryRegistry();
- if (reg != null)
- return reg;
- }
- return null;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNode
- */
- public ICSSNode getFirstChild() {
- return this.fFirstChild;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNode
- */
- public ICSSNode getLastChild() {
- return this.fLastChild;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNode
- */
- public ICSSNode getNextSibling() {
- return this.fNextSibling;
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSNode
- * @param offset
- * int
- */
- ICSSNode getNodeAt(int offset) {
- // the same as getContainerNode()
- return getContainerNode(offset);
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSDocument
- */
- public ICSSDocument getOwnerDocument() {
- return this.fOwnerDocument;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNode
- */
- public ICSSNode getParentNode() {
- return this.fParentNode;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNode
- */
- public ICSSNode getPreviousSibling() {
- return this.fPreviousSibling;
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSFactory
- */
- ICSSNode getRootNode() {
- CSSNodeImpl parent = (CSSNodeImpl) getParentNode();
- if (parent == null)
- return this;
- return parent.getRootNode();
- }
-
- /**
- * @return boolean
- */
- public boolean hasChildNodes() {
- return (this.fFirstChild != null);
- }
-
- /**
- * @return boolean
- */
- public boolean hasProperties() {
- return false;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param newChild
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param refChild
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- protected CSSNodeImpl insertBefore(CSSNodeImpl newChild, CSSNodeImpl refChild) throws org.w3c.dom.DOMException {
- if (newChild == null)
- return null;
-
- CSSNodeImpl child = newChild;
- CSSNodeImpl next = refChild;
- CSSNodeImpl prev = null;
- if (next == null) {
- prev = this.fLastChild;
- this.fLastChild = child;
- }
- else {
- prev = (CSSNodeImpl) next.getPreviousSibling();
- next.setPreviousSibling(child);
- }
-
- if (prev == null)
- this.fFirstChild = child;
- else
- prev.setNextSibling(child);
- child.setPreviousSibling(prev);
- child.setNextSibling(next);
- child.setParentNode(this);
-
- notifyChildReplaced(child, null);
-
- return newChild;
- }
-
- /**
- * @param newAttr
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param oldAttr
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- */
- protected void notifyAttrReplaced(CSSNodeImpl newAttr, CSSNodeImpl oldAttr) {
- // for model
- ICSSDocument doc = getContainerDocument();
- if (doc == null)
- return;
- CSSModelImpl model = (CSSModelImpl) doc.getModel();
- if (model == null)
- return;
- model.attrReplaced(this, newAttr, oldAttr);
-
- // for adapters
- int type = CHANGE;
- if (newAttr == null)
- type = REMOVE;
- else if (oldAttr == null)
- type = ADD;
- notify(type, oldAttr, oldAttr, newAttr, getStartOffset());
- }
-
- /**
- * @param newChild
- * com.ibm.sed.css.treemodel.CSSNode
- * @param oldChild
- * com.ibm.sed.css.treemodel.CSSNode
- */
- protected void notifyChildReplaced(CSSNodeImpl newChild, CSSNodeImpl oldChild) {
- // for model
- ICSSDocument doc = getContainerDocument();
- if (doc == null)
- return;
- CSSModelImpl model = (CSSModelImpl) doc.getModel();
- if (model == null)
- return;
- model.childReplaced(this, newChild, oldChild);
-
- // for adapters
- int type = CHANGE;
- if (newChild == null)
- type = REMOVE;
- else if (oldChild == null)
- type = ADD;
- notify(type, oldChild, oldChild, newChild, getStartOffset());
- }
-
- /**
- * @param attr
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- */
- void removeAttributeNode(CSSNodeImpl attr) {
- // find
- int nAttrs = fAttrs.getLength();
- for (int i = 0; i < nAttrs; i++) {
- if (fAttrs.item(i) == attr) {
- fAttrs.removeNode(i);
- notifyAttrReplaced(null, attr);
- return;
- }
- }
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param newChild
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- protected CSSNodeImpl removeChild(CSSNodeImpl oldChild) throws org.w3c.dom.DOMException {
- if (oldChild == null)
- return null;
- if (oldChild.getParentNode() != this)
- return null;
-
- // close import rules
- ImportRuleCollector trav = new ImportRuleCollector();
- trav.apply(oldChild);
- Iterator it = trav.getRules().iterator();
- while (it.hasNext()) {
- ((CSSImportRuleImpl) it.next()).closeStyleSheet();
- }
-
- CSSNodeImpl child = oldChild;
- CSSNodeImpl prev = (CSSNodeImpl) child.getPreviousSibling();
- CSSNodeImpl next = (CSSNodeImpl) child.getNextSibling();
-
- if (prev == null)
- this.fFirstChild = next;
- else
- prev.setNextSibling(next);
-
- if (next == null)
- this.fLastChild = prev;
- else
- next.setPreviousSibling(prev);
-
- child.setPreviousSibling(null);
- child.setNextSibling(null);
- child.setParentNode(null);
-
- notifyChildReplaced(null, child);
-
- return child;
- }
-
- /**
- *
- */
- void removeChildNodes() {
- ICSSNode nextChild = null;
- for (ICSSNode child = getFirstChild(); child != null; child = nextChild) {
- nextChild = child.getNextSibling();
- removeChild((CSSNodeImpl) child);
- }
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param newChild
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @param oldChild
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- protected CSSNodeImpl replaceChild(CSSNodeImpl newChild, CSSNodeImpl oldChild) throws org.w3c.dom.DOMException {
- if (oldChild == null)
- return newChild;
- if (newChild != null)
- insertBefore(newChild, oldChild);
- return removeChild(oldChild);
- }
-
- /**
- * @param name
- * java.lang.String
- * @param value
- * java.lang.String
- */
- void setAttribute(String name, String value) {
- if (name == null)
- return;
-
- CSSAttrImpl attr = getAttributeNode(name);
- if (attr != null) {
- String oldValue = attr.getValue();
- if (value != null && value.equals(oldValue))
- return;
- if (value == null) {
- if (oldValue != null) {
- removeAttributeNode(attr);
- }
- return;
- }
- }
- else {
- if (value == null)
- return;
- if (fAttrs == null)
- fAttrs = new CSSNamedNodeMapImpl();
- CSSDocumentImpl doc = (CSSDocumentImpl) getOwnerDocument();
- if (doc == null)
- return;
- attr = (CSSAttrImpl) doc.createCSSAttr(name);
- attr.setOwnerCSSNode(this);
- fAttrs.appendNode(attr);
- notifyAttrReplaced(attr, null);
- }
- attr.setValue(value);
- }
-
- /**
- * @param cssText
- * java.lang.String
- */
- public void setCssText(String cssText) {
- // TODO : call flat model parser and replace myself with new three!!
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
-
- /**
- * @param nextSibling
- * com.ibm.sed.css.interfaces.ICSSNode
- */
- private void setNextSibling(ICSSNode nextSibling) {
- this.fNextSibling = (CSSNodeImpl) nextSibling;
- }
-
- /**
- * @param ownerDocument
- * com.ibm.sed.css.interfaces.CSSDocument
- */
- void setOwnerDocument(ICSSDocument ownerDocument) {
- this.fOwnerDocument = (CSSDocumentImpl) ownerDocument;
- }
-
- /**
- * @param parentNode
- * com.ibm.sed.css.interfaces.ICSSNode
- */
- private void setParentNode(ICSSNode parentNode) {
- this.fParentNode = (CSSNodeImpl) parentNode;
- }
-
- /**
- * @param previousSibling
- * com.ibm.sed.css.interfaces.ICSSNode
- */
- private void setPreviousSibling(ICSSNode previousSibling) {
- this.fPreviousSibling = (CSSNodeImpl) previousSibling;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java
deleted file mode 100644
index 92c85597fa..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSNodeList;
-
-/**
- *
- */
-class CSSNodeListImpl extends AbstractCSSNodeList implements ICSSNodeList {
-
- /**
- * CSSNodeListImpl constructor comment.
- */
- CSSNodeListImpl() {
- super();
- }
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- * @param index
- * int
- */
- public ICSSNode item(int index) {
- return itemImpl(index);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java
deleted file mode 100644
index c3c7d09f9f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSPageRule;
-import org.eclipse.wst.css.core.document.ICSSSelectorList;
-
-
-/**
- *
- */
-class CSSPageRuleImpl extends CSSRuleDeclContainer implements ICSSPageRule {
-
- ICSSSelectorList fSelectorList = new CSSSelectorListImpl(null);
-
- /**
- *
- */
- CSSPageRuleImpl() {
- super();
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSPageRuleImpl
- */
- CSSPageRuleImpl(CSSPageRuleImpl that) {
- super(that);
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSPageRuleImpl cloned = new CSSPageRuleImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return java.lang.String
- */
- String extractPreString() {
- StringBuffer preStr = new StringBuffer("@page ");//$NON-NLS-1$
- preStr.append(getSelectorText());
-
- return preStr.toString();
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return PAGERULE_NODE;
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSSelectorList
- */
- public ICSSSelectorList getSelectors() {
- return fSelectorList;
- }
-
- /**
- * The parsable textual representation of the page selector for the rule.
- *
- * @exception org.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has
- * a syntax error and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is
- * readonly.
- */
- public String getSelectorText() {
- return getAttribute(SELECTOR);
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return PAGE_RULE;
- }
-
- /**
- *
- */
- public void setSelectorText(String selectorText) throws org.w3c.dom.DOMException {
- setAttribute(SELECTOR, selectorText);
- fSelectorList = new CSSSelectorListImpl(selectorText);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java
deleted file mode 100644
index ba20a24eff..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSDocument;
-
-/**
- *
- */
-abstract class CSSPrimitiveContainer extends CSSPrimitiveValueImpl {
-
- /**
- * CSSRegionContainer constructor comment.
- *
- * @param that
- * com.ibm.sed.css.treemodel.CSSPrimitiveValueImpl
- */
- CSSPrimitiveContainer(CSSPrimitiveContainer that) {
- super(that);
- }
-
- /**
- * CSSRegionContainer constructor comment.
- *
- * @param primitiveType
- * short
- */
- CSSPrimitiveContainer(short primitiveType) {
- super(primitiveType);
- }
-
- /**
- *
- */
- protected abstract void initPrimitives();
-
- /**
- * @param ownerDocument
- * com.ibm.sed.css.interfaces.ICSSDocument
- */
- void setOwnerDocument(ICSSDocument ownerDocument) {
- super.setOwnerDocument(ownerDocument);
-
- initPrimitives();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java
deleted file mode 100644
index 285d4d0405..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSDocument;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSPrimitiveValue;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.Counter;
-import org.w3c.dom.css.RGBColor;
-import org.w3c.dom.css.Rect;
-
-
-/**
- *
- */
-class CSSPrimitiveValueImpl extends CSSRegionContainer implements ICSSPrimitiveValue {
-
- protected short fPrimitiveType = CSS_UNKNOWN;
- private float fFloatValue = 0.0f;
- private String fStringValue = null;
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSPrimitiveValueImpl
- */
- CSSPrimitiveValueImpl(CSSPrimitiveValueImpl that) {
- super(that);
-
- this.fPrimitiveType = that.fPrimitiveType;
- this.fFloatValue = that.fFloatValue;
- this.fStringValue = that.fStringValue;
- }
-
- /**
- *
- */
- CSSPrimitiveValueImpl(short primitiveType) {
- super();
- fPrimitiveType = primitiveType;
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSPrimitiveValueImpl cloned = new CSSPrimitiveValueImpl(this);
-
- return cloned;
- }
-
- /**
- * This method is used to get the Counter value. If this CSS value doesn't
- * contain a counter value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved using
- * the <code>Counter</code> interface.
- *
- * @return The Counter value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a Counter value (e.g. this is not
- * <code>CSS_COUNTER</code>).
- */
- public Counter getCounterValue() throws DOMException {
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getCSSValueText() {
- return getCssText();
- }
-
- /**
- * A code defining the type of the value as defined above.
- */
- public short getCssValueType() {
- if (getPrimitiveType() == CSS_INHERIT_PRIMITIVE) {
- return CSS_INHERIT;
- }
- else {
- return CSS_PRIMITIVE_VALUE;
- }
- }
-
- /**
- * This method is used to get a float value in a specified unit. If this
- * CSS value doesn't contain a float value or can't be converted into the
- * specified unit, a <code>DOMException</code> is raised.
- *
- * @param unitType
- * A unit code to get the float value. The unit code can only
- * be a float unit type (i.e. <code>CSS_NUMBER</code>,
- * <code>CSS_PERCENTAGE</code>,<code>CSS_EMS</code>,
- * <code>CSS_EXS</code>,<code>CSS_PX</code>,
- * <code>CSS_CM</code>,<code>CSS_MM</code>,
- * <code>CSS_IN</code>,<code>CSS_PT</code>,
- * <code>CSS_PC</code>,<code>CSS_DEG</code>,
- * <code>CSS_RAD</code>,<code>CSS_GRAD</code>,
- * <code>CSS_MS</code>,<code>CSS_S</code>,
- * <code>CSS_HZ</code>,<code>CSS_KHZ</code>,
- * <code>CSS_DIMENSION</code>).
- * @return The float value in the specified unit.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a float value or if the float value can't be
- * converted into the specified unit.
- */
- public float getFloatValue(short unitType) throws DOMException {
- switch (fPrimitiveType) {
- case CSS_NUMBER :
- case CSS_PERCENTAGE :
- case CSS_EMS :
- case CSS_EXS :
- case CSS_PX :
- case CSS_CM :
- case CSS_MM :
- case CSS_IN :
- case CSS_PT :
- case CSS_PC :
- case CSS_DEG :
- case CSS_RAD :
- case CSS_GRAD :
- case CSS_MS :
- case CSS_S :
- case CSS_HZ :
- case CSS_KHZ :
- case CSS_DIMENSION :
- case CSS_INTEGER :
- case CSS_HASH :
- return fFloatValue;
- default :
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/01/17
- * 12:12:18)
- *
- * @return short
- */
- public short getNodeType() {
- return PRIMITIVEVALUE_NODE;
- }
-
- /**
- * The type of the value as defined by the constants specified above.
- */
- public short getPrimitiveType() {
- return fPrimitiveType;
- }
-
- /**
- * This method is used to get the Rect value. If this CSS value doesn't
- * contain a rect value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved using
- * the <code>Rect</code> interface.
- *
- * @return The Rect value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a Rect value. (e.g. this is not
- * <code>CSS_RECT</code>).
- */
- public Rect getRectValue() throws DOMException {
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
-
- /**
- * This method is used to get the RGB color. If this CSS value doesn't
- * contain a RGB color value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved using
- * the <code>RGBColor</code> interface.
- *
- * @return the RGB color value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the attached property
- * can't return a RGB color value (e.g. this is not
- * <code>CSS_RGBCOLOR</code>).
- */
- public RGBColor getRGBColorValue() throws DOMException {
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
-
- /**
- * This method is used to get the string value. If the CSS value doesn't
- * contain a string value, a <code>DOMException</code> is raised. Some
- * properties (like 'font-family' or 'voice-family') convert a whitespace
- * separated list of idents to a string.
- *
- * @return The string value in the current unit. The current
- * <code>primitiveType</code> can only be a string unit type
- * (i.e. <code>CSS_STRING</code>,<code>CSS_URI</code>,
- * <code>CSS_IDENT</code> and <code>CSS_ATTR</code>).
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a string value.
- */
- public String getStringValue() throws DOMException {
- switch (fPrimitiveType) {
- case CSS_STRING :
- case CSS_URI :
- case CSS_IDENT :
- case CSS_ATTR :
- case CSS_URANGE :
- case CSS_FORMAT :
- case CSS_LOCAL :
- case CSS_HASH :
- case CSS_COMMA :
- case CSS_SLASH :
- case CSS_INHERIT_PRIMITIVE :
- return fStringValue;
- default :
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- protected void notifyValueChanged(String oldValue) {
- // for model
- ICSSDocument doc = getContainerDocument();
- if (doc == null)
- return;
- CSSModelImpl model = (CSSModelImpl) doc.getModel();
- if (model == null)
- return;
- model.valueChanged(this, oldValue);
-
- // for adapters
- notify(CHANGE, new Short(fPrimitiveType), null, null, getStartOffset());
- }
-
- /**
- * A method to set the float value with a specified unit. If the property
- * attached with this value can not accept the specified unit or the float
- * value, the value will be unchanged and a <code>DOMException</code>
- * will be raised.
- *
- * @param unitType
- * A unit code as defined above. The unit code can only be a
- * float unit type (i.e. <code>CSS_NUMBER</code>,
- * <code>CSS_PERCENTAGE</code>,<code>CSS_EMS</code>,
- * <code>CSS_EXS</code>,<code>CSS_PX</code>,
- * <code>CSS_CM</code>,<code>CSS_MM</code>,
- * <code>CSS_IN</code>,<code>CSS_PT</code>,
- * <code>CSS_PC</code>,<code>CSS_DEG</code>,
- * <code>CSS_RAD</code>,<code>CSS_GRAD</code>,
- * <code>CSS_MS</code>,<code>CSS_S</code>,
- * <code>CSS_HZ</code>,<code>CSS_KHZ</code>,
- * <code>CSS_DIMENSION</code>).
- * @param floatValue
- * The new float value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the attached property
- * doesn't support the float value or the unit type. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public void setFloatValue(short unitType, float floatValue) throws DOMException {
- switch (unitType) {
- case CSS_NUMBER :
- case CSS_PERCENTAGE :
- case CSS_EMS :
- case CSS_EXS :
- case CSS_PX :
- case CSS_CM :
- case CSS_MM :
- case CSS_IN :
- case CSS_PT :
- case CSS_PC :
- case CSS_DEG :
- case CSS_RAD :
- case CSS_GRAD :
- case CSS_MS :
- case CSS_S :
- case CSS_HZ :
- case CSS_KHZ :
- case CSS_DIMENSION :
- case CSS_INTEGER :
- String oldValue = getCSSValueText();
- fPrimitiveType = unitType;
- fFloatValue = floatValue;
- notifyValueChanged(oldValue);
- break;
- default :
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * A method to set the string value with the specified unit. If the
- * property attached to this value can't accept the specified unit or the
- * string value, the value will be unchanged and a
- * <code>DOMException</code> will be raised.
- *
- * @param stringType
- * A string code as defined above. The string code can only be
- * a string unit type (i.e. <code>CSS_STRING</code>,
- * <code>CSS_URI</code>,<code>CSS_IDENT</code>, and
- * <code>CSS_ATTR</code>).
- * @param stringValue
- * The new string value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a string value or if the string value can't be
- * converted into the specified unit. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public void setStringValue(short stringType, String stringValue) throws DOMException {
- switch (stringType) {
- case CSS_STRING :
- case CSS_URI :
- case CSS_IDENT :
- case CSS_ATTR :
- case CSS_URANGE :
- case CSS_FORMAT :
- case CSS_LOCAL :
- case CSS_HASH :
- case CSS_COMMA :
- case CSS_SLASH :
- case CSS_INHERIT_PRIMITIVE :
- String oldValue = getCSSValueText();
- fPrimitiveType = stringType;
- fStringValue = stringValue;
- notifyValueChanged(oldValue);
- break;
- default :
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/01/24
- * 15:06:25)
- *
- * @param floatValue
- * float
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public void setValue(float floatValue) throws org.w3c.dom.DOMException {
- setFloatValue(getPrimitiveType(), floatValue);
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/01/24
- * 15:06:25)
- *
- * @param stringValue
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public void setValue(java.lang.String stringValue) throws org.w3c.dom.DOMException {
- setStringValue(getPrimitiveType(), stringValue);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java
deleted file mode 100644
index e83c8ce051..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-
-/**
- *
- */
-abstract class CSSRegionContainer extends CSSNodeImpl {
-
- private ITextRegion fFirstRegion = null;
- private ITextRegion fLastRegion = null;
- private IStructuredDocumentRegion fParentRegion = null;
-
- /**
- * CSSRegionContainer constructor comment.
- */
- CSSRegionContainer() {
- super();
- }
-
- /**
- * CSSRegionContainer constructor comment.
- *
- * @param that
- * com.ibm.sed.css.treemodel.CSSRegionContainer
- */
- CSSRegionContainer(CSSRegionContainer that) {
- super(that);
- }
-
- /**
- * @return java.lang.String
- */
- public String getCssText() {
- if (fFirstRegion == null || fLastRegion == null)
- return generateSource();
-
- ITextRegionList regions = fParentRegion.getRegions();
- StringBuffer source = new StringBuffer();
- boolean bIn = false;
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion current = regions.get(i);
- if (bIn) {
- source.append(fParentRegion.getText(current));
- if (current == fLastRegion)
- break;
- }
- else {
- if (current == fFirstRegion) {
- bIn = true;
- source.append(fParentRegion.getText(current));
- if (current == fLastRegion)
- break;
- }
- }
- }
-
- return source.toString();
- }
-
- /**
- * @return int
- */
- public int getEndOffset() {
- ITextRegion region = getLastRegion();
- if (region == null || fParentRegion == null) {
- return -1;
- }
- else {
- return fParentRegion.getEndOffset(region);
- }
- /*
- * int offset = 0; if (lastRegion != null) offset =
- * lastRegion.getEnd();
- *
- * CSSStructuredDocumentRegionContainer item = null; ICSSNode node =
- * getParentNode(); while (node != null) { if (node instanceof
- * CSSStructuredDocumentRegionContainer) item =
- * (CSSStructuredDocumentRegionContainer) node; node =
- * node.getParentNode(); } if (item != null) { // assumption: regions
- * are attached to FIRST node IStructuredDocumentRegion flatNode =
- * item.getFirstStructuredDocumentRegion(); if (flatNode != null)
- * return (flatNode.getStart() + offset); } return 0;
- */
- }
-
- IStructuredDocumentRegion getDocumentRegion() {
- return fParentRegion;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.ITextRegion
- */
- ITextRegion getFirstRegion() {
- return fFirstRegion;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.ITextRegion
- */
- ITextRegion getLastRegion() {
- return fLastRegion;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.ITextRegion
- * @param index
- * int
- */
- ITextRegion getRegion(int index) {
- if (getFirstRegion() == null)
- return null;
- ITextRegionList regions = fParentRegion.getRegions();
-
- for (int i = 0; i < regions.size(); i++) {
- if (regions.get(i) == getFirstRegion()) {
- if (i + index < regions.size()) {
- ITextRegion target = regions.get(i + index);
- if (target.getStart() <= getLastRegion().getStart())
- return target;
- }
- return null;
- }
- }
- return null;
- }
-
- /**
- * @return int
- */
- int getRegionCount() {
- validateRange();
-
- if (getFirstRegion() == null)
- return 0;
- if (getFirstRegion() == getLastRegion())
- return 1;
- ITextRegionList regions = fParentRegion.getRegions();
-
- int j = 0;
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion current = regions.get(i);
- if (j != 0 || current == getFirstRegion())
- j++;
- if (current == getLastRegion())
- break;
- }
- return j;
- }
-
- /**
- * @return int
- */
- public int getStartOffset() {
- ITextRegion region = getFirstRegion();
- if (region == null || fParentRegion == null) {
- return -1;
- }
- else {
- return fParentRegion.getStartOffset(region);
- }
- /*
- * int offset = 0; if (firstRegion != null) offset =
- * firstRegion.getStart();
- *
- * CSSStructuredDocumentRegionContainer item = null; ICSSNode node =
- * getParentNode(); while (node != null) { if (node instanceof
- * CSSStructuredDocumentRegionContainer) item =
- * (CSSStructuredDocumentRegionContainer) node; node =
- * node.getParentNode(); } if (item != null) { // assumption: regions
- * are attached to FIRST node IStructuredDocumentRegion flatNode =
- * item.getFirstStructuredDocumentRegion(); if (flatNode != null)
- * return (flatNode.getStart() + offset); } return 0;
- */
- }
-
- /**
- * @param region
- * com.ibm.sed.structuredDocument.ITextRegion
- * @deprecated
- */
- ITextRegion setFirstRegion(ITextRegion region) {
- this.fFirstRegion = region;
- return region;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.ITextRegion
- * @param lastRegion
- * com.ibm.sed.structuredDocument.ITextRegion
- * @deprecated
- */
- ITextRegion setLastRegion(ITextRegion lastRegion) {
- this.fLastRegion = lastRegion;
- return lastRegion;
- }
-
- /**
- * @param firstRegion
- * com.ibm.sed.structuredDocument.ITextRegion
- * @param lastRegion
- * com.ibm.sed.structuredDocument.ITextRegion
- */
- void setRangeRegion(IStructuredDocumentRegion parentRegion, ITextRegion firstRegion, ITextRegion lastRegion) {
- this.fParentRegion = parentRegion;
- this.fFirstRegion = firstRegion;
- this.fLastRegion = lastRegion;
-
- if (firstRegion == null && lastRegion == null) {
- setFirstRegion(null);
- setLastRegion(null);
- }
- else { // range validation
- validateRange();
- }
- }
-
- /**
- * @return boolean
- */
- private boolean validateRange() {
- boolean bModified = false;
-
- if (this.fFirstRegion != null || this.fLastRegion != null) {
- if (this.fFirstRegion == null) {
- this.fFirstRegion = this.fLastRegion;
- bModified = true;
- }
- else if (this.fLastRegion == null) {
- this.fLastRegion = this.fFirstRegion;
- bModified = true;
- }
- else if (this.fFirstRegion.getStart() > this.fLastRegion.getStart()) {
- // need to swap first for last
- ITextRegion reg = fFirstRegion;
- fFirstRegion = fLastRegion;
- fLastRegion = reg;
- bModified = true;
- }
- }
- return bModified;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java
deleted file mode 100644
index d983a425e6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-
-/**
- *
- */
-abstract class CSSRuleDeclContainer extends CSSRuleImpl {
-
- /**
- * CSSRuleDeclContainer constructor comment.
- */
- CSSRuleDeclContainer() {
- super();
- }
-
- /**
- * CSSRuleDeclContainer constructor comment.
- *
- * @param that
- * com.ibm.sed.css.treemodel.CSSRuleImpl
- */
- CSSRuleDeclContainer(CSSRuleDeclContainer that) {
- super(that);
- }
-
- /**
- * @return java.lang.String
- */
- abstract String extractPreString();
-
- /**
- * @return org.w3c.dom.css.CSSStyleDeclaration
- */
- public CSSStyleDeclaration getStyle() {
-
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSStyleDeclaration)
- return (CSSStyleDeclaration) node;
- }
-
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java
deleted file mode 100644
index d6cf4aae79..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleSheet;
-
-
-/**
- *
- */
-abstract class CSSRuleImpl extends CSSStructuredDocumentRegionContainer implements CSSRule {
-
- /**
- *
- */
- CSSRuleImpl() {
- super();
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSRuleImpl
- */
- CSSRuleImpl(CSSRuleImpl that) {
- super(that);
- }
-
- /**
- * If this rule is contained inside another rule (e.g. a style rule inside
- * an
- *
- * @media block), this is the containing rule. If this rule is not nested
- * inside any other rules, this returns <code>null</code>.
- */
- public CSSRule getParentRule() {
- ICSSNode rule = getParentNode();
-
- // parent rule is used only if parent is media rule
- if (rule instanceof CSSMediaRuleImpl)
- return (CSSRule) rule;
-
- return null;
- }
-
- /**
- * The style sheet that contains this rule.
- */
- public CSSStyleSheet getParentStyleSheet() {
- ICSSNode parent = getParentNode();
- while (parent != null) {
- if (parent instanceof CSSStyleSheetImpl)
- return (CSSStyleSheet) parent;
- parent = parent.getParentNode();
- }
- return null;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public abstract short getType();
-
- /**
- * @return boolean
- */
- public boolean hasProperties() {
- return true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java
deleted file mode 100644
index 51f15a490b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-
-/**
- *
- */
-public class CSSRuleListImpl extends AbstractCSSNodeList implements CSSRuleList {
-
- /**
- *
- */
- CSSRuleListImpl() {
- super();
- }
-
- /**
- * Used to retrieve a CSS rule by ordinal index. The order in this
- * collection represents the order of the rules in the CSS style sheet. If
- * index is greater than or equal to the number of rules in the list, this
- * returns <code>null</code>.
- *
- * @param indexIndex
- * into the collection
- * @return The style rule at the <code>index</code> position in the
- * <code>CSSRuleList</code>, or <code>null</code> if that is
- * not a valid index.
- */
- public CSSRule item(int index) {
- return (CSSRule) itemImpl(index);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java
deleted file mode 100644
index e3cdea06a1..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.wst.css.core.adapters.IStyleSelectorAdapter;
-import org.eclipse.wst.css.core.document.ICSSSelector;
-import org.eclipse.wst.css.core.document.ICSSSelectorCombinator;
-import org.eclipse.wst.css.core.document.ICSSSelectorItem;
-import org.eclipse.wst.css.core.document.ICSSSimpleSelector;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.xml.core.NameValidator;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- *
- */
-class CSSSelector implements ICSSSelector {
-
- private int fSpecificity = -1;
- private String fCachedString = null;
- private List fTokens = null;
- private List fItems = null;
- private List fParseErrors = null;
- private List fNameErrors = null;
-
- CSSSelector(List tokens) {
- fTokens = new ArrayList(tokens);
- }
-
- /**
- * @return boolean
- * @param obj
- * java.lang.Object
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null || this.getClass() != obj.getClass())
- return false;
-
- CSSSelector foreign = (CSSSelector) obj;
-
- // if (fSpecificity != foreign.fSpecificity) return false;
-
- if (getLength() != foreign.getLength())
- return false;
-
- for (int i = 0; i < getLength(); i++) {
- if (!getItem(i).equals(foreign.getItem(i)))
- return false;
- }
-
- return true;
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSSelectorItem
- * @param index
- * int
- */
- public ICSSSelectorItem getItem(int index) {
- if (fItems == null) {
- fItems = parseSelector(fTokens);
- }
- if (fItems != null && 0 <= index && index < fItems.size()) {
- return (ICSSSelectorItem) fItems.get(index);
- }
- else {
- return null;
- }
- }
-
- /**
- * @return java.util.Iterator
- */
- public Iterator getIterator() {
- if (fItems == null) {
- fItems = parseSelector(fTokens);
- }
- return (fItems != null) ? fItems.iterator() : null;
- }
-
- /**
- * @return int
- */
- public int getLength() {
- if (fItems == null) {
- fItems = parseSelector(fTokens);
- }
- return (fItems != null) ? fItems.size() : 0;
- }
-
- /**
- * @return org.w3c.dom.Element
- */
- private Element getParentElement(Element element) {
- try {
- element = (Element) element.getParentNode();
- }
- catch (Exception ex) {
- // cast error or null pointer ...
- element = null;
- }
- return element;
- }
-
- /**
- * @return org.w3c.dom.Element
- */
- private Element getPreviousElement(Element element) {
- Element p = null;
- for (Node node = element.getPreviousSibling(); node != null; node = node.getPreviousSibling()) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- p = (Element) node;
- break;
- }
- }
- return p;
- }
-
- /**
- * Calculate a selector's specificity a = the number of ID attributes in
- * the selector b = the number of other attributes and pseudo-classes in
- * the selector c = the number of element names in the selector (ignore
- * pseudo-elements) Concatenating the three numbers a-b-c (in a number
- * system with a large base) gives the specificity.
- *
- * @return int
- */
- public int getSpecificity() {
- if (fSpecificity < 0) {
- int nIDs = 0;
- int nAttributes = 0;
- int nElements = 0;
- Iterator i = getIterator();
- while (i.hasNext()) {
- ICSSSelectorItem item = (ICSSSelectorItem) i.next();
- if (item instanceof CSSSimpleSelector) {
- CSSSimpleSelector selector = (CSSSimpleSelector) item;
- nIDs += selector.getNumOfIDs();
- nAttributes += selector.getNumOfAttributes();
- nAttributes += selector.getNumOfClasses();
- nAttributes += selector.getNumOfPseudoNames();
- if (!selector.isUniversal()) {
- nElements++;
- }
- }
- }
- fSpecificity = nIDs * 10000 + nAttributes * 100 + nElements;
- }
-
- return fSpecificity;
- }
-
- /**
- * @return java.lang.String
- */
- public String getString() {
- if (fCachedString == null) {
- StringBuffer buf = new StringBuffer();
- Iterator i = getIterator();
- while (i.hasNext()) {
- ICSSSelectorItem item = (ICSSSelectorItem) i.next();
- if (item instanceof CSSSelectorCombinator) {
- // If item is DESCENDANT combinator, it is just single
- // space.
- // Then, you dont have to append string..
- if (((CSSSelectorCombinator) item).getCombinatorType() != ICSSSelectorCombinator.DESCENDANT) {
- buf.append(" ");//$NON-NLS-1$
- buf.append(item.getString());
- }
- buf.append(" ");//$NON-NLS-1$
- }
- else {
- buf.append(item.getString());
- }
- }
- fCachedString = buf.toString();
- }
-
- return fCachedString;
- }
-
- /**
- * @return boolean
- * @param element
- * org.w3c.dom.Element
- */
- public boolean match(org.w3c.dom.Element element, java.lang.String pseudoName) {
- Element target = element;
- char combinatorType = ICSSSelectorCombinator.UNKNOWN;
- Element chunkStartElement = null; // for CHILD and ADJACENT
- // combinator
- int chunkStartItem = -1; // for CHILD and ADJACENT combinator
- int numItems = getLength();
- for (int iItem = numItems - 1; iItem >= 0; iItem--) {
- // Check Selector Items
- ICSSSelectorItem item = getItem(iItem);
- if (item instanceof ICSSSimpleSelector) {
- // Simple Selector
- if (target == null)
- return false;
- if (!matchExactly((ICSSSimpleSelector) item, target, pseudoName)) {
- switch (combinatorType) {
- case ICSSSelectorCombinator.DESCENDANT :
- do {
- target = getParentElement(target);
- if (target == null)
- return false;
- }
- while (!matchExactly((ICSSSimpleSelector) item, target, pseudoName));
- break;
- case ICSSSelectorCombinator.CHILD :
- case ICSSSelectorCombinator.ADJACENT :
- if (chunkStartElement != null && chunkStartElement != element) {
- // previous conbinator must be DESCENDENT.
- // goto parent
- target = getParentElement(chunkStartElement);
- iItem = chunkStartItem + 1;
- chunkStartElement = null;
- chunkStartItem = -1;
- break;
- }
- default :
- // other combinators are not supported yet.
- return false;
- }
- }
- }
- else if (item instanceof ICSSSelectorCombinator) {
- // Combinator ( "+", ">", " ", ...)
- if (iItem == numItems - 1)
- return false; // last item is combinator
-
- ICSSSelectorCombinator sc = (ICSSSelectorCombinator) item;
- combinatorType = sc.getCombinatorType();
- switch (combinatorType) {
- case ICSSSelectorCombinator.DESCENDANT :
- target = getParentElement(target);
- break;
- case ICSSSelectorCombinator.CHILD :
- case ICSSSelectorCombinator.ADJACENT :
- if (chunkStartElement == null) {
- chunkStartElement = target;
- chunkStartItem = iItem + 1; // safe because this
- // is not a last item.
- }
- if (combinatorType == ICSSSelectorCombinator.CHILD) {
- target = getParentElement(target);
- }
- else {
- target = getPreviousElement(target);
- }
- break;
- }
- }
- else {
- // what is this item ???
- return false;
- }
- }
- // OK this selector maches the element.
- return true;
-
- }
-
- /**
- * @return boolean
- */
- private boolean matchExactly(ICSSSimpleSelector selector, Element element, String pseudoName) {
- IStyleSelectorAdapter adapter = (IStyleSelectorAdapter) ((INodeNotifier) element).getAdapterFor(IStyleSelectorAdapter.class);
- if (adapter != null) {
- return adapter.match(selector, element, pseudoName);
- }
-
- if (element == null)
- return false;
- int i;
- String key;
-
- // TODO: PseudoName
-
- // check tag name
- if (!selector.isUniversal() && !element.getNodeName().equals(selector.getName()))
- return false;
-
- // check id
- i = selector.getNumOfIDs();
- if (i > 0) {
- if (i > 1)
- return false;
- key = element.getAttribute("id");//$NON-NLS-1$
- if (key == null)
- return false;
- if (!selector.getID(0).equals(key))
- return false;
- }
-
- // check class
- i = selector.getNumOfClasses();
- if (i > 0) {
- key = element.getAttribute("class");//$NON-NLS-1$
- if (key == null)
- return false;
- StringTokenizer tokenizer = new StringTokenizer(key);
- for (i = i - 1; i >= 0; i--) {
- boolean ok = false;
- while (tokenizer.hasMoreTokens()) {
- if (selector.getClass(i).equals(tokenizer.nextToken())) {
- ok = true;
- break;
- }
- }
- if (!ok)
- return false;
- }
- }
-
- // check attributes
- for (i = selector.getNumOfAttributes() - 1; i >= 0; i--) {
- StringTokenizer tokenizer = new StringTokenizer(selector.getAttribute(i), "=~| \t\r\n\f");//$NON-NLS-1$
- int countTokens = tokenizer.countTokens();
- if (countTokens > 0) {
- String attrValue = element.getAttribute(tokenizer.nextToken());
- if (attrValue == null)
- return false;
- if (countTokens > 1) {
- String token = tokenizer.nextToken("= \t\r\n\f");//$NON-NLS-1$
- StringTokenizer attrValueTokenizer = null;
- if (token.equals("~")) {//$NON-NLS-1$
- attrValueTokenizer = new StringTokenizer(attrValue);
- }
- else if (token.equals("|")) {//$NON-NLS-1$
- attrValueTokenizer = new StringTokenizer(attrValue, "-");//$NON-NLS-1$
- }
- if (attrValueTokenizer != null) {
- if (tokenizer.hasMoreTokens()) {
- token = tokenizer.nextToken();
- boolean ok = false;
- while (attrValueTokenizer.hasMoreTokens()) {
- if (token.equals(attrValueTokenizer.nextToken())) {
- ok = true;
- break;
- }
- }
- if (!ok)
- return false;
- }
- }
- else {
- if (!attrValue.equals(token))
- return false;
- }
- }
- }
- }
-
- return true;
- }
-
- private List parseSelector(List tokens) {
- CSSSelectorParser parser = new CSSSelectorParser(tokens);
- List selector = parser.getSelector();
- Iterator i = parser.getErrors();
- fParseErrors = new ArrayList();
- while (i.hasNext()) {
- fParseErrors.add(i.next());
- }
- return selector;
- }
-
- public Iterator getErrors() {
- if (fNameErrors == null) {
- fNameErrors = new ArrayList();
- Iterator iItem = getIterator();
- while (iItem.hasNext()) {
- ICSSSelectorItem item = (ICSSSelectorItem) iItem.next();
- if (item instanceof ICSSSimpleSelector) {
- if (!((ICSSSimpleSelector) item).isUniversal()) {
- String name = ((ICSSSimpleSelector) item).getName();
- if (!NameValidator.isValid(name)) {
- fNameErrors.add(item);
- }
- }
- }
- }
- }
- List errors = new ArrayList(fParseErrors);
- errors.addAll(fNameErrors);
- return errors.iterator();
- }
-
- public String toString() {
- return getString();
- }
-
- /**
- * @see ICSSSelector#getErrorCount()
- */
- public int getErrorCount() {
- int nErrors = 0;
- Iterator i = getErrors();
- while (i.hasNext()) {
- nErrors++;
- i.next();
- }
- return nErrors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java
deleted file mode 100644
index 895ecb2343..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSSelectorCombinator;
-
-/**
- *
- */
-class CSSSelectorCombinator extends CSSSelectorItem implements ICSSSelectorCombinator {
-
- char fType = ICSSSelectorCombinator.UNKNOWN;
-
- /**
- * CSSSelectorCombinator constructor comment.
- */
- public CSSSelectorCombinator(char type) {
- super();
- setCombinatorType(type);
- }
-
- /**
- * @return boolean
- * @param obj
- * java.lang.Object
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null || this.getClass() != obj.getClass())
- return false;
-
- CSSSelectorCombinator foreign = (CSSSelectorCombinator) obj;
-
- return (getCombinatorType() == foreign.getCombinatorType());
-
- }
-
- /**
- * @return int
- */
- public char getCombinatorType() {
- return fType;
- }
-
- /**
- * @return int
- */
- public int getItemType() {
- return COMBINATOR;
- }
-
- /**
- * @return java.lang.String
- */
- public String getString() {
- StringBuffer buf = new StringBuffer();
- buf.append(fType);
- return buf.toString();
- }
-
- void setCombinatorType(char type) {
- fType = type;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java
deleted file mode 100644
index 721b3a31a6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSSelectorItem;
-
-/**
- *
- */
-abstract class CSSSelectorItem implements ICSSSelectorItem {
-
- /**
- * CSSSelectorItem constructor comment.
- */
- public CSSSelectorItem() {
- super();
- }
-
- /**
- * @return int
- */
- public int getItemType() {
- return 0;
- }
-
- /**
- * @return java.lang.String
- */
- public String getString() {
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java
deleted file mode 100644
index f6faac4d92..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.document.ICSSSelector;
-import org.eclipse.wst.css.core.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.parser.CSSTextParser;
-import org.eclipse.wst.css.core.parser.CSSTextToken;
-import org.w3c.dom.Element;
-
-
-/**
- *
- */
-public class CSSSelectorListImpl implements ICSSSelectorList {
-
- private String fText = null;
- private String fCachedString = null; // normalized string
- private List fSelectors = null;
-
- public CSSSelectorListImpl(String cssText) {
- super();
- fText = cssText;
- parseSelectorText();
- }
-
- /**
- * @return boolean
- * @param obj
- * java.lang.Object
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null || this.getClass() != obj.getClass())
- return false;
-
- CSSSelectorListImpl foreign = (CSSSelectorListImpl) obj;
-
- if (getLength() != foreign.getLength())
- return false;
-
- for (int i = 0; i < getLength(); i++) {
- if (!getSelector(i).equals(foreign.getSelector(i)))
- return false;
- }
-
- return true;
- }
-
- /**
- * @return java.util.Iterator
- */
- public Iterator getIterator() {
- return getSelectors().iterator();
- }
-
- /**
- * @return int
- */
- public int getLength() {
- return getSelectors().size();
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSSelector
- * @param index
- * int
- */
- public ICSSSelector getSelector(int index) {
- List selectors = getSelectors();
- if (0 <= index && index < selectors.size()) {
- return (ICSSSelector) selectors.get(index);
- }
- else {
- return null;
- }
- }
-
- private List getSelectors() {
- if (fSelectors == null) {
- parseSelectorText();
- }
- return fSelectors;
- }
-
- /**
- * @return java.lang.String
- */
- public String getString() {
- if (fCachedString == null) {
- StringBuffer buf = new StringBuffer();
- boolean bFirst = true;
- // groups is list of comma-separated selectors
- Iterator i = getSelectors().iterator();
- while (i.hasNext()) {
- if (!bFirst) {
- buf.append(", ");//$NON-NLS-1$
- }
- ICSSSelector item = (ICSSSelector) i.next();
- buf.append(item.getString());
- bFirst = false;
- }
- fCachedString = buf.toString();
- }
- return fCachedString;
- }
-
- /**
- * @return boolean
- * @param element
- * org.w3c.dom.Element
- */
- public boolean match(Element element, String pseudoName) {
- int nSelectors = getLength();
- selectorListLoop : for (int iSelector = 0; iSelector < nSelectors; iSelector++) {
- // Check each Selector Lists
- ICSSSelector selector = getSelector(iSelector);
- if (selector.match(element, pseudoName))
- return true;
- }
- return false;
- }
-
- /**
- *
- */
- private void parseSelectorText() {
- fSelectors = new ArrayList();
- if (fText == null) {
- return;
- }
-
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_STYLESHEET, fText);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return;
- }
-
- List tokenGroup = new ArrayList();
- for (int i = 0; i < tokens.length; i++) {
- CSSTextToken token = tokens[i];
- if (token.kind == CSSRegionContexts.CSS_SELECTOR_SEPARATOR && 0 < tokenGroup.size()) {
- ICSSSelector selector = new CSSSelector(tokenGroup);
- if (selector != null) {
- fSelectors.add(selector);
- }
- tokenGroup.clear();
- }
- else {
- tokenGroup.add(tokens[i]);
- }
- }
- if (0 < tokenGroup.size()) {
- ICSSSelector selector = new CSSSelector(tokenGroup);
- if (selector != null) {
- fSelectors.add(selector);
- }
- }
- }
-
- /**
- *
- */
- public String toString() {
- return getString();
- }
-
- /**
- *
- */
- public Iterator getErrors() {
- List errors = new ArrayList();
- Iterator iSelector = getSelectors().iterator();
- while (iSelector.hasNext()) {
- Iterator iError = ((ICSSSelector) iSelector.next()).getErrors();
- while (iError.hasNext()) {
- errors.add(iError.next());
- }
- }
- return errors.iterator();
- }
-
- /**
- *
- */
- public int getErrorCount() {
- int nErrors = 0;
- Iterator i = getErrors();
- while (i.hasNext()) {
- nErrors++;
- i.next();
- }
- return nErrors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java
deleted file mode 100644
index 1e9117e4c2..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.document.ICSSSelectorCombinator;
-import org.eclipse.wst.css.core.document.ICSSSelectorItem;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.parser.CSSTextToken;
-
-
-/**
- *
- */
-public class CSSSelectorParser {
-
- private final static int IDLE = 0;
- private final static int ATTRIBUTE = 1;
- private final static int SIMPLE = 2;
-
- private List fTokens = null;
- private List fItems = null;
- private List fErrors = null;
-
- /**
- *
- */
- CSSSelectorParser(List tokens) {
- super();
- fTokens = new ArrayList(tokens);
- }
-
- /**
- *
- */
- List getSelector() {
- if (fItems == null) {
- parseSelector();
- }
- return fItems;
- }
-
- /**
- *
- */
- private void parseSelector() {
- fItems = new ArrayList();
-
- List attrBuf = null;
- CSSSimpleSelector item = null;
-
- int status = IDLE;
- Iterator i = fTokens.iterator();
- while (i.hasNext()) {
- CSSTextToken token = (CSSTextToken) i.next();
- if (token == null || token.kind == CSSRegionContexts.CSS_S || token.kind == CSSRegionContexts.CSS_COMMENT) {
- continue;
- }
- switch (status) {
- case IDLE :
- if (isTag(token)) {
- item = createSimple();
- appendTag(item, token);
- status = SIMPLE;
- }
- else if (isID(token)) {
- item = createSimple();
- appendID(item, token);
- status = SIMPLE;
- }
- else if (isClass(token)) {
- item = createSimple();
- appendClass(item, token);
- status = SIMPLE;
- }
- else if (isPseudo(token)) {
- item = createSimple();
- appendPseudo(item, token);
- status = SIMPLE;
- }
- else if (isAttributeBegin(token)) {
- item = createSimple();
- status = ATTRIBUTE;
- }
- else {
- addError(token);
- }
- break;
- case SIMPLE :
- if (isID(token)) {
- appendID(item, token);
- }
- else if (isClass(token)) {
- appendClass(item, token);
- }
- else if (isPseudo(token)) {
- appendPseudo(item, token);
- }
- else if (isAttributeBegin(token)) {
- status = ATTRIBUTE;
- }
- else if (isCombinator(token)) { // combinator
- closeItem(item);
- closeItem(createCombinator(token));
- status = IDLE;
- }
- else {
- addError(token);
- }
- break;
- case ATTRIBUTE :
- if (isAttributeEnd(token)) {
- appendAttribute(item, attrBuf);
- attrBuf = null;
- status = SIMPLE;
- }
- else {
- if (attrBuf == null) {
- attrBuf = new ArrayList();
- }
- attrBuf.add(token);
- if (!isAttributeContent(token)) {
- addError(token);
- }
- }
- break;
- default :
- break;
- }
- }
-
- closeItem(item);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isAttributeContent(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isAttributeEnd(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isAttributeBegin(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isCombinator(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_COMBINATOR);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isPseudo(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_PSEUDO);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isClass(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_CLASS);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isID(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_ID);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isTag(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_UNIVERSAL || type == CSSRegionContexts.CSS_UNKNOWN);
- }
-
- private CSSSimpleSelector createSimple() {
- return new CSSSimpleSelector();
- }
-
- /**
- * if " " or "+" or ">" appeared, close simpleselector and add new
- * combinator
- */
- private CSSSelectorCombinator createCombinator(CSSTextToken token) {
- char type = 0;
-
- String str = token.image;
- if (str.trim().length() == 0) { // space
- type = ICSSSelectorCombinator.DESCENDANT;
- }
- else if (str.equals("+")) { //$NON-NLS-1$
- type = ICSSSelectorCombinator.ADJACENT;
- }
- else if (str.equals(">")) { //$NON-NLS-1$
- type = ICSSSelectorCombinator.CHILD;
- }
-
- if (0 < type) {
- return new CSSSelectorCombinator(type);
- }
- else {
- return null;
- }
- }
-
- /**
- *
- */
- private void closeItem(ICSSSelectorItem item) {
- if (item != null) {
- fItems.add(item);
- }
- }
-
- private void appendTag(CSSSimpleSelector item, CSSTextToken token) {
- item.setName(token.image);
- if (token.kind == CSSRegionContexts.CSS_UNKNOWN) {
- addError(token);
- }
- }
-
- /**
- * if "#xxxx" appeared, add ID to current selector
- */
- private void appendID(CSSSimpleSelector item, CSSTextToken token) {
- String text = token.toString();
- String idContent = text.substring(1, text.length());
- item.addID(idContent);
- }
-
- /**
- * if ".xxxx" appeared, add Class to current selector
- */
- private void appendClass(CSSSimpleSelector item, CSSTextToken token) {
- String text = token.toString();
- String classContent = text.substring(1, text.length());
- item.addClass(classContent);
- if (Character.isDigit(classContent.charAt(0))) {
- addError(token);
- }
- }
-
- /**
- * if ":xxxx" appeared, add Pseudo(element/class) to current selector
- */
- private void appendPseudo(CSSSimpleSelector item, CSSTextToken token) {
- String text = token.toString();
- String pseudoContent = text.substring(1, text.length());
- item.addPseudoName(pseudoContent);
- }
-
- /**
- *
- */
- private void appendAttribute(CSSSimpleSelector item, List tokens) {
- StringBuffer buf = new StringBuffer();
-
- CSSTextToken token;
- Iterator i = tokens.iterator();
- while (i.hasNext()) {
- token = (CSSTextToken) i.next();
- buf.append(token.image);
- }
-
- item.addAttribute(buf.toString());
- }
-
- /**
- *
- */
- List getSelectorTags() {
- List tagList = new ArrayList();
- return tagList;
- }
-
- /**
- *
- */
- private void addError(CSSTextToken token) {
- if (fErrors == null) {
- fErrors = new ArrayList();
- }
- fErrors.add(token);
- }
-
- /**
- *
- */
- Iterator getErrors() {
- return (fErrors == null) ? Collections.EMPTY_LIST.iterator() : fErrors.iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java
deleted file mode 100644
index b7d3f4e63e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.document.ICSSSimpleSelector;
-
-
-/**
- *
- */
-class CSSSimpleSelector extends CSSSelectorItem implements ICSSSimpleSelector {
-
- private String fName = null;
- private String fCachedString = null;
- private StringBuffer fStringBuf = null;
- private List fPseudoName = null;
- private List fAttribute = null;
- private List fClass = null;
- private List fID = null;
-
- /**
- * CSSSimpleSelector constructor comment.
- */
- public CSSSimpleSelector() {
- super();
- }
-
- /**
- *
- */
- void addAttribute(String attribute) {
- if (fAttribute == null) {
- fAttribute = new ArrayList();
- }
- fAttribute.add(attribute);
- addToBuf("[");//$NON-NLS-1$
- addToBuf(attribute);
- addToBuf("]");//$NON-NLS-1$
- fCachedString = null;
- }
-
- /**
- *
- */
- void addClass(String cls) {
- if (fClass == null) {
- fClass = new ArrayList();
- }
- fClass.add(cls);
- addToBuf(".");//$NON-NLS-1$
- addToBuf(cls);
- fCachedString = null;
- }
-
- /**
- *
- */
- void addID(String id) {
- if (fID == null) {
- fID = new ArrayList();
- }
- fID.add(id);
- addToBuf("#");//$NON-NLS-1$
- addToBuf(id);
- fCachedString = null;
- }
-
- /**
- *
- */
- void addPseudoName(String cls) {
- if (fPseudoName == null) {
- fPseudoName = new ArrayList();
- }
- fPseudoName.add(cls);
- addToBuf(":");//$NON-NLS-1$
- addToBuf(cls);
- fCachedString = null;
- }
-
- /**
- *
- */
- private void addToBuf(String str) {
- if (fStringBuf == null) {
- fStringBuf = new StringBuffer();
- }
- fStringBuf.append(str);
- }
-
- /**
- * @return boolean
- * @param obj
- * java.lang.Object
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null || this.getClass() != obj.getClass())
- return false;
-
- CSSSimpleSelector foreign = (CSSSimpleSelector) obj;
-
- if (getName().compareToIgnoreCase(foreign.getName()) != 0)
- return false;
-
- int i;
-
- // compare pseudo-classes / pseudo-elements
- if (getNumOfPseudoNames() != foreign.getNumOfPseudoNames())
- return false;
- for (i = 0; i < getNumOfPseudoNames(); i++) {
- if (getPseudoName(i).compareToIgnoreCase(foreign.getPseudoName(i)) != 0)
- return false;
- }
-
- // compare classes
- if (getNumOfClasses() != foreign.getNumOfClasses())
- return false;
- for (i = 0; i < getNumOfClasses(); i++) {
- if (getClass(i).compareToIgnoreCase(foreign.getClass(i)) != 0)
- return false;
- }
-
- // compare IDs
- if (getNumOfIDs() != foreign.getNumOfIDs())
- return false;
- for (i = 0; i < getNumOfIDs(); i++) {
- if (getID(i).compareToIgnoreCase(foreign.getID(i)) != 0)
- return false;
- }
-
- // compare Attributes
- if (getNumOfAttributes() != foreign.getNumOfAttributes())
- return false;
- for (i = 0; i < getNumOfAttributes(); i++) {
- if (getAttribute(i).compareToIgnoreCase(foreign.getAttribute(i)) != 0)
- return false;
- }
- return true;
- }
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- public String getAttribute(int index) {
- if (fAttribute != null && 0 <= index && index < fAttribute.size()) {
- return (String) fAttribute.get(index);
- }
- else {
- return "";//$NON-NLS-1$
- }
- }
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- public String getClass(int index) {
- if (fClass != null && 0 <= index && index < fClass.size()) {
- return (String) fClass.get(index);
- }
- else {
- return "";//$NON-NLS-1$
- }
- }
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- public String getID(int index) {
- if (fID != null && 0 <= index && index < fID.size()) {
- return (String) fID.get(index);
- }
- else {
- return "";//$NON-NLS-1$
- }
- }
-
- /**
- * @return int
- */
- public int getItemType() {
- return SIMPLE;
- }
-
- /**
- * @return java.lang.String
- */
- public String getName() {
- return (fName != null) ? fName : "";//$NON-NLS-1$
- }
-
- /**
- * @return boolean
- */
- public int getNumOfAttributes() {
- return (fAttribute != null) ? fAttribute.size() : 0;
- }
-
- /**
- * @return boolean
- */
- public int getNumOfClasses() {
- return (fClass != null) ? fClass.size() : 0;
- }
-
- /**
- * @return boolean
- */
- public int getNumOfIDs() {
- return (fID != null) ? fID.size() : 0;
- }
-
- /**
- * @return boolean
- */
- public int getNumOfPseudoNames() {
- return (fPseudoName != null) ? fPseudoName.size() : 0;
- }
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- public String getPseudoName(int index) {
- if (fPseudoName != null && 0 <= index && index < fPseudoName.size()) {
- return (String) fPseudoName.get(index);
- }
- else {
- return "";//$NON-NLS-1$
- }
- }
-
- /**
- * @return java.lang.String
- */
- public String getString() {
- if (fCachedString == null) {
- StringBuffer buf = new StringBuffer(getName());
- if (fStringBuf != null) {
- buf.append(fStringBuf.toString());
- }
- fCachedString = buf.toString();
- }
- return fCachedString;
- }
-
- /**
- * @return boolean
- */
- public boolean isUniversal() {
- return (fName == null || fName.equals("*"));//$NON-NLS-1$
- }
-
- /**
- *
- */
- void setName(String name) {
- fName = name;
- fCachedString = null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java
deleted file mode 100644
index 946c66afc5..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-
-/**
- *
- */
-abstract class CSSStructuredDocumentRegionContainer extends CSSNodeImpl {
-
- private IStructuredDocumentRegion firstStructuredDocumentRegion = null;
- private IStructuredDocumentRegion lastStructuredDocumentRegion = null;
-
- /**
- * CSSContainer constructor comment.
- */
- CSSStructuredDocumentRegionContainer() {
- super();
- }
-
- /**
- * CSSContainer constructor comment.
- *
- * @param that
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- */
- CSSStructuredDocumentRegionContainer(CSSStructuredDocumentRegionContainer that) {
- super(that);
- }
-
- /**
- * @return java.lang.String
- */
- public String getCssText() {
- if (getFirstStructuredDocumentRegion() == null)
- return generateSource();
-
- StringBuffer str = new StringBuffer(getFirstStructuredDocumentRegion().getText());
- IStructuredDocumentRegion node = getFirstStructuredDocumentRegion();
-
- while (node != getLastStructuredDocumentRegion()) {
- node = node.getNext();
- str.append(node.getText());
- }
-
- return str.toString();
- }
-
- /**
- * @return int
- */
- public int getEndOffset() {
- IStructuredDocumentRegion flatNode = getLastStructuredDocumentRegion();
- if (flatNode != null)
- return flatNode.getEnd();
- return -1;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.IStructuredDocumentRegion
- */
- IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
- return firstStructuredDocumentRegion;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.IStructuredDocumentRegion
- * @param index
- * int
- */
- IStructuredDocumentRegion getStructuredDocumentRegion(int index) {
- IStructuredDocumentRegion node = firstStructuredDocumentRegion;
- for (int i = index; i > 0; i--) {
- if (node == null)
- return null;
- node = node.getNext();
- }
- return node;
- }
-
- /**
- * @return int
- */
- int getStructuredDocumentRegionCount() {
- if (firstStructuredDocumentRegion == null)
- return 0;
-
- IStructuredDocumentRegion node = firstStructuredDocumentRegion;
- int i = 0;
- for (; node != null; i++)
- node = node.getNext();
- return i;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.IStructuredDocumentRegion
- */
- IStructuredDocumentRegion getLastStructuredDocumentRegion() {
- return lastStructuredDocumentRegion;
- }
-
- /**
- * @return int
- */
- public int getStartOffset() {
- IStructuredDocumentRegion flatNode = getFirstStructuredDocumentRegion();
- if (flatNode != null)
- return flatNode.getStart();
- return -1;
- }
-
- /**
- * @param first
- * com.ibm.sed.structuredDocument.core.IStructuredDocumentRegion
- * @param last
- * com.ibm.sed.structuredDocument.core.IStructuredDocumentRegion
- */
- boolean includeRangeStructuredDocumentRegion(IStructuredDocumentRegion first, IStructuredDocumentRegion last) {
- boolean bModified = false;
-
- // validate range of parameters
- if (first != null && last != null) {
- if (first.getStart() > last.getStart()) {
- IStructuredDocumentRegion node = first;
- first = last;
- last = node;
- }
- }
-
- // validate mine
- boolean b = validateRange();
- bModified = b || bModified;
-
- if (first != null) {
- if (getFirstStructuredDocumentRegion() == null || getFirstStructuredDocumentRegion().getStart() > first.getStart()) {
- setFirstStructuredDocumentRegion(first);
- bModified = true;
- }
- }
-
- if (last != null) {
- if (getLastStructuredDocumentRegion() == null || getLastStructuredDocumentRegion().getStart() < last.getStart()) {
- setLastStructuredDocumentRegion(last);
- bModified = true;
- }
- }
-
- // re-validate
- if (bModified)
- validateRange();
-
- return bModified;
- }
-
- /**
- *
- */
- boolean propagateRangeStructuredDocumentRegion() {
- boolean bModified = false;
-
- CSSStructuredDocumentRegionContainer parent = (CSSStructuredDocumentRegionContainer) getParentNode();
- if (parent == null)
- return bModified;
-
- boolean b = parent.includeRangeStructuredDocumentRegion(getFirstStructuredDocumentRegion(), getLastStructuredDocumentRegion());
- bModified = b || bModified;
-
- if (b)
- parent.propagateRangeStructuredDocumentRegion();
- // else need not update range of ancestors
-
- return bModified;
- }
-
- /**
- * @param cssText
- * java.lang.String
- */
- public void setCssText(String cssText) {
- if (firstStructuredDocumentRegion != null) {
- getOwnerDocument().getModel().getStructuredDocument().replaceText(this, getStartOffset(), getEndOffset() - getStartOffset(), cssText);
- }
- else
- super.setCssText(cssText);
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.core.IStructuredDocumentRegion
- * @param node
- * com.ibm.sed.structuredDocument.core.IStructuredDocumentRegion
- */
- IStructuredDocumentRegion setFirstStructuredDocumentRegion(IStructuredDocumentRegion node) {
- firstStructuredDocumentRegion = node;
- return node;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.core.IStructuredDocumentRegion
- * @param node
- * com.ibm.sed.structuredDocument.core.IStructuredDocumentRegion
- */
- IStructuredDocumentRegion setLastStructuredDocumentRegion(IStructuredDocumentRegion node) {
- lastStructuredDocumentRegion = node;
- return node;
- }
-
- /**
- * @param firstNode
- * com.ibm.sed.structuredDocument.core.IStructuredDocumentRegion
- * @param lastNode
- * com.ibm.sed.structuredDocument.core.IStructuredDocumentRegion
- */
- void setRangeStructuredDocumentRegion(IStructuredDocumentRegion firstNode, IStructuredDocumentRegion lastNode) {
- if (firstNode != null)
- setFirstStructuredDocumentRegion(firstNode);
- if (lastNode != null)
- setLastStructuredDocumentRegion(lastNode);
-
- if (firstNode == null && lastNode == null) {
- setFirstStructuredDocumentRegion(null);
- setLastStructuredDocumentRegion(null);
- }
- else { // range validation
- validateRange();
- }
- }
-
- /**
- * @return boolean
- */
- private boolean validateRange() {
- boolean bModified = false;
-
- if (firstStructuredDocumentRegion != null || lastStructuredDocumentRegion != null) {
- if (this.firstStructuredDocumentRegion == null) {
- this.firstStructuredDocumentRegion = this.lastStructuredDocumentRegion;
- bModified = true;
- }
- else if (this.lastStructuredDocumentRegion == null) {
- this.lastStructuredDocumentRegion = this.firstStructuredDocumentRegion;
- bModified = true;
- }
- else if (this.firstStructuredDocumentRegion.getStart() > this.lastStructuredDocumentRegion.getStart()) {
- // need to swap first for last
- IStructuredDocumentRegion node = firstStructuredDocumentRegion;
- firstStructuredDocumentRegion = lastStructuredDocumentRegion;
- lastStructuredDocumentRegion = node;
- bModified = true;
- }
- }
-
- return bModified;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
deleted file mode 100644
index 0bd3c4c03d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentLoader;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceGenerator;
-import org.eclipse.wst.css.core.internal.formatter.StyleDeclItemFormatter;
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.core.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- *
- */
-class CSSStyleDeclItemImpl extends CSSStructuredDocumentRegionContainer implements ICSSStyleDeclItem {
-
- private java.lang.String fPropertyName;
-
- /**
- * CSSStyleDeclItemImpl constructor comment.
- *
- * @param that
- * com.ibm.sed.css.treemodel.CSSNodeImpl
- */
- CSSStyleDeclItemImpl(CSSStyleDeclItemImpl that) {
- super(that);
- this.fPropertyName = that.fPropertyName;
- }
-
- /**
- * CSSStyleDeclItemImpl constructor comment.
- */
- CSSStyleDeclItemImpl(String propertyName) {
- super();
- this.fPropertyName = propertyName;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- public ICSSPrimitiveValue appendValue(ICSSPrimitiveValue value) throws DOMException {
- return insertValueBefore(value, null);
- }
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSStyleDeclItemImpl cloned = new CSSStyleDeclItemImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return java.lang.String
- */
- String generateValueSource() {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(this);
- if (formatter != null && formatter instanceof StyleDeclItemFormatter)
- return ((StyleDeclItemFormatter) formatter).formatValue(this).toString();
- else
- return "";//$NON-NLS-1$
- }
-
- /**
- * @return org.w3c.dom.css.CSSValue
- */
- public CSSValue getCSSValue() {
- int nValue = getLength();
- if (nValue <= 0)
- return null;
- else if (nValue == 1)
- return item(0);
- else
- return this;
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getCSSValueText() {
- if (getFirstChild() == null)
- return "";//$NON-NLS-1$
- // check whether children has flatnodes
- ICSSNode child = getFirstChild();
- while (child != null) {
- if (((IndexedRegion) child).getEndOffset() <= 0)
- return generateValueSource();
- child = child.getNextSibling();
- }
-
- IStructuredDocumentRegion node = getFirstStructuredDocumentRegion();
- int start = ((IndexedRegion) getFirstChild()).getStartOffset() - node.getStartOffset();
- int end = ((IndexedRegion) getLastChild()).getEndOffset() - node.getStartOffset();
- return node.getText().substring(start, end);
- }
-
- /**
- * @return short
- */
- public short getCssValueType() {
- return CSS_VALUE_LIST;
- }
-
- /**
- * @return int
- */
- public int getLength() {
- int i = 0;
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSPrimitiveValueImpl)
- i++;
- }
- return i;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return STYLEDECLITEM_NODE;
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getPriority() {
- return getAttribute(IMPORTANT);
- }
-
- /**
- * @return java.lang.String
- */
- public String getPropertyName() {
- return fPropertyName.trim().toLowerCase();
- }
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param newValue
- * org.w3c.dom.css.CSSPrimitiveValue
- * @param refValue
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- ICSSPrimitiveValue insertValueBefore(ICSSPrimitiveValue newValue, ICSSPrimitiveValue refValue) {
- ICSSNode node = insertBefore((CSSNodeImpl) newValue, (CSSNodeImpl) refValue);
- return (ICSSPrimitiveValue) node;
- }
-
- /**
- * @return org.w3c.dom.css.CSSValue
- * @param index
- * int
- */
- public CSSValue item(int index) {
- int i = 0;
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSPrimitiveValueImpl) {
- if (i++ == index)
- return (CSSValue) node;
- }
- }
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- public ICSSPrimitiveValue removeValue(ICSSPrimitiveValue value) throws DOMException {
- ICSSNode node = removeChild((CSSNodeImpl) value);
- return (ICSSPrimitiveValue) node;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param newValue
- * org.w3c.dom.css.CSSPrimitiveValue
- * @param oldValue
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- public ICSSPrimitiveValue replaceValue(ICSSPrimitiveValue newValue, ICSSPrimitiveValue oldValue) throws DOMException {
- if (oldValue == null)
- return newValue;
- if (newValue != null)
- insertValueBefore(newValue, oldValue);
- return removeValue(oldValue);
- }
-
- /**
- * @param value
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public void setCssValueText(String value) throws DOMException {
- ICSSNode child = getFirstChild();
- while (child != null) {
- ICSSNode next = child.getNextSibling();
- if (child instanceof ICSSPrimitiveValue) {
- removeChild((CSSNodeImpl) child);
- }
- child = next;
- }
-
- // use temporary document
- IDocumentLoader loader = new CSSDocumentLoader();
- IStructuredDocument structuredDocument = (IStructuredDocument) loader.createNewStructuredDocument();
- ((CSSSourceParser) structuredDocument.getParser()).setParserMode(CSSSourceParser.MODE_DECLARATION_VALUE);
- structuredDocument.set(value);
- IStructuredDocumentRegion node = structuredDocument.getFirstStructuredDocumentRegion();
- if (node == null) {
- return;
- }
- if (node.getNext() != null) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
-
- CSSDeclarationItemParser itemParser = new CSSDeclarationItemParser(getOwnerDocument());
- itemParser.setStructuredDocumentTemporary(true);
- itemParser.setupValues(this, node, node.getRegions());
- }
-
- /**
- * @param newPriority
- * java.lang.String
- */
- public void setPriority(java.lang.String newPriority) throws DOMException {
- setAttribute(IMPORTANT, newPriority);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java
deleted file mode 100644
index bda0b4dd22..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSDocument;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclaration;
-
-public abstract class CSSStyleDeclarationFactoryContext {
-
- protected ICSSDocument fOwnerDocument = null;
-
- /**
- *
- */
- protected void cloneChildNodes(ICSSNode src, ICSSNode dest) {
- if (fOwnerDocument == null) {
- return;
- }
- if (!(dest instanceof CSSNodeImpl)) {
- return;
- }
-
- CSSNodeImpl container = (CSSNodeImpl) dest;
- container.removeChildNodes();
-
- for (ICSSNode child = src.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child instanceof CSSStyleDeclItemImpl) {
- // extract shorthand property ..
- // --> Temp
- ICSSNode cloned = child.cloneNode(false);
- if (cloned instanceof CSSNodeImpl) {
- ((CSSNodeImpl) cloned).setOwnerDocument(fOwnerDocument);
- container.appendChild((CSSNodeImpl) cloned);
- cloneChildNodes(child, cloned);
- }
- // <-- Temp
- }
- else {
- ICSSNode cloned = child.cloneNode(false);
- if (cloned instanceof CSSNodeImpl) {
- ((CSSNodeImpl) cloned).setOwnerDocument(fOwnerDocument);
- container.appendChild((CSSNodeImpl) cloned);
- cloneChildNodes(child, cloned);
- }
- }
- }
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclaration
- */
- public ICSSStyleDeclaration createStyleDeclaration() {
- CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(true);
- decl.setOwnerDocument(decl);
- return decl;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java
deleted file mode 100644
index 9d2c6db06b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.document.ICSSValue;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- *
- */
-class CSSStyleDeclarationImpl extends CSSDocumentImpl implements ICSSStyleDeclaration {
-
- private boolean fIsDocument;
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSStyleDeclBlockImpl
- */
- CSSStyleDeclarationImpl(CSSStyleDeclarationImpl that) {
- super(that);
- this.fIsDocument = that.fIsDocument;
- if (fIsDocument) {
- setOwnerDocument(this);
- }
- }
-
- /**
- *
- */
- CSSStyleDeclarationImpl(boolean isDocument) {
- super();
- fIsDocument = isDocument;
- if (fIsDocument) {
- setOwnerDocument(this);
- }
- }
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSStyleDeclarationImpl cloned = new CSSStyleDeclarationImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @param propertyName
- * java.lang.String
- */
- public ICSSStyleDeclItem getDeclItemNode(String propertyName) {
- ICSSNode node = getLastChild();
- propertyName = propertyName.trim();
- while (node != null) {
- if (node instanceof CSSStyleDeclItemImpl) {
- ICSSStyleDeclItem item = (ICSSStyleDeclItem) node;
- if (propertyName.compareToIgnoreCase(item.getPropertyName().trim()) == 0)
- return item;
- }
- node = node.getPreviousSibling();
- }
- return null;
- }
-
- /**
- * @return int
- */
- public int getLength() {
- int i = 0;
- ICSSNode node = getFirstChild();
- while (node != null) {
- if (node instanceof CSSStyleDeclItemImpl)
- i++;
- node = node.getNextSibling();
- }
- return i;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return STYLEDECLARATION_NODE;
- }
-
- /**
- * The CSS rule that contains this declaration block or <code>null</code>
- * if this <code>CSSStyleDeclaration</code> is not attached to a
- * <code>CSSRule</code>.
- */
- public CSSRule getParentRule() {
- ICSSNode parent = getParentNode();
- if (parent instanceof CSSRule)
- return (CSSRule) parent;
- return null;
- }
-
- /**
- * Used to retrieve the object representation of the value of a CSS
- * property if it has been explicitly set within this declaration block.
- * This method returns <code>null</code> if the property is a shorthand
- * property. Shorthand property values can only be accessed and modified
- * as strings, using the <code>getPropertyValue</code> and
- * <code>setProperty</code> methods.
- *
- * @param propertyName
- * The name of the CSS property. See the CSS property index.
- * @return Returns the value of the property if it has been explicitly set
- * for this declaration block. Returns <code>null</code> if the
- * property has not been set.
- */
- public CSSValue getPropertyCSSValue(String propertyName) {
- ICSSStyleDeclItem item = getDeclItemNode(propertyName);
- if (item != null)
- return item.getCSSValue();
- return null;
- }
-
- /**
- * Used to retrieve the priority of a CSS property (e.g. the
- * <code>"important"</code> qualifier) if the property has been
- * explicitly set in this declaration block.
- *
- * @param propertyName
- * The name of the CSS property. See the CSS property index.
- * @return A string representing the priority (e.g.
- * <code>"important"</code>) if one exists. The empty string if
- * none exists.
- */
- public String getPropertyPriority(String propertyName) {
- ICSSStyleDeclItem item = getDeclItemNode(propertyName);
- if (item != null)
- return item.getPriority();
- return null;
- }
-
- /**
- * Used to retrieve the value of a CSS property if it has been explicitly
- * set within this declaration block.
- *
- * @param propertyName
- * The name of the CSS property. See the CSS property index.
- * @return Returns the value of the property if it has been explicitly set
- * for this declaration block. Returns the empty string if the
- * property has not been set.
- */
- public String getPropertyValue(String propertyName) {
- CSSValue value = getPropertyCSSValue(propertyName);
- if (value != null)
- return ((ICSSValue) value).getCSSValueText();
- return null;
- }
-
- /**
- * @return boolean
- */
- public boolean isDocument() {
- return fIsDocument;
- }
-
- /**
- * Used to retrieve the properties that have been explicitly set in this
- * declaration block. The order of the properties retrieved using this
- * method does not have to be the order in which they were set. This
- * method can be used to iterate over all properties in this declaration
- * block.
- *
- * @param index
- * Index of the property name to retrieve.
- * @return The name of the property at this ordinal position. The empty
- * string if no property exists at this position.
- */
- public String item(int index) {
- if (index < 0)
- return null;
-
- int i = 0;
- ICSSNode node = getFirstChild();
- while (node != null) {
- if (node instanceof CSSStyleDeclItemImpl) {
- if (i != index)
- i++;
- else {
- CSSStyleDeclItemImpl item = (CSSStyleDeclItemImpl) node;
- return item.getPropertyName();
- }
- }
- node = node.getNextSibling();
- }
- return null;
- }
-
- /**
- * @return com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @param oldDecl
- * com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public ICSSStyleDeclItem removeDeclItemNode(ICSSStyleDeclItem oldDecl) throws DOMException {
- return (ICSSStyleDeclItem) removeChild((CSSNodeImpl) oldDecl);
- }
-
- /**
- * Used to remove a CSS property if it has been explicitly set within this
- * declaration block.
- *
- * @param propertyName
- * The name of the CSS property. See the CSS property index.
- * @return Returns the value of the property if it has been explicitly set
- * for this declaration block. Returns the empty string if the
- * property has not been set or the property name does not
- * correspond to a known CSS property.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration
- * is readonly or the property is readonly.
- */
- public String removeProperty(String propertyName) throws DOMException {
- ICSSStyleDeclItem item = getDeclItemNode(propertyName);
- if (item != null) {
- removeChild((CSSNodeImpl) item);
- return item.getCssText();
- }
- return null;
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/01/16
- * 23:18:51)
- *
- * @return com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @param newDecl
- * com.ibm.sed.treemodel.cei.CSSStyleDeclItem
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public ICSSStyleDeclItem setDeclItemNode(ICSSStyleDeclItem newDecl) throws DOMException {
- if (newDecl == null)
- return null;
-
- ICSSStyleDeclItem item = getDeclItemNode(newDecl.getPropertyName());
- if (item != null)
- return (ICSSStyleDeclItem) replaceChild((CSSNodeImpl) newDecl, (CSSNodeImpl) item);
- else
- return (ICSSStyleDeclItem) appendChild((CSSNodeImpl) newDecl);
- }
-
- /**
- * Used to set a property value and priority within this declaration
- * block.
- *
- * @param propertyName
- * The name of the CSS property. See the CSS property index.
- * @param value
- * The new value of the property.
- * @param priority
- * The new priority of the property (e.g.
- * <code>"important"</code>).
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified value has a syntax
- * error and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration
- * is readonly or the property is readonly.
- */
- public void setProperty(String propertyName, String value, String priority) throws DOMException {
- if (propertyName.equals("")) //$NON-NLS-1$
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); //$NON-NLS-1$
-
- // You can use this only if CSSValue.setCssText() is implemented
- CSSStyleDeclItemImpl item = (CSSStyleDeclItemImpl) getDeclItemNode(propertyName);
- if (item == null) {
- item = (CSSStyleDeclItemImpl) getOwnerDocument().createCSSStyleDeclItem(propertyName);
- appendChild(item);
- }
-
- // ICSSNode next = item.getNextSibling();
- // removeChild(item);
-
- item.setCssValueText(value);
- item.setPriority(priority);
-
- // insertBefore(item, (CSSNodeImpl)next);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java
deleted file mode 100644
index 73bbe7f217..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.document.ICSSStyleRule;
-import org.w3c.dom.DOMException;
-
-
-/**
- *
- */
-class CSSStyleRuleImpl extends CSSRuleDeclContainer implements ICSSStyleRule {
-
- ICSSSelectorList fSelectorList = new CSSSelectorListImpl(null);
-
- /**
- *
- */
- CSSStyleRuleImpl() {
- super();
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSStyleRuleImpl
- */
- CSSStyleRuleImpl(CSSStyleRuleImpl that) {
- super(that);
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSStyleRuleImpl cloned = new CSSStyleRuleImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return java.lang.String
- */
- String extractPreString() {
- return getSelectorText();
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return STYLERULE_NODE;
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.ICSSSelectorList
- */
- public ICSSSelectorList getSelectors() {
- return fSelectorList;
- }
-
- /**
- * The textual representation of the selector for the rule set. The
- * implementation may have stripped out insignificant whitespace while
- * parsing the selector.
- *
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has
- * a syntax error and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is
- * readonly.
- */
- public String getSelectorText() {
- return getAttribute(SELECTOR);
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return STYLE_RULE;
- }
-
- /**
- *
- */
- public void setSelectorText(String selectorText) throws DOMException {
- setAttribute(SELECTOR, selectorText);
- fSelectorList = new CSSSelectorListImpl(selectorText);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java
deleted file mode 100644
index aa4c29af00..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java
+++ /dev/null
@@ -1,625 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.document.ICSSImportRule;
-import org.eclipse.wst.css.core.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSPageRule;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentLoader;
-import org.eclipse.wst.css.core.util.ImportRuleCollector;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.util.Assert;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSUnknownRule;
-import org.w3c.dom.stylesheets.MediaList;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- *
- */
-class CSSStyleSheetImpl extends CSSDocumentImpl implements ICSSStyleSheet {
-
-
- class InternalNodeList implements NodeList {
-
- Vector nodes = new Vector();
-
- public int getLength() {
- if (nodes == null)
- return 0;
- else
- return nodes.size();
- }
-
- public Node item(int i) {
- if (nodes == null)
- return null;
- if (i < 0 || nodes.size() <= i)
- return null;
- return (Node) nodes.get(i);
- }
- }
-
- class InternalStyleSheetList extends AbstractCSSNodeList implements StyleSheetList {
-
- public ICSSNode appendNode(ICSSNode node) {
- if (nodes == null || !nodes.contains(node))
- return super.appendNode(node);
- else
- return node;
- }
-
- public StyleSheet item(int i) {
- return (StyleSheet) itemImpl(i);
- }
- }
-
- private boolean fDisabled = false;
-
- /**
- *
- */
- CSSStyleSheetImpl() {
- super();
- setOwnerDocument(this);
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSStyleSheetImpl
- */
- CSSStyleSheetImpl(CSSStyleSheetImpl that) {
- super(that);
- setOwnerDocument(this);
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule appendRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
- if (rule == null)
- return null;
-
- CSSRule ret = (CSSRule) appendChild((CSSNodeImpl) rule);
- return ret;
- }
-
- /**
- * @return com.ibm.sed.treemodel.css.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSStyleSheetImpl cloned = new CSSStyleSheetImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return org.w3c.dom.css.CSSCharsetRule
- */
- public ICSSCharsetRule createCSSCharsetRule() {
- CSSCharsetRuleImpl rule = new CSSCharsetRuleImpl();
- rule.setOwnerDocument(this);
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.CSSFontFaceRule
- */
- public CSSFontFaceRule createCSSFontFaceRule() {
- CSSFontFaceRuleImpl rule = new CSSFontFaceRuleImpl();
- CSSStyleDeclarationImpl style = (CSSStyleDeclarationImpl) createCSSStyleDeclaration();
-
- rule.appendChild(style);
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.CSSImportRule
- */
- public ICSSImportRule createCSSImportRule() {
- CSSImportRuleImpl rule = new CSSImportRuleImpl();
- MediaListImpl media = (MediaListImpl) createMediaList();
-
- rule.appendChild(media);
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.ICSSMediaRule
- */
- public ICSSMediaRule createCSSMediaRule() {
- CSSMediaRuleImpl rule = new CSSMediaRuleImpl();
- MediaListImpl media = (MediaListImpl) createMediaList();
-
- rule.insertBefore(media, (CSSNodeImpl) rule.getFirstChild()); // media
- // must
- // be
- // the
- // top
- // of
- // children
- // list
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPageRule
- */
- public ICSSPageRule createCSSPageRule() {
- CSSPageRuleImpl rule = new CSSPageRuleImpl();
- CSSStyleDeclarationImpl style = (CSSStyleDeclarationImpl) createCSSStyleDeclaration();
-
- rule.appendChild(style);
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * java.lang.String
- */
- public CSSRule createCSSRule(String rule) {
- CSSDocumentLoader loader = new CSSDocumentLoader();
- IStructuredDocument structuredDocument = (IStructuredDocument) loader.createNewStructuredDocument();
- structuredDocument.set(rule);
-
- CSSModelParser modelParser = new CSSModelParser((CSSDocumentImpl) getOwnerDocument());
- return modelParser.createCSSRule(structuredDocument.getRegionList());
- }
-
- /**
- * @return org.w3c.dom.css.CSSStyleDeclaration
- */
- public ICSSStyleDeclaration createCSSStyleDeclaration() {
- CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(false);
- decl.setOwnerDocument(this);
-
- return decl;
- }
-
- /**
- * @return org.w3c.dom.css.CSSStyleRule
- */
- public ICSSStyleRule createCSSStyleRule() {
- CSSStyleRuleImpl rule = new CSSStyleRuleImpl();
- CSSStyleDeclarationImpl style = (CSSStyleDeclarationImpl) createCSSStyleDeclaration();
-
- rule.appendChild(style);
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.CSSUnknownRule
- */
- public CSSUnknownRule createCSSUnknownRule() {
- CSSUnknownRuleImpl rule = new CSSUnknownRuleImpl();
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.stylesheets.MediaList
- */
- public MediaList createMediaList() {
- MediaListImpl media = new MediaListImpl();
- media.setOwnerDocument(this);
-
- return media;
- }
-
- /**
- * Used to delete a rule from the style sheet.
- *
- * @param index
- * The index within the style sheet's rule list of the rule to
- * remove.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index does not
- * correspond to a rule in the style sheet's rule list.
- * <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet
- * is readonly.
- */
- public void deleteRule(int index) throws DOMException {
- CSSNodeImpl node = getIndexedRule(index);
- if (node != null)
- removeChild(node);
- }
-
- /**
- * The list of all CSS rules contained within the style sheet. This
- * includes both rule sets and at-rules.
- */
- public CSSRuleList getCssRules() {
- CSSRuleListImpl list = new CSSRuleListImpl();
-
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSRule) {
- list.appendNode(node);
- }
- }
-
- return list;
- }
-
- /**
- * <code>false</code> if the style sheet is applied to the document.
- * <code>true</code> if it is not. Modifying this attribute may cause a
- * new resolution of style for the document. A stylesheet only applies if
- * both an appropriate medium definition is present and the disabled
- * attribute is false. So, if the media doesn't apply to the current user
- * agent, the <code>disabled</code> attribute is ignored.
- */
- public boolean getDisabled() {
- return fDisabled;
- }
-
- /**
- * If the style sheet is a linked style sheet, the value of its attribute
- * is its location. For inline style sheets, the value of this attribute
- * is <code>null</code>. See the href attribute definition for the
- * <code>LINK</code> element in HTML 4.0, and the href pseudo-attribute
- * for the XML style sheet processing instruction.
- */
- public String getHref() {
- ICSSModel model = getModel();
- if (model != null && model.getStyleSheetType() == ICSSModel.EXTERNAL) {
- return model.getBaseLocation();
- /*
- * Object id = model.getId(); if (id != null) { if (id instanceof
- * IResource) { // TODO: need to check whether this is correct or
- * not, later. return ((IResource)id).getFullPath().toString(); }
- * return id.toString(); }
- */}
- return null;
- }
-
- /**
- * @return com.ibm.sed.css.treemodel.CSSRuleImpl
- * @param index
- * int
- */
- CSSRuleImpl getIndexedRule(int index) {
- if (index < 0)
- return null;
-
- int i = 0;
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSRule) {
- if (i++ == index)
- return (CSSRuleImpl) node;
- }
- }
- return null;
- }
-
- /**
- * The intended destination media for style information. The media is
- * often specified in the <code>ownerNode</code>. If no media has been
- * specified, the <code>MediaList</code> will be empty. See the media
- * attribute definition for the <code>LINK</code> element in HTML 4.0,
- * and the media pseudo-attribute for the XML style sheet processing
- * instruction . Modifying the media list may cause a change to the
- * attribute <code>disabled</code>.
- */
- public MediaList getMedia() {
- return null;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return STYLESHEET_NODE;
- }
-
- /**
- * The node that associates this style sheet with the document. For HTML,
- * this may be the corresponding <code>LINK</code> or <code>STYLE</code>
- * element. For XML, it may be the linking processing instruction. For
- * style sheets that are included by other style sheets, the value of this
- * attribute is <code>null</code>.
- */
- public Node getOwnerNode() {
- // for <LINK> tag or <STYLE> tag
- ICSSModel model = getModel();
- if (model != null)
- return model.getOwnerDOMNode();
- return null;
- }
-
- /**
- * @return org.w3c.dom.NodeList
- */
- public org.w3c.dom.NodeList getOwnerNodes() {
- List list = (getModel().getStyleListeners() != null) ? new Vector(getModel().getStyleListeners()) : null;
- if (list == null)
- return null;
- InternalNodeList nodes = new InternalNodeList();
- Iterator it = list.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (obj instanceof IStyleSheetAdapter) {
- nodes.nodes.add(((IStyleSheetAdapter) obj).getElement());
- }
- }
- if (nodes.getLength() > 0)
- return nodes;
- else
- return null;
- }
-
- /**
- * @return org.w3c.dom.NodeList
- * @param doc
- * org.w3c.dom.Document
- */
- public NodeList getOwnerNodes(Document doc) {
- List list = (getModel().getStyleListeners() != null) ? new Vector(getModel().getStyleListeners()) : null;
- if (list == null)
- return null;
- InternalNodeList nodes = new InternalNodeList();
- Iterator it = list.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (obj instanceof IStyleSheetAdapter) {
- Element ele = ((IStyleSheetAdapter) obj).getElement();
- if (ele.getOwnerDocument() == doc)
- nodes.nodes.add(ele);
- }
- }
- if (nodes.getLength() > 0)
- return nodes;
- else
- return null;
- }
-
- /**
- * If this style sheet comes from an <code>@import</code> rule, the <code>ownerRule</code> attribute will
- * contain the <code>CSSImportRule</code>. In that case, the
- * <code>ownerNode</code> attribute in the
- * <code>StyleSheet</code> interface will be <code>null</code>.
- * If the style sheet comes from an element or a processing
- * instruction, the <code>ownerRule</code> attribute will be
- * <code>null</code> and the <code>ownerNode</code> attribute
- * will contain the <code>Node</code>.
- */
- public CSSRule getOwnerRule() {
- Assert.isTrue(false, CSSCorePlugin.getResourceString("%You_cannot_use_CSSStyleShe_UI_")); //$NON-NLS-1$ = "You cannot use CSSStyleSheet.getOwnerRule() because of many referencers of this rule\nPlease use getOnwerRules()"
- // for @import
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRuleList
- */
- public org.w3c.dom.css.CSSRuleList getOwnerRules() {
- StyleSheetList list = getParentStyleSheets();
- if (list == null)
- return null;
- CSSRuleListImpl ruleList = new CSSRuleListImpl();
- for (int i = 0; i < list.getLength(); i++) {
- ImportRuleCollector trav = new ImportRuleCollector(this);
- trav.apply((ICSSStyleSheet) list.item(i));
- ruleList.nodes.addAll(trav.getRules());
- }
- return ruleList;
- }
-
- /**
- * For style sheet languages that support the concept of style sheet
- * inclusion, this attribute represents the including style sheet, if one
- * exists. If the style sheet is a top-level style sheet, or the style
- * sheet language does not support inclusion, the value of this attribute
- * is <code>null</code>.
- */
- public StyleSheet getParentStyleSheet() {
- CSSRule owner = getOwnerRule();
- if (owner != null)
- return owner.getParentStyleSheet();
- return null;
- }
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheetList
- */
- public org.w3c.dom.stylesheets.StyleSheetList getParentStyleSheets() {
- List list = (getModel().getStyleListeners() != null) ? new Vector(getModel().getStyleListeners()) : null;
- if (list == null)
- return null;
- InternalStyleSheetList sheets = new InternalStyleSheetList();
- Iterator it = list.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (obj instanceof ICSSModel) {
- sheets.appendNode(((ICSSModel) obj).getDocument());
- }
- }
- if (sheets.getLength() > 0)
- return sheets;
- else
- return null;
- }
-
- /**
- * The advisory title. The title is often specified in the
- * <code>ownerNode</code>. See the title attribute definition for the
- * <code>LINK</code> element in HTML 4.0, and the title pseudo-attribute
- * for the XML style sheet processing instruction.
- */
- public String getTitle() {
- Node node = getOwnerNode();
- if (node instanceof Element) {
- return ((Element) node).getAttribute("TITLE");//$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * This specifies the style sheet language for this style sheet. The style
- * sheet language is specified as a content type (e.g. "text/css"). The
- * content type is often specified in the <code>ownerNode</code>. Also
- * see the type attribute definition for the <code>LINK</code> element
- * in HTML 4.0, and the type pseudo-attribute for the XML style sheet
- * processing instruction.
- */
- public String getType() {
- Node node = getOwnerNode();
- if (node instanceof Element) {
- return ((Element) node).getAttribute("TYPE");//$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * Used to insert a new rule into the style sheet. The new rule now
- * becomes part of the cascade.
- *
- * @param rule
- * The parsable text representing the rule. For rule sets this
- * contains both the selector and the style declaration. For
- * at-rules, this specifies both the at-identifier and the rule
- * content.
- * @param index
- * The index within the style sheet's rule list of the rule
- * before which to insert the specified rule. If the specified
- * index is equal to the length of the style sheet's rule
- * collection, the rule will be added to the end of the style
- * sheet.
- * @return The index within the style sheet's rule collection of the newly
- * inserted rule.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be
- * inserted at the specified index e.g. if an
- * <code>@import</code> rule is inserted after a standard rule set or other
- * at-rule. <br>
- * INDEX_SIZE_ERR: Raised if the specified index is not a valid
- * insertion point. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly. <br>
- * SYNTAX_ERR: Raised if the specified rule has a syntax error and
- * is unparsable.
- */
- public int insertRule(String rule, int index) throws DOMException {
- int length = getCssRules().getLength();
- if (index < 0 || length < index)
- throw new DOMException(DOMException.INDEX_SIZE_ERR, "");//$NON-NLS-1$
-
- IStructuredDocument doc = getModel().getStructuredDocument();
- CSSRuleImpl refRule = (length != index) ? getIndexedRule(index) : null;
- int offset = (refRule != null) ? refRule.getStartOffset() : doc.getLength();
- doc.replaceText(this, offset, 0, rule);
-
- // insertBefore((CSSNodeImpl) createCSSRule(rule),refRule);
- return index;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newRule
- * org.w3c.dom.css.CSSRule
- * @param refRule
- * org.w3c.dom.css.CSSRule
- */
- public org.w3c.dom.css.CSSRule insertRuleBefore(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule refRule) throws org.w3c.dom.DOMException {
- if (newRule == null && refRule == null)
- return null;
-
- CSSRule ret = (CSSRule) insertBefore((CSSNodeImpl) newRule, (CSSNodeImpl) refRule);
- return ret;
- }
-
- /**
- * @return boolean
- */
- public boolean isDocument() {
- return true;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule removeRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
- if (rule == null)
- return null;
-
- CSSRule ret = (CSSRule) removeChild((CSSNodeImpl) rule);
- return ret;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newChild
- * org.w3c.dom.css.CSSRule
- * @param oldChild
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule replaceRule(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule oldRule) throws org.w3c.dom.DOMException {
- if (newRule == null && oldRule == null)
- return null;
-
- CSSRule ret = (CSSRule) replaceChild((CSSNodeImpl) newRule, (CSSNodeImpl) oldRule);
- return ret;
- }
-
- /**
- * setDisabled method comment.
- */
- public void setDisabled(boolean disabled) {
- this.fDisabled = disabled;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java
deleted file mode 100644
index cfbd98116e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.w3c.dom.css.CSSUnknownRule;
-
-
-/**
- *
- */
-class CSSUnknownRuleImpl extends CSSRuleImpl implements CSSUnknownRule {
-
- // TODO: This field is never read
- String fCssText = null;
-
- /**
- *
- */
- CSSUnknownRuleImpl() {
- super();
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CSSUnknownRuleImpl
- */
- CSSUnknownRuleImpl(CSSUnknownRuleImpl that) {
- super(that);
- }
-
- /**
- * @return com.ibm.sed.css.interfaces.CSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSUnknownRuleImpl cloned = new CSSUnknownRuleImpl(this);
-
- return cloned;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return UNKNOWNRULE_NODE;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return UNKNOWN_RULE;
- }
-
- /**
- * @param cssText
- * java.lang.String
- */
- public void setCssText(String cssText) {
- this.fCssText = cssText;
-
- super.setCssText(cssText);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java
deleted file mode 100644
index e715cda50b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICounter;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.Counter;
-
-
-/**
- *
- */
-class CounterImpl extends CSSPrimitiveContainer implements ICounter {
-
- /**
- *
- */
- CounterImpl() {
- super(CSS_COUNTER);
- }
-
- /**
- * @param that
- * com.ibm.sed.css.treemodel.CounterImpl
- */
- CounterImpl(CounterImpl that) {
- super(that);
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CounterImpl cloned = new CounterImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * This method is used to get the Counter value. If this CSS value doesn't
- * contain a counter value, a <code>DOMException